Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
cfountain72
Creator II
Creator II

Calculate Payor Mix Percentage by Row

Hi,

For the chart below, I need to get the percentage that each row makes up of the total for given TX_POST_DATE. For instance, for 3/20/2019, we'd expect to see Commercial be 6,540,756.95 of 23,673,227.17 (or 27.6%). I tried using AGGR:

=sum(aggr(Sum({<AmountType = {'HB Chg'}>}TrxAmount), TX_POST_DATE))

...but it puts it on a row separate from the payor rows. The third column is:

=Sum({<AmountType = {'HB Chg'}>}TrxAmount)

Any ideas? This seems like a fairly simple thing to do, but I haven't been able to find the solution yet.

Thanks in advance,

Chris

Payor Mix Aggr.jpg

 

 

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum({<AmountType = {'HB Chg'}>} TrxAmount)/
Sum(TOTAL <TX_POST_DATE> {<AmountType = {'HB Chg'}>} TrxAmount)

or

Sum({<AmountType = {'HB Chg'}>} TrxAmount)/
Aggr(NODISTINCT Sum({<AmountType = {'HB Chg'}>} TrxAmount), TX_POST_DATE)

View solution in original post

2 Replies
sunny_talwar

Try this

Sum({<AmountType = {'HB Chg'}>} TrxAmount)/
Sum(TOTAL <TX_POST_DATE> {<AmountType = {'HB Chg'}>} TrxAmount)

or

Sum({<AmountType = {'HB Chg'}>} TrxAmount)/
Aggr(NODISTINCT Sum({<AmountType = {'HB Chg'}>} TrxAmount), TX_POST_DATE)
cfountain72
Creator II
Creator II
Author

Awesome, thanks for the quick reply Sunny! Have a good one!