Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
padmanabhan_ram
Creator II
Creator II

4x4 week growth in line graph

Hi All,

Hope you are doing good!!!

I need your help to identify logic in QlikView for calculating 4x4 week volume growth and present in a line graph. I have attached the required data. The requirement is to have Week Ending Date as Primary dimension, Product as Secondary secondary.

In the expression I need a logic that can calculate and give the % of  growth for each week using 4x4 week rolling.

For Example,

week, volume

1,10

2,20

3,30

4,40

5,50

6,60

7,70

8,80

9,90

10,100

the expression calculation should give value for each week say week 8 should do sum(volume of week8,7,6,5) which is 260 - sum(volume of week 4,3,2,1) which is 100 and output should be (260-100)/100=1.6.

the value for week 9 should be (300-140)/140=1.1

the value for week 10 should be (340-180)/180=0.8

please let me know if you find the logic.

Thanks in advance.

Padmanabhan

17 Replies
padmanabhan_ram
Creator II
Creator II
Author

Hi Mayil,

I am getting exact values for most of the weeks but for the initial three weeks it gives me negative values which seems to be wrong.I can understand that since it is rolling 4x4 weeks for the first three months the logic cannot be applied. Is there way where we can apply the logic for the rest of the weeks and for the first three weeks divide by it's previous weeks value.

Br,

Padmanabhan

MayilVahanan

HI

Can you provide your final expression which you are currently using?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
padmanabhan_ram
Creator II
Creator II
Author

aggr((RangeSum(Above(Total Sum(SumOfVolume),0, 4)) - RangeSum(Above(TOTAL Sum(SumOfVolume),4, 4))) /

RangeSum(Above(Total Sum(SumOfVolume),4, 4)),Product,WeekEndingDate)

arasantorule
Creator III
Creator III

Hi Padmanabhan,

You can include if(rowno()<4) and 3 and 2 in the expression and change the logic slightly for the same. Above expression will work for remaining rows

Hope this helps.

Thanks.

padmanabhan_ram
Creator II
Creator II
Author

Thanks Arasan, I did alter the dimension and the same can be achieved as you said in the expression.

Thanks,

Padmanabhan

padmanabhan_ram
Creator II
Creator II
Author

But this isn't the proper solution, if anyone gets better solution please let me know. This can used as a workaround.

Br,

Padmanabhan

MayilVahanan

Hi

Try some thing like this

if(Sum(Aggr(RangeSum(Above(TOTAL Sum(SumOfVolume),4, 4)), Product, WeekEndingDate)) =0, yourexpectedexpression,

Sum(aggr((RangeSum(Above(Total Sum(SumOfVolume),0, 4)) - RangeSum(Above(TOTAL Sum(SumOfVolume),4, 4))) /

RangeSum(Above(Total Sum(SumOfVolume),4, 4)),Product,WeekEndingDate)))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
padmanabhan_ram
Creator II
Creator II
Author

Hi Mayil,

I am trying to calculate the Market Share for the same data, instead of volume growth we have calculate the market share for each week at 4x4 rolling week.

the calculation would be,

  

WeekEndingDateProduct           Volume
11/09/2015B2500.514
11/09/2015C2535.499
11/09/2015Q2621.334
11/09/2015S786.003
18/09/2015B2613.032
18/09/2015C2879.875
18/09/2015Q3016.402
18/09/2015S838.874
25/09/2015B2537.9
25/09/2015C2718.5
25/09/2015Q2938.999
25/09/2015S878.431
02/10/2015B2682.554
02/10/2015C2785.829
02/10/2015Q2895.987
02/10/2015S923.699
09/10/2015B2564.971
09/10/2015C2607.318
09/10/2015Q2944.698
09/10/2015S860.106
16/10/2015B2561.301
16/10/2015C2797.65
16/10/2015Q2892.23
16/10/2015S965.714
23/10/2015B2480.962
23/10/2015C2658.131
23/10/2015Q2863.209
23/10/2015S959.583
30/10/2015B2464.132
30/10/2015C2776.401
30/10/2015Q2921.564
30/10/2015S991.447

for the week 30/10/2015 the calculation for market share for S should be

Current Week Share:

sum(volume for week 30,23,16,9)=3776,

sum of total volume for the week 30,23,16,9 including all the product =36309.

Share=3776/36309=10.3

Previous Week Share:

sum(volume for previous week 2,25,18,11)=3427,

sum of total volume for the previous week 2,25,18,11 including all the product =36153.

Share=3427/36153=9.4

Share Change is 10.3-9.4=0.9 this is for product S, the same calculation should be considered for other products.

can you please help me if you can find the logic.

Br,

Padmanabhan