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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis expresion into another Set Analysis Expresion

Hi everybody, I have my sales defined like this:
SALES Expresion:
sum  ({$<INFOTYPE={'REAL'}>}[SALES MXN]/TC)/1000+sum({$<INFOTYPE={'UM6'}>}[SALES MXN]/TC)/1000
and I want to use my sales to get last year sales:
LAST YEAR Expresion
sum ({$<Year = {$(=only(Year) - 1) }, Month = {"<=$(=max(Month))"}>} Sales)
is just replacing my SALES Expresion into LAST Year Expresion?
is there any way to get this working?
Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Your first expression should be equivalent to

=sum  ({$<INFOTYPE={'REAL','UM6'}>}[SALES MXN]/TC) / 1000

i.e. you can set multiple values within a set element. Does this result in correct values?

Then I would assume last years sales should be

=sum  ({$<INFOTYPE={'REAL','UM6'}, Year= {$(=only(Year)-1)}, Month={"<=$(=max(Month))"} >}[SALES MXN]/TC) / 1000

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Your first expression should be equivalent to

=sum  ({$<INFOTYPE={'REAL','UM6'}>}[SALES MXN]/TC) / 1000

i.e. you can set multiple values within a set element. Does this result in correct values?

Then I would assume last years sales should be

=sum  ({$<INFOTYPE={'REAL','UM6'}, Year= {$(=only(Year)-1)}, Month={"<=$(=max(Month))"} >}[SALES MXN]/TC) / 1000

Hope this helps,

Stefan

Not applicable
Author

Wow!! it works perfectly,  excelent once again you helped me a lot.

Thank you very much Swuehl!!!