Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Last two months in dimension

I want last two months in dimension in povit table

please guide me

this is my data

5 Replies
Anil_Babu_Samineni

Set analysis is the solution

Sum({<Factoryship_Moonth = {">=$(=Max(Factoryship_Moonth-1)) <=$(=Max(Factoryship_Moonth))"}>} Measure)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I want the calculated condition in dimension not in expression

Anil_Babu_Samineni

Perhaps this?

If(Factoryship_Moonth >= AddMonths(Max(TOTAL Factoryship_Moonth), -1) and Factoryship_Moonth <= Max(TOTAL Factoryship_Moonth), Factoryship_Moonth)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

can't you create a the dimension in script? you can set a variable "max month" and then create the dimension by comparing the month field with "max month" and "max month -1". if true it assigns the month field value, null() otherwise

sunny_talwar

I think this should be enough

If(Factoryship_Moonth >= AddMonths(Max(TOTAL Factoryship_Moonth), -1), Factoryship_Moonth)

But I wonder why the OP doesn't want to use set analysis?