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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
imik
Contributor
Contributor

Nesting aggregations: SUM(AVG())?

Hi, 

I'd like to ask for help with the issue I am currently dealing with.

I have two calculations 

1.sum(if(MNTH_ULTIMO_FLAG='1',(ACTUAL)))/sum(if(MNTH_ULTIMO_FLAG='1',(MTD_PLAN))) 
2.sum(if(DATE(CAL_DATE)=Date(Today() -1),(ACTUAL)))/sum(if(DATE(CAL_DATE)=Date(Today() -1),(MTD_PLAN)))

and I need to put them into one if expression: if I select in the filter for example "2017-Jan" than I need 1. and if nothing is selected I need the bar chart to display 2.

MNTH_ULTIMO_FLAG='1' is the last day of month

Actual and MTD_Plan numbers should be only for either last day of the month (MNTH_ULTIMO_FLAG='1') or yesterday (Date(Today() -1))

Thank you for advise. 

imk

 

 

0 Replies