Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
I am trying to limit my bar chart to show only the last three months instead of all months.
Is there a simple peice of code I can use that will do this automatically?
My graph currently shows sales figures for Feb,Mar,Apr,May,Jun.
I would like it to only show Apr, May, Jun and when it brings in July figures in July I would like it to drop Apr and just show May,Jun,Jul.
Is this possible?
In the attachment below I have shown what it currently looks like. The dimension is Month/Year.
Would greatly appriciate the help.
Thanks
This blog post of Henric Conström will help you out:
http://community.qlik.com/blogs/qlikviewdesignblog/2013/06/10/relative-calendar-fields
The clue is creating a new field (MonthAgo) in the script and using it in your expression (set analysis).
Regards,
Florian
I set analysis.
Month={'>=$(=max(Month)-2)'}
Thanks.
Narender
I set analysis.
Month={'>=$(=max(Month)-2)'}
Thanks.
Narender
try this
Sum({<Month = {">=$(=max(Month)-2)"}>}sales)
That's brilliant thanks everyone for your help, the set is working.
Much appriciated.