Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rangesum and peek in resident load

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]

;

2 Replies
Not applicable
Author

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];

Not applicable
Author

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]

;