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: 
vvvvvvizard
Partner - Specialist
Partner - Specialist

Rank function help

Currently my dimension is Debiteur and my expression is   =if(rank(Sum([VERKOPE BTW UITG]))<10,sum({<[FIN JAAR]={2018} ,DEBITEURNO-={777777}>} [VERKOPE BTW UITG]))

The above expression works fine .

Know i want to remove the dimension  DEBITEUR (this leaves no dimensions) and my expected output should be the sum of the top 10 values shown below

Please assist

DEBITEUR=if(rank(Sum([VERKOPE BTW UITG]))<10,sum({<[FIN JAAR]={2018} ,DEBITEURNO-={777777}>} [VERKOPE BTW UITG]))
-
VOORRAADOORPLASINGSKONTROLE (BK)31145318.74
VOORRAADOORPLASINGSKONTROLE (BT)28588550.14
VOORRAADOORPLASINGSKONTROLE (DP)59725347.45
VOORRAADOORPLASINGSKONTROLE (FY)45395466.76
VOORRAADOORPLASINGSKONTROLE (OL)41292023.36
VOORRAADOORPLASINGSKONTROLE (OR)40014475.08
VOORRAADOORPLASINGSKONTROLE (OT)32141113.1
VOORRAADREGSTELLINGS (OT)24078.51
Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Should be just this

Sum(Aggr(

If(Rank(Sum([VERKOPE BTW UITG]))<10,sum({<[FIN JAAR]={2018} ,DEBITEURNO-={777777}>} [VERKOPE BTW UITG])), DEBITEUR))

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

Should be just this

Sum(Aggr(

If(Rank(Sum([VERKOPE BTW UITG]))<10,sum({<[FIN JAAR]={2018} ,DEBITEURNO-={777777}>} [VERKOPE BTW UITG])), DEBITEUR))

vikraant
Creator
Creator

Alternatively we can put the condition in the set expression .

sum({<DEBITEUR = {"=rank(Sum([VERKOPE BTW UITG]), 4)<10"},[FIN JAAR]={2018} ,DEBITEURNO-={777777}>} [VERKOPE BTW UITG])

Best Regards,

Vikraant