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

How to plot data in a chart offset to the dimension? (2 month previous to month in X axis)

I am trying to plot Actual Sales v Forecast Sales but the quirk is that for the current month the data is for 2 months previous. This is well known in the business so there is no confusion about it. 

My set analysis works in my line chart for the current month but doesnt work for any other month. 

I have included an example to highlight the principle of it with the only difference being in my real world example i have a variable for Current month which is in the set analysis like below. In the attached example the dates are hard coded. Logic will still be the same in that i want the set analysis to be dynamic. 

 

Essentially my set analysis looks like:

 

Sum(
{<
ReportMonth = vCurrentMonth
ForecastSales = vCurrentMonth -2
>}Sales)

which works perfectly for the latest month in the chart but is wrong for every other month.

For the below chart...

DaithiOK_0-1591006749057.png

..the Dec 2016 figure of 494K should be the 687K of Oct and so one. 

Any help would be greatly appreciated. 

Labels (2)
1 Reply
zhadrakas
Specialist II
Specialist II

The AsOfTable could be a good approach to set the flag you need.

https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130