Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hi i have below scenario and i want show top 10 spends in bar chart

Customer NameSpend DateSpend Amount
Customer A01/06/201611000
Customer B02/06/20162000
Customer C03/06/201613000
Customer D04/06/20164000
Customer E05/06/20165000
Customer F06/06/20166000
Customer G07/06/20167000
Customer H08/06/20168000
Customer I09/06/20169000
Customer J10/06/201610000
Customer A11/06/201611400
Customer B12/06/201612000
Customer C13/06/201613000
Customer A14/06/2016

14400

I have used below  dimension and expression

[Customer Name]

max(aggr(sum([Spend Amount]),[Spend Date])), But, if a customer repeated in top 10, it is skipping the same and displaying the next non repeated entry.

Please help me to get top 10 spend entries, even if a customer repeated in top 10.

3 Replies
Anil_Babu_Samineni

Naveen,

Try this..

Method #1

Use Flag from inline and then take the dimension - [Customer Name]

Expression  =Sum({<Flag={1}>}[Spend Amount])


Updated:

Method #2

//=if(aggr(rank(sum([Spend Amount])),[Spend Date])<=10,[Spend Date])

Method #3

=avg(aggr(

  if(

  rank(sum([Spend Amount])) <= 10,

  sum([Spend Amount])

  ),[Spend Date])

)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
beck_bakytbek
Master
Master

Hello Naveen,

try this:

if(aggr(rank(Sum(SpentAmount)), CustomerName) <=10, CustomerName, 'Other')

i hope that helps

beck

narayanamsn
Creator
Creator

Hi Naveen,

I am suspecting that the Spend Date format should changed from Indian system to US (MM-DD-YYYY)

Then try again..

Regards,

Satya