Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
andreip21
New Contributor II

Price variations by aggregation

Hello all,

I have the following data: 6 products from 2 brands and price during 6 days period:

BrandProduct ID1-Dec2-Dec3-Dec4-Dec5-Dec6-Dec
A12020-203030
A2----4545
A3756060808080
A4101010---
B51001001001009090
B635-40303030

 

i will have differences day by day (2-Dec vs 1-Dec, 3-Dec vs 2-Dec):

when the product has no price in 2 consecutive days, the differences will be 0 (e.g. product ID 6 on 2-Dec vs 1-Dec)

BrandProduct ID1-Dec2-Dec3-Dec4-Dec5-Dec6-Dec
A1 000100
A2 00000
A3 -1502000
A4 00000
B5 000-100
B6 00-1000

 

and then i want to calculate for the 2 brands the price variations between days:

Brand 1-Dec2-Dec3-Dec4-Dec5-Dec6-Dec
A  -14%0%33%10%0%
B  0%0%-7%-8%0%

 

the formula for the last table will be:

By Brand: Sum of differences 2-Dec (from second table)/ Sum of prices 1-Dec (from first table)

but only for products that have positive values on 2 consecutive days (1-Dec and 2-Dec)

 

I attached the Excel file with an easy understand of what i want.

 

How to do this in Qlik?

 

Thank you,

Andrei

1 Reply
andreip21
New Contributor II

Re: Price variations by aggregation

any help, guys?

Community Browser