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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
ajaykumar1
Creator III
Creator III

last 13 months data

Hi All,

1.How we can get the last 13 months data with out writing the 13 expressions in chart.

stuck some where to write the variable for 13 months and pass that to set analysis level.The field is 'Month' which is having around 20+ months data.

Thanks,

Ajay

Labels (1)
12 Replies
Not applicable

hi,

can any body post the set analysis expression for this .

regards

Mahesh

sudeepkm
Specialist III
Specialist III

As Luca suggested you can give ID or number to your Months like below. Assume that your date field name is "Period"

num(Month(Period)) + if(year(Period)=Year(Today()),12,0) as MonthNum, // Use this in your master calendar script

Then you can create two variables to hold the values of the max  (MonthNum) and max(MonthNum,12) like below

vMaxMonNum = max(MonthNum)

vMaxMonNum12 = max(MonthNum,12)

Then in your chart dimension use the given below: Assume that you want to show the MonthYear in the dimension then you can write something like this.

=if(MonthNum>vMaxMonNum13 and MonthNum<=vMaxMonNum,MonYr)

If you want to do it in expression then you can use Set Analysis to achieve this: Multiple expressions starting from

sum({< Period={"$(=max(Period))"} >}Amount) // latest month

till

sum({< MonStart={"$(=Num(MonthStart(max(Period),-12)))"} >} Amount)

Carlos_Reyes
Partner - Specialist
Partner - Specialist

I already did, review my example.