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

Urgent! problem to display 2 different KPIs conditionally in the same bar chart

Hello,
I have a qlikview application in which I load the variable as follows in the load script section:
LET v_ReportWeek = '2016-W05';

I have the following requirement to develop a bar chart as follows:

Case scenario 1:
If user selects a week ('2016-W02') which is less than the v_ReportWeek, then in the same barchart I shall have displayed:
For selected week minus 1, that is Week '2016-W01' till week '2016-W04', the bar chart should show the KPI Stock. And in the same barchart, it should show the KPI 'Forcast' for v_ReportWeek plus 10 weeks in the future, that is till week '2016-W15'

Case scenario 2:
If user selects a week ('2016-W05') which is same as the v_ReportWeek, then in the same barchart I shall have displayed:
For selected week minus 1, that is Week '2016-04' , the bar chart should show the KPI Stock. And in the same barchart, it should show the KPI 'Forcast'  for v_ReportWeek plus 10 weeks in the future, that is till week '2016-W15'

Case scenario 3:
If user selects a week ('2016-W04') which is less than the v_ReportWeek, then in the same barchart I shall have displayed:
For selected week minus 1, that is Week '2016-W03' till week '2016-W04', the bar chart should show the KPI Stock. And in the same barchart, it should show the KPI 'Forcast' for v_ReportWeek plus 10 weeks in the future, that is till week '2016-W15'
I also have a Period_WeekCounter associated with each week in sequence. FOr example, for week 04 in 2016, counter is 108, and for week 05 the counter is 109 and so on...

In my bar char dimension, I'm using the column Yr_Wk_Frcst as follows:

Expression is : 

=if(Yr_Wk_Frcst < v_ReportWeek, sum(Stock), sum(Forcast))

but its not working as its not giving me previous week's display and future week's display correctly.

Can you please please help? its urgent.. thanks in advance

The data i use is :


   
   
OPE_WEKOPE_YYItemCodeYr_Wk_FrcstStockForcastPeriod_WeekCounter
42016A2016-W041262-108
42016A2016-W04 1091108
42016A2016-W05 1091108
42016A2016-W06 1093108
42016A2016-W07 1095108
42016A2016-W08 1097108
42016A2016-W09 1099108
42016A2016-W10 1101108
42016A2016-W11 1103108
42016A2016-W12 1105108
42016A2016-W13 1107108
42016A2016-W14 1109108
42016A2016-W15 1111108
42016A2016-W16 1113108
42016A2016-W17 1115108
52016A2016-W051400-109
52016A2016-W05 2091109
52016A2016-W06 2093109
52016A2016-W07 2095109
52016A2016-W08 2097109
52016A2016-W09 2099109
52016A2016-W10 2101109
52016A2016-W11 2103109
52016A2016-W12 2105109
52016A2016-W13 2107109
52016A2016-W14 2109109
52016A2016-W15 2111109
52016A2016-W16 2113109
52016A2016-W17 2115109
0 Replies