Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
padmanabhan_ram
Contributor II

Average Change per 10 week

Dear All,

I am trying to get the value of Average Change per 10 week. Please find the attached qvw and excel sheet with Sheet name 'Data' which contains sample date to load into QlikView and Sheet 'Expected calculation', the Cell 'Calculated Slope' is the expected output in the QlikView for 'Average change per 10 week' column.

Looking for your response. Thank you.

Br,

Padmanabhan

6 Replies
MVP & Luminary
MVP & Luminary

Re: Average Change per 10 week

Calculate the difference between weeks for each region in the script:

Temp:

LOAD

     Region,

     Week,

     Volume

FROM

     excelfile

     ;

Result:

LOAD

     Region,

     Week,

     Volume,

     If(Region=Previous(Region),Volume-Previous(Volume)) as Change

RESIDENT

     Temp

ORDER BY

     Region, Week

     ;

DROP TABLE Temp;

Then calculate the average in the chart with the expression Avg(Change).


talk is cheap, supply exceeds demand
Not applicable

Re: Average Change per 10 week

Hi,

check this.Hope this helps.

Thanks.

padmanabhan_ram
Contributor II

Re: Average Change per 10 week

Dear Gysbert,

Thank you for the response. But when i try to apply the same logic for bigger size of data the output doesn't match.

Please find the attached data, where the output for 'Average change per 13 week' should be 28 for the below selections.

Area='South', Product='A'.

could you please help me to find this out.

Br,

Padmanabhan

kamielrajaram
Contributor III

Re: Average Change per 10 week

Hi,

Hope this helps or leads you in the right direction.

Regards

Kamiel

MVP & Luminary
MVP & Luminary

Re: Average Change per 10 week

Try as AsOf table: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
padmanabhan_ram
Contributor II

Re: Average Change per 10 week

Hi Kamiel,

Thank you for the reponse.

if I apply the same logic with large data then the output doesn't match.

Please find the attached data for which I am trying to get the Average change per 13 week = 28 for South Area, product =A.

Please let me know if you get the same value or near to that.

Br,

Padmanabhan