Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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 (1)
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!