4 Replies Latest reply on Oct 24, 2018 10:55 AM by Diego Parker

# Ranking Calculated Field with Measure

Hi! I'm fairly new to Tableau and I have been struggling for a while with a calculation.

For company reasons, I can't upload the workbook so I will do my best to explain my issue.

I have one dimension field called Borough which is made of a list of all London Boroughs. I would like to create a calculated field that always gives me the name of the Borough that has more events (Number of Records). I am using this field to create a dynamic text that says something like:

"The XX (this is where the calculation should go) borough had the most incidents during XX (here I'm using a date parameter)"

To sum up, what I'm looking is that every time I change my date parameter I want it to display the borough that had more incidents. The date parameter is already done I just need the calculation for the TOP borough. I tried to use Max but it only gives me a result according to their alphabet order

Thanks!

• ###### 1. Re: Ranking Calculated Field with Measure

Hey Parker,

You mean like this ..?

Here sample work book if you want.

1 of 1 people found this helpful
• ###### 2. Re: Ranking Calculated Field with Measure

Hi Diego,

I know you said can't upload the workbook, but is this because of confidential data? If you could upload a workbook using sample data that would be best. I could then review what you had done with existing calculations and parameters.

Without seeing this, I would recommend this kind of method:

Using a new worksheet, I am trying to find the top category  (based on sales) for each date I select in my date filter. I bring category into text on the marks card and then I bring in sum(sales) into detail. I right click on sum(sales) and add in a rank table calculation based on specific dimensions - category:

Convert this table calculation to discrete and bring it to the filters shelf and select 1:

Give that a go and see if that works for you. Otherwise please attach a workbook using sample data so that we can see what you've done with the existing setup.

Thanks,

Mavis

1 of 1 people found this helpful
• ###### 3. Re: Ranking Calculated Field with Measure

Thank you Mavis! This led me to the solution

1 of 1 people found this helpful
• ###### 4. Re: Ranking Calculated Field with Measure

Not exactly what I was looking for but someone may find it useful. Thanks!