Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a script which is giving invalid expression error for rangesum and peek. Can somebody please help me with this. I am in deep trouble to get this done by Monday. If somebody can help it will be really good. I have department account id and post transaction credit amount. I need sum of the cumulative post transaction credit amount for every month last date. I would like to have this in a resident load script but its not working as I expected. Can somebody tell whats wrong in this expression. If I take out rangesum and peek the script works fine.
aggr_
$(qvd_name):
NoConcatenate
LOAD
[Department Account Id],
[Month Last Date],
sum(
[Post Transaction Credit Amount])
as
PTCA,
if(
[Department Account Id]=
previous(
[Department Account Id]),
rangesum(
[Post Transaction Credit Amount],
peek(
Cumulative)),
[Post Transaction Credit Amount])
as
Cumulative
//if([Department Account Id]=previous([Department Account Id]), rangesum([[Post Transaction Credit Amount]),[Daily Production]) as Cumulative
Resident
temp_$(qvd_name)
group
by
[Department Account Id]
,
[Month Last Date]
Order
By
[Department Account Id]
,
[Month Last Date]
;
sorry script is as below. pleas eignore the above
aggr_
$(qvd_name):
NoConcatenate
LOAD
[Department Account Id],
[Month Last Date],
sum(
[Post Transaction Credit Amount])
as
PTCA,
if(
[Department Account Id]=
previous(
[Department Account Id]),
rangesum(
[[Post Transaction Credit Amount],
peek(
Cumulative)),
[Daily Production])
as
Cumulative
Resident temp_
$(qvd_name)
group
by
[Department Account Id],
[Month Last Date]
Order
By
[Department Account Id],
[Month Last Date];
aggr_
$(qvd_name):
NoConcatenate
LOAD
[Department Account Id],
[Month Last Date],
sum(
[Post Transaction Credit Amount])
as
PTCA,
if(
[Department Account Id]=
previous(
[Department Account Id]),
rangesum(
[[Post Transaction Credit Amount],
peek(
Cumulative)),
[Post Transaction Credit Amount])
as
Cumulative
Resident temp_
$(qvd_name)
group
by
[Department Account Id],
[Month Last Date]
Order
By
[Department Account Id],
[Month Last Date];
here is the corrected one again
aggr_
$(qvd_name):
NoConcatenate
LOAD
[Department Account Id],
[Month Last Date],
sum(
[Post Transaction Credit Amount])
as
PTCA,
if(
[Department Account Id]=
previous(
[Department Account Id]),
rangesum(
[Post Transaction Credit Amount],
peek(
Cumulative)),
[Post Transaction Credit Amount])
as
Cumulative
//if([Department Account Id]=previous([Department Account Id]), rangesum([[Post Transaction Credit Amount]),[Daily Production]) as Cumulative
Resident
temp_$(qvd_name)
group
by
[Department Account Id]
,
[Month Last Date]
Order
By
[Department Account Id]
,
[Month Last Date]
;