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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
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

1 Solution

Accepted Solutions
agigliotti
MVP
MVP

sorry

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

13 Replies
agigliotti
MVP
MVP

try using this expression:

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
sunny_talwar
MVP
MVP

Can be simplified to this

=Date(AddMonths(Max({1} [FSPM Month Number]), -1),'YYYYMM')

anindya_manna
Creator II
Creator II
Author

I want to date selection will change the calculation but not rep id or product name field.

if I choose  05/05/2017 then prev moth should be 201704.Date filter should work but not other filter effect the result.

anindya_manna
Creator II
Creator II
Author

I want to date selection will change the calculation but not rep id or product name field.

if I choose  05/05/2017 then prev moth should be 201704.Date filter should work but not other filter effect the result.

anindya_manna
Creator II
Creator II
Author

I want to date selection will change the calculation but not rep id or product name field.

if I choose  05/05/2017 then prev moth should be 201704.Date filter should work but not other filter effect the result.

sunny_talwar
MVP
MVP

May be this

=Date(AddMonths(Max({1<[FSPM Month Number] = p([FSPM Month Number])>} [FSPM Month Number]), -1),'YYYYMM')

agigliotti
MVP
MVP

try using this expression:

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
anindya_manna
Creator II
Creator II
Author

Its not working.

it displaying 245203.Also  date selection not affecting the result

sunny_talwar
MVP
MVP

Would you be able to share a sample to look at this?