Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
RichardLee
Creator
Creator

Rolling 12 Month on filter selection

I have a table view that I would like to have a rolling 12 month from a selected date which would be the first column then the previous month and so on.

is this possible with an expression.

so If I select Jan 2023 in the drop down filter I would like the table to show

Jan 2023 | Dec 2022 | Nov 2022 | Oct 2022 and so on.

Thanks

Labels (1)
1 Solution

Accepted Solutions
ogster1974
Partner - Master II
Partner - Master II

sum({<[Master Date]={">$(=AddMonths(Max([Master Date]),-1))"}, [Data Type]={'Actual'}>} Value)

get rid of the if its unnecessary.

 

View solution in original post

7 Replies
ogster1974
Partner - Master II
Partner - Master II

sum({<[Date]={">$(=AddMonths(Max([Date]),-12))"}>} Sales)

RichardLee
Creator
Creator
Author

Thanks for that but if I wanted to now limit it a little bit more

 

sum(if({<[Master Date]={">$(=AddMonths(Max([Master Date]),-1))"}>} and [Data Type]='Actual', Value))

 

how could I do this?

ogster1974
Partner - Master II
Partner - Master II

sum(if({<[Master Date]={">$(=AddMonths(Max([Master Date]),-1))"}, [Data Type]={'Actual'}>} Value))

RichardLee
Creator
Creator
Author

Tried that previously and I get an Error in the expression: if takes 2-3 parameters.

ogster1974
Partner - Master II
Partner - Master II

sum({<[Master Date]={">$(=AddMonths(Max([Master Date]),-1))"}, [Data Type]={'Actual'}>} Value)

get rid of the if its unnecessary.

 

RichardLee
Creator
Creator
Author

Thanks you so much 

RichardLee
Creator
Creator
Author

doesnt seem to work

RichardLee_0-1676294375524.png

 

RichardLee_1-1676294409077.png