Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Graph showing Previous 12 Months from Selected Date

Hi..

I need to look back over the previous 12 months from a selected date (Stock), in a graph

Something like

For selected Date 1/2010

Date               1/2009      2/2009      ....     1/2010.

12" Wheel          5                12                    22         

15" Wheel          7                 9                      5

So that it picks up the stock values for those months as a sum of all product stock. the DDL Selector is selecting the end of the period and I want to look up the previous 12 months. If I allow multiple months selected then the tables (grids) cease to be correct.

i.e. the date selector picks upi the actual values for the specific month nad the graph shows the actual values for each month up to 12 months previously. I'm looking for a simple dataset that is not overridden by the date selector e.g. Select Dates between dateadd(end,-12) and end... or similar. The data is present, its just filtered by the selected date.

And I can't allow multiple date selection

Thanks

John

3 Replies
Not applicable
Author

I would suggest a simple set analysis expression like the one below:

count({$<$(varSetPeriod)={$(=max($(varSetPeriod))-1)}}>} stock)


Then in your load script identify $(varSetPeriod) as either a month/year or just a year field and modify the above expression from -1 to -2 for two months ago and repeat the expression as needed. Alternatively you can hard code specific dates instead of using the $(variable).

Not applicable
Author

Thaks for last... but doing it the other way (Using Slider control for select one or more months - looks good) but stuck on getting Grids for show last month only. I've been trying to get the following to work but must have syntax wront somewhere as I get no values...

sum({$<[Sale Date]={Max({$}[Sale Date])}>}[Month Sales] * [Product Euro])

Any help?

Thanks

Not applicable
Author

break it down into two expressions:

sum({$<[Sale Date]={Max({$}[Sale Date])}>}[Month Sales]) * sum({$<[Sale Date]={Max({$}[Sale Date])}>}[Product Euro])

Aslo, test them individually to verify your syntax is correct and functional.