Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Aggr and Rank in Load Script

Hello everyone,

I have a problem where i need to convert these code into a readable code in the load script.

If( [Total Complaint Received] = 0, 1, Aggr(Rank(-Sum([Total Complaint Received]), 1,1), Factory) - 1)


As we all know, both Aggr and Rank function cannot use in the load script. Does anyone know how?


Thank you in advance!!!

11 Replies
Anonymous
Not applicable
Author

Based on information provided by Omar and Kevin,

I came out with a solution

newtable:

Load

[Factory],

    [Total Complaint Received],

    if([Total Complaint Received] = 0, 1,

    if([Total Complaint Received] = peek([Total Complaint Received]), peek(Rank), recno()-1)) as Rank

Resident maintable,

Order by [Total Complaint Received]

Thank everyone!!!

omarbensalemksomosera10

ksomosera10
Creator II
Creator II

Goood!

Glad to help!