Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a date field in the chart as x-axis.
Currently am showing 72 months of data, the full data.
now i want to show only latest 24 months of data in the x-axis in the chart.
how we can do that?
You could just use a variable in the dimension limits box. Have a variable vDateRange set by a checkbox/inputbox and put vDateRange into the dimension limits section.
Use set analysis. Say your current expression is Sum(Sales). Instead, try:
Sum({<Date={">=$(=AddMonths(Max(Date),-24))"}>} Sales)
Hope this helps,
Jason
(Or if you are using verson 11 then use dimension limits.)
Hi Jason,
I am using qlikview 11, so it works.
but i want to show 72 months data in the same chart also.
By default, i should show 24months data, and i have a checkbox,
clicking on checkbox, it should show full 72 months data.
This is the problem.
You could just use a variable in the dimension limits box. Have a variable vDateRange set by a checkbox/inputbox and put vDateRange into the dimension limits section.
Hi Jason,
Thanks for the answer, it works fine,
but how can i do this for pivot table?
In Pivot table, dimension limit tab is not there.
Please help.
I think you'll need to use my expression suggestion above, replacing -24 with vDateRange.
Jason,
I need to use my field in place of Date in the above expression right?
I use it like that, but i didnt get the result.
Jason,
My Date field is of MMM YYYY format, but i checked this expression
(=AddMonths(Max(Date),-24))
I am getting 5/1/2012
but the data for month, I converted that into May 2012 format.
Is this creating problem for that?
Try:
Sum({<Date={">=$(=Date(AddMonths(Max(Date),-24),'MMM YYYY')"}>} Sales)