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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Join two expressions from the same table

Hi All,

I'm trying to combine 2 calculations within the same expression. I have one dimension (Year) and for Year 2003 and 2004 I need to perform one calculation and for the other Years another. I need to display the results on the same table. I'm currently using this expression:

SUM({<YEAR = {'2003', '2004'}>} AGGR(SUM(AVG(SALES), ID, YEAR, MONTH)) /

SUM({<YEAR = {'2003', '2004'}>} AGGR(SUM(AVG(AMOUNT), ID, YEAR, MONTH))

&

SUM({<YEAR = {2005, '2006', '2007'}>} AGGR(SUM(SUM(SALES), ID, YEAR, MONTH)) /

SUM({<YEAR = {'2005', '2006', '2007'}>} AGGR(SUM(SUM(AMOUNT), ID, YEAR, MONTH))

Qlikview will compile only the second calculation and discard the first one.

Any help would be much appreciated. Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

hi,   can't the IF be used, i mean conditional sum?

Regards,  tresesco

View solution in original post

1 Reply
tresB
Champion III
Champion III

hi,   can't the IF be used, i mean conditional sum?

Regards,  tresesco