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: 
byrnel0586
Creator
Creator

Set Analysis - overall sum by month

Hi,

Please see the table below:

For the Num column I am currently using this expression to sum the PHARM_NUM_STATUS based on selections and to show a YOY comparison and it is working.

=Sum({<PHARM_Year, PHARM_MonthNum = {"=PHARM_MonthNum = Max(TOTAL <PHARM_Year> Aggr(PHARM_MonthNum, PHARM_Year))"}>} PHARM_NUM_STATUS)

But now for the CP Num  column I am needing to show the overall sum of all data as a comparison, even when a selection is made. I tried

=Sum({<PHARM_Year, PHARM_MonthNum = {"=PHARM_MonthNum = Max(TOTAL <PHARM_Year> Aggr(PHARM_MonthNum, PHARM_Year))"}>} {1}PHARM_NUM_STATUS)

but this is summing all PHARM_NUM_STATUS for the entire year.

Any help is appreciated.

1 Solution

Accepted Solutions
sunny_talwar

May be this

=Sum({<GROUPER_NAME, PHARM_Year, PHARM_MonthNum = {"=PHARM_MonthNum  = Max(TOTAL <PHARM_Year> Aggr(PHARM_MonthNum, PHARM_Year))"}>} PHARM_NUM_STATUS)

View solution in original post

12 Replies
sunny_talwar

May be this

=Sum({1<PHARM_MonthNum = {"=Only({1} PHARM_MonthNum) = Max({1}TOTAL <PHARM_Year> Aggr(Only({1} PHARM_MonthNum), PHARM_Year))"}>} PHARM_NUM_STATUS)

byrnel0586
Creator
Creator
Author

Thank you, but that is returning 0's for both 2016 and 2017.

sunny_talwar

Would you be able to share a sample to look at this?

byrnel0586
Creator
Creator
Author

Sure, here you go. The total CP Num for 2016 should be 117,483 and for 2017 = 117,199. But, I would like those numbers to change based on the type (Diabetes, RAS, Statin) and months chosen. Thank you!!

sunny_talwar

May be this

=Sum({<GROUPER_NAME, PHARM_Year, PHARM_MonthNum = {"=PHARM_MonthNum  = Max(TOTAL <PHARM_Year> Aggr(PHARM_MonthNum, PHARM_Year))"}>} PHARM_NUM_STATUS)

byrnel0586
Creator
Creator
Author

Thank you, it is working! I am now having an issue I think with the Star value.... You can see for the 2017 Star it is saying 4, but the rate  = 89.37% and to the right you can see the STAR 5 threshold is 89%, so it should be a 5... I am not sure why it is reading this wrong. I've attached a new app so you can see what I mean.

sunny_talwar

When I open your dashboard, I see this

Capture.PNG

Which selections bring me to those results 89.37% and 4?

byrnel0586
Creator
Creator
Author

Grouper Name = Navarro, Type = Diabetes, Month = 8, and Year = 2017. Then you can see down in the YOY table the 89.37% Rate and 4 Star value. But the list boxes to the right show the STAR 5 threshold being 89%, so the Star should = 5 instead of 4.

sunny_talwar

Same selection as you mentioned shows me 89.81% for CP Rate and 5 for CP Star

Capture.PNG