How to do AR Flow List
(step 1).
Make a Query A called "AR Balance":
1. Transaction Date
2. AR Balance [use running-total(transaction amount)]
(step 2).
Make a Query B called "Transactions":
1. Transaction Date
2. Charges
3. Adjustments
4. Denials
5. Payments
(step 3).
Join the two queries together on Transaction Date (1,1) -- (1,1)
Ending Balance = [AR Balance].[AR Balance]
Pre AR Balance = [Ending Balance] + [Denials] + [Payments] + [Adjustments] - [Charges] (calculated backwards)
Create a Month data item to group by. (_make_timestamp(extract(year, [Trans_Date]), extract(month, [Trans_Date]), 1))
(Step 4)
Create the Main Query:
[Month_Year] = [Join].[Month_Year]
[Charges] = total ([Join].[Charges] for [Join].[Month_Year])
[Payments] = ...
[Adjustments] = ...
[Pre AR Balance] =
maximum(
if ([Join].[Trans_Date] = minimum([Join].[Trans_Date] for [Join].[Month_Year]))
then ([Join].[Pre AR Balance])
else (-10000000000)
for [Join].[Month_Year])
[Ending AR Balance] = [Pre AR Balance] + [Charge] - [Payments] - [Adjustments] - [Denials]
[Month-Year-Display]:
case (cast(extract(month, [Join].[Trans_Date]), varchar(2)))
when '1' then ('Jan ')
when '2' then ('Feb ')
when '3' then ('Mar ')
when '4' then ('Apr ')
when '5' then ('May ')
when '6' then ('Jun ')
when '7' then ('Jul ')
when '8' then ('Aug ')
when '9' then ('Sep ')
when '10' then ('Oct ')
when '11' then ('Nov ')
when '12' then ('Dec ')
else ('')
end
+
cast(extract(year, [Join].[Trans_Date]), varchar(4))
Done!

0 Comments:
Post a Comment
<< Home