Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
If(AGGR(Rank((Deposit_Amt-Withdrawl_Amt)),Customer)<=3,Customer)
Rank(Expression)<=3
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
If(AGGR(Rank((Deposit_Amt-Withdrawl_Amt)),Customer)<=3,Customer)
Hi Try This,
=aggr(if(rank(sum(Deposit_Amt-Withdrawl_Amt))<=3,Customer),Customer)
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
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
Just sort it
Suppose your expression name is Top3Customers so go to sort and under Numeric show ascending or descending
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
Try using 'Rank'&Autonumber(Customers) as Rank