Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Last two months in dimension

I want last two months in dimension in povit table

please guide me

this is my data

5 Replies
Highlighted

Set analysis is the solution

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

I want the calculated condition in dimension not in expression

Highlighted

Perhaps this?

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor II
Contributor II

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

Highlighted

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?