I have a unique problem that I have no idea how to solve. I have a set of data that is used for tracking customer charges. When adjustments are made, the dates for a billing period on the adjustment do not match the dates for the billing period due to a constraint in the billing system. What I am looking to do is combine all of the charges for a billing period where the billing period start date and billing period end dates are within a day of each other, + or - 1 day on either side of the actual billing period.
In the attached file, which is an example of the source billing data and the desired query result, I know what the actual billing period is supposed to be based on the Line Item "LI9" having a value populated in the "Usage" column. The desired output on the second tab shows all of these charges on 1 single line, only showing the correct billing period.
If this isn't clear, please let me know. Thank you so much in advance.