Rhonda
Rhonda

Reputation: 1721

Tableau doesn't order by location

Tableau workbook uploaded here (refer to tab Products)

When I plot products vs number of records, it is correct.

But when I plot products vs number of records in a location, and sort descending by Number of Records it is incorrect.

It's as if the location is being ignored.

How to troubleshoot?

enter image description here

Upvotes: 0

Views: 61

Answers (2)

Karthik Venkatraman
Karthik Venkatraman

Reputation: 1657

You can achieve this by creating a RANK Function.

Create a rank function with your measure value something like RANK(SUM(OrderNumbers)).

Then place the created function in between the location and product.

Select the Edit Table Calculation of the Rank Measure and select advanced from the Compute Using dropdown. Select Location as the top value and product to the addressing box and click ok.

Then click on the dropdown from restarting every and select Location and click on Ok.

Now your bar will be sorted according to the one what you want.

enter image description here

Upvotes: 1

Bernardo
Bernardo

Reputation: 3318

Create a new calculated field with the following

[Location]+[Product]

Place this field in between Location and Product on the Rows shelf. Sort on this field by Descending on Sum Number of Records.

Finally, deselect "Show Header" on that field's pill in the row shelf.

Upvotes: 1

Related Questions