Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Four Week Average at Script Level

Here is the file.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You have to aggragate per week first. Try this:

temp1:

LOAD

[Fiscal Week Ending] ,

sum([Sales Out $]) as Sales

from US.xls (biff, embedded labels, table is "Sheet 1$") group by [Fiscal Week Ending];

final:

load *,

Rangesum(Sales,peek(Sales,-1),peek(Sales,-2),peek(Sales,-3))as myRollingAvg

Resident temp1;

drop table temp1;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You have to aggragate per week first. Try this:

temp1:

LOAD

[Fiscal Week Ending] ,

sum([Sales Out $]) as Sales

from US.xls (biff, embedded labels, table is "Sheet 1$") group by [Fiscal Week Ending];

final:

load *,

Rangesum(Sales,peek(Sales,-1),peek(Sales,-2),peek(Sales,-3))as myRollingAvg

Resident temp1;

drop table temp1;


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert. It Works.

Working, was not concentrating on the repitition of data, my mistake.

Regards

Nassar