Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anindya_manna
Partner - Creator II
Partner - 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.

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

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.

1 Solution

Accepted Solutions
caio_caminoski
Creator
Creator

Have you tried the following:

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


Of course you would have to change [rep id]  and [product name] for your field names.


Caio

View solution in original post

4 Replies
sunny_talwar

I don't see any date field in the attached application?

caio_caminoski
Creator
Creator

Have you tried the following:

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


Of course you would have to change [rep id]  and [product name] for your field names.


Caio

anindya_manna
Partner - Creator II
Partner - Creator II
Author

This one also working

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

anindya_manna
Partner - Creator II
Partner - Creator II
Author

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