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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
anindya_manna
Creator II
Creator II

Convert this expression into set expression

Below expression is for calculating previous month.

=date(AddMonths(date#(max([FSPM Month Number]),'YYYYMM'),-1),'YYYYMM')

I want to calculate previous month based on date filter. It should not affected by any other selection like product name and rep id.

Bu using above normal exp. previous month calculation is changing as per selection like product name and rep id

Labels (1)
3 Replies
tresB
Champion III
Champion III

Like this?

=date(AddMonths(date#(max( {<product, repid, anyotherfield>} [FSPM Month Number]),'YYYYMM'),-1),'YYYYMM')


Note: If you want this to be unresponsive to any selection, you could just use {1}, like


date(AddMonths(max( {<1>} [FSPM Month Number]),-1),'YYYYMM')


Note: Here date#() is redundant (assuming your expression was a working one).

Clever_Anjos
Support
Support

Try this

Sum({1<[FSPM Month Number]={"$(=date(AddMonths(date#(max([FSPM Month Number]),'YYYYMM'),-1),'YYYYMM'))"}>} yourvaluefield)

Clever_Anjos
Support
Support