Acumulative bar chart based on filtered values (QlikSense)
Initially, I have a bar chart displaying the Sales (measure) per Country (dimension) in 2016 and the following two filters:
* Week: it contains number from 1 to 52 (referring the number of weeks of 2016).
* Period: it's a new field created in the data load editor. It can be equal to "Weekly" or "YTD".
Each of them can take only value at a time. Obviously, the data displayed by the bar chart changes every time we select a different week.
If Period is equal to "Weekly", I want to display the Sales per Country for the selected week. This works! Additionally, if Period is equal to "YTD", I would like to display the acumulative Sales (from first week to the selected week) per Country. Unfortunately, I'm having problems with the second part (Period equal to 'YTD').
Please find below the code for the measure of the bar chart typed up to the moment. I think the issue might be in the red highlighted part.
Thank you very much for your reply. Unfortunately, I does not work. If I use the code you provided me, it displays Sales, accumulated based on the Country (dimension of the bar chart) but not based on Week (added filter).