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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis


Hi,

Can somebody help me with this set analysis expression?

=sum({<[Transaction Code]={'959','654','661','660','659','658','657','655','664','653',

                           '652','651','650','656','662','663','851','852','853','854',

                           '855','856','857','858','859','860','861','862'},

       
[Transaction Run Month Year]={'Mar 2015'}>}[Transaction Amount])

Instead of hard coding "Mar 2015", I want the expression to automatically take Transaction Run Month Year -1.

Thank you in advance.

Regards,

Adi

8 Replies
MK_QSL
MVP
MVP

{"$(=Date(MonthStart(Today(),-1),'MMM-YYYY'))"}

Not applicable
Author

Hi ,

Create a variable let vMaxMinus1Year= AddYears(Max(Transaction Date()),-1);

Then use the above variable in set analysis

sum({<[Transaction Code]={'959','654','661','660','659','658','657','655','664','653',

                           '652','651','650','656','662','663','851','852','853','854',

                           '855','856','857','858','859','860','861','862'},

       
[Transaction Run Month Year]={'$(vMaxMinus1Yea)'}>}[Transaction Amount])

Thanks,

shekar.

Not applicable
Author

It's not working Manish.

Not applicable
Author

Its not working, Shekar!!!

Anonymous
Not applicable
Author

Remove "-" from the Manish's solution:

... [Transaction Run Month Year]={"$(=Date(MonthStart(Today(),-1),'MMM YYYY'))"} ...

Not applicable
Author

Thank you Michael, it worked.

Anonymous
Not applicable
Author

I think Manish deserves the "correct" points.

Not applicable
Author

Thank u Manish!!