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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
anagharao
Creator II
Creator II

RANK() with set analysis

Hi All,

I cant seem to get this right. I have a list of records with set analysis to filter only the approved records, or to show amount for a range of date.

SUM({<[Amount(UN)]={'Approved'}>}AMOUNT)

SUM({<FiscalYear=,MonthShortName=,FiscalMonthKey={"$(='>=' & $(vSelYrMthStart) & '<=' & $(vSelYrMthEnd))"},[Amount(UN)]={'Approved'}>}AMOUNT)

I want to rank this and show only top 20. I always seem to random records for the below. Please help.

SUM({<[Amount(UN)]={'Approved'},[EMPLOYEE NAME]={"=Rank(Sum({<[Amount(UN)]={'Approved'}>}[AMOUNT]))<21"}>}AMOUNT)

SUM({<FiscalYear=,MonthShortName=,FiscalMonthKey={"$(='>=' & $(vSelYrMthStart) & '<=' & $(vSelYrMthEnd))"},[Amount(UN)]={'Approved'},[EMPLOYEE NAME]={"=Rank(Sum({<FiscalYear=,MonthShortName=,FiscalMonthKey={""$(='>=' & $(vSelYrMthStart) & '<=' & $(vSelYrMthEnd))""},[Amount(UN)]={'Approved'}>}[AMOUNT]))<21"}>}AMOUNT)

Regards,

Anagha

Labels (1)
1 Solution

Accepted Solutions
Not applicable

Try something like:

Aggr(Rank(SUM({<[Amount(UN)]={'Approved'},[EMPLOYEE NAME]={"=Rank(Sum({<[Amount(UN)]={'Approved'}>}AMOUNT)


This is untested and might contain a few syntax errors. The inclusion of AGGR should should your problem.


Regards,

Pravesh

View solution in original post

2 Replies
tresB
Champion III
Champion III

Could you explain a bit more about your requirement with a sample data in a qvw?

Not applicable

Try something like:

Aggr(Rank(SUM({<[Amount(UN)]={'Approved'},[EMPLOYEE NAME]={"=Rank(Sum({<[Amount(UN)]={'Approved'}>}AMOUNT)


This is untested and might contain a few syntax errors. The inclusion of AGGR should should your problem.


Regards,

Pravesh