9 Replies Latest reply on Aug 30, 2018 7:07 AM by Hanane Ouhammouch

# Top N in a ligne graph

Hi

is there any way to show only the top N in a graph like this

where Top N should based on the (sum(order)) for example

I test index() but it is not working

• ###### 1. Re: Top N in a ligne graph

Hi Hananane,

What is the dimension you are using on X-axis?

Is it based on x-axis you need top 10?

Create a calculated field called Rank(SUM(Measure field))

Click on Rank Field --> Compute using X-axis and you will get 1,2,3,... based on the measure value

Use that rank field in filter and select 1-10 Values

Hope this helps

If it didn't help kindly attach the sample workbook.

BR,

NB

• ###### 2. Re: Top N in a ligne graph

i have a graphe like this

and i want to order the client (what i hid) based on the sum of order (the total during the period)

• ###### 3. Re: Top N in a ligne graph

when i test your proposition the rank is displayed by month ,

But what i want is to order the client

thanks

• ###### 4. Re: Top N in a ligne graph

Hi Hanane,

{Fixed Client field (which is hidden):SUM(measure - which is showing in line graph)}

the above calculation will give

Client wise overall sales

On top of that create a rank

RANK(SUM(Fixed calcualtion)) and sort it based on rank

It will do

If there any filters add them to context because fixed will apply after context filter and before dimension filter.

Check the tableau order of operations concept

BR,

NB

1 of 1 people found this helpful
• ###### 5. Re: Top N in a ligne graph

Hi Naveen ,

what i did:

->create a calculated field  : {FIXED [Client]: COUNTD([Commande])} (A)

->create the rank field : rank (sum(A))

->change my filter to context (all my filter)

->Place the calculated field (discret) in  the graph before and after the dimension (client)

But with no result

is there anything else i need to do

thanks

• ###### 6. Re: Top N in a ligne graph

Is is possible to attach the workbook with sample data hanane?

BR,

NB

• ###### 7. Re: Top N in a ligne graph

I dont have a sample data right now

But thank you for your help

• ###### 8. Re: Top N in a ligne graph

Hi

Here I have attached screenshot and twbx file too.

• ###### 9. Re: Top N in a ligne graph

when i disabled the top N

i have this Order

But when i add the top the order change

Like you see the order is no correct

I first orderd the colonne :