Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Unveils New Agentic Capabilities Across Analytics, Data Engineering, and Trust: Learn More!
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!