Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

On same Bar chart with dynamic conditional KPI

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-W041091108
42016A2016-W051091108
42016A2016-W061093108
42016A2016-W071095108
42016A2016-W081097108
42016A2016-W091099108
42016A2016-W101101108
42016A2016-W111103108
42016A2016-W121105108
42016A2016-W131107108
42016A2016-W141109108
42016A2016-W151111108
42016A2016-W161113108
42016A2016-W171115108
52016A2016-W051400-109
52016A2016-W052091109
52016A2016-W062093109
52016A2016-W072095109
52016A2016-W082097109
52016A2016-W092099109
52016A2016-W102101109
52016A2016-W112103109
52016A2016-W122105109
52016A2016-W132107109
52016A2016-W142109109
52016A2016-W152111109
52016A2016-W162113109
52016A2016-W172115109
0 Replies