11 Replies Latest reply on Sep 7, 2018 8:02 AM by Jim Dehner

# How can I get a product dimension to sort by a product number (dimension) in an area chart

Getting back to Tableau after a long hiatus.

I forgot how to do something simple.  I have a dimension called "products" with 5-year sales projections.   Each product has a simple Product Line # 1-N (i.e., 1, 2, 3, 4, 5...).  It is currently a Dimension defined as a string.  It is not used as a #.

I have an area chart.   Years is on the Column shelf, Sales is on the Rows shelf.   Product is on Detail and Color.

How can I get Product to sort 1-N (1, 2, 3, 4...) by the its Line #?

Thanks

• ###### 1. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Hi Stephen

Not sure I fully understand the issue but "sort" will order strings by  alphanumeric order - if you are using single digit strings that should work -

If not you can use a manual sort - right click the dimension pill and select sort

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Its a pretty simple 1, 2, 3, 4, 5....  So it should sort alphanumerically.   It does if I am building a table and place it on the Column shelf.  But, not when I try to use it to sort products by line # using an area chart.

• ###### 3. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

I don't have a dataset that looks like that - please post your twbx workbook sand I will look at it

Jim

• ###### 4. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Here is a key point.  The dimension Line # is not placed on the Marks chard or Column and Row shelves.  I am trying to sort Product using the field Line #.   Line # is both a Dimension and a string.  Selecting it in Field to sort Product only gives me options to aggregate by count, min and max.

LI # = Product.

LI Title = Product Name

Line # = 1,2,3,4,5....   (this is the field I want to sort LI# by.  LI # would also be the level of detail.

• ###### 5. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

I should add, making Line # Detail and then sorting alphabetically does nothing.  And, I do not want to manually order 1,000 items.

• ###### 6. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Try to place [Product line] onto rows and then un-click the show header option. It should sort in ascending order. It is also tough to provide an answer without a workbook.

• ###### 7. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

But, I want an area chart that depicts all items on a single chart.  Placing anything on the Rows shelf ( regardless of whether or not show header is selected) changes the level of detail to individual area charts for each item.

• ###### 8. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Is there a one-to-one relationship between LI and Line? If there is, drag the Line on to detail and make sure the [Line] is above other two pills in the marks card.

• ###### 9. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Here is a sample.

I can't get the area chart to sort on Line Number.   Ignore data source order.  It's what I want.  But, I want to a way to do it in Tableau in the event it is not.  And, the actual dataset is much larger.

• ###### 10. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

Jim -> Here is a sample.

I can't get the area chart to sort on Line Number.   Ignore data source order.  It's what I want.  But, I want to a way to do it in Tableau in the event it is not.  And, the actual dataset is much larger.

Thanks

• ###### 11. Re: How can I get a product dimension to sort by a product number (dimension) in an area chart

see attached

this is what I meant in my first response to set the order manually

you can then use the icon to go asc or desc

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.