- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Display top 3 customers
hi,
I want to get top 3 customers based on total balance(deposit column - withdrawl column) I have used Rank function where em getting all ranks based on total balance. Where highest balance takes highest rank number.
Ex: 10 refers to highest total balance.
I have used below code in expression
Rank((Deposit_Amt - Withdrawl_Amt),4,0)
How can I refine it to get top 3 based on highest bal?
Regards,
Prajna
- Tags:
- new_to_qlikview
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If(AGGR(Rank((Deposit_Amt-Withdrawl_Amt)),Customer)<=3,Customer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rank(Expression)<=3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I had tried that but it doesn't work.. can u tell me what expression refers to
I Tried
Rank ((Deposit_Amt - Withdrawl_Amt),4,0)<=3
as well as
Rank((Deposit_Amt - Withdrawl_Amt)) <=3
earlier..
Regards,
Prajna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If(AGGR(Rank((Deposit_Amt-Withdrawl_Amt)),Customer)<=3,Customer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Try This,
=aggr(if(rank(sum(Deposit_Amt-Withdrawl_Amt))<=3,Customer),Customer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This works fine.. but how can I get rank in display in my chart like 1,2,3 for top 3? where 1 is the highest?
Regards,
Prajna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This gives wrong result
As suggested this works fine
Rank (AGGR(Rank((Deposit_Amt-Withdrawl_Amt)),Cust_Id)<=3,Cust_Id)
but it doesn't display rank value
Regards,
Prajna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just sort it
Suppose your expression name is Top3Customers so go to sort and under Numeric show ascending or descending
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The customer specified in the code
If(AGGR(Rank((Deposit_Amt-Withdrawl_Amt)),Customer)<=3,Customer)
cant it be customer name any constraint like return type should be int as we have agg ?And one more thing cant I get a display like Rank 1, Rank 2, Rank 3.
Regards,
Prajna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using 'Rank'&Autonumber(Customers) as Rank
- « Previous Replies
-
- 1
- 2
- Next Replies »