Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
padmanabhan_ram
Creator II
Creator 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
Gysbert_Wassenaar

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

Hi,

check this.Hope this helps.

Thanks.

padmanabhan_ram
Creator II
Creator II
Author

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
Creator III
Creator III

Hi,

Hope this helps or leads you in the right direction.

Regards

Kamiel

Gysbert_Wassenaar

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


talk is cheap, supply exceeds demand
padmanabhan_ram
Creator II
Creator II
Author

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