Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
candacemj
Partner - Contributor
Partner - Contributor

Retrieve back data based on current filter criteria

Currently I have a Year filter and a Month filter. No dates are used. Just year and month. 
When a user selects a Year and then selects a Month (eg. 2019, 04), the data that must be displayed needs to be for the current selection and 13 months back (so based on my example I want data from 2018, 03 until 2019, 04 ).
What I am trying to do is show 3month, 6month and 12month sales and budget averages in a bar graph.

I currently have this which is  not working. (YearPeriodId is a unquie key given to my Year and Month combination)
= (sum({$<YearPeriodId={"$(=Max(YearPeriodId)-1)"}>}Quantity) +sum({$<YearPeriodId={"$(=Max(YearPeriodId)-2)"}>}Quantity) + sum({$<YearPeriodId={"$(=Max(YearPeriodId)-3)"}>}Quantity)) /3

I have also tried using variables. Also not working.
sum({<MonthNum={">=$(=vMaxMonth,-3)) <=$(=vMaxMonth)"}>} Value)

0 Replies