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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to chart last 24 months

Hello everyone!

  I am pretty new to the QlikView and I would like to know if someone can assist (or explain) to me how to display a graph for the last 12 months based on a selected period , in this case if will be the Quarter and the Year. So for example, if the user selected 2017 and select 1st Quarter, it will display (sum of the value) the last 24 months on the graph. Below is a mock up of what I am trying to accomplish.

Below is what I have so far.

Any help will be appreciated. Thank you all!!!!

6 Replies
Anil_Babu_Samineni

May be use this? Change as per your Fields

Sum({$<Month=, Year=, Quarter, Date={">=$(=MonthStart(AddMonths(Max(DateID),-24)))<$(=MonthEnd(Max(DateID)))"}>} value)

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
muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Try like this,

Sum({$<Year=, Quarter, DateID={">=$(=(AddMonths(Max(DateID),-24)))"}, DateID={"<=$(=(Max(DateID)))"}>} Value)

Muthukumar Pandiyan
anagharao
Creator II
Creator II

Hi Ray,

Please find the solution attached.

Regards,

Anagha

Not applicable
Author

Thank you so much!!

One question, can you explain to me how and where are the variables vStartDate and vEndDate being set. Is it being set every time the user make a selection (year or/and quarter)? Your solution is very good and I would like to learn how it is being set.

Thank you again!!!

Regards

Ray

Anil_Babu_Samineni

You can set Script Level or Variable Overview (Ctrl + Alt + v). And then set. It's up to you how you want to select if you want to change of vStart and vEnd of the selection yes we can set those too

I am assume you may got answer from above. So go and close the Thread by flag "Correct Answer"

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
anagharao
Creator II
Creator II

Hi Ray,

The variables need to be created using variable overview (Ctrl+Alt+v) and their values refer to "DateID" column. Since the "DateID" column value changes with the selection in "Year" and "Quarter" column so will the value in the variables.

Hope this answers your question.