Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
201 views
in Technique[技术] by (71.8m points)

How to group rows in Tableau into bands?

I'm fairly new to tableau and I'm having the following issue. Below is a sample of the data I'm using.

Count | Item
___________________
 1            A
 3            B
 2            C
 3            D
 5            E
 2            F
 5            G
 9            H

I'm trying to group some of these together so I can show a stacked bar chart of these groups like the following:

 Count | Item
    ___________________
     6            A-C
     10            D-F
     14            G-H

How to do this?

question from:https://stackoverflow.com/questions/66055712/how-to-group-rows-in-tableau-into-bands

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use Tableau's built-in Create Group feature

View and download the solution workbook on Tableau Public: https://public.tableau.com/profile/fosstin#!/vizhome/HowtoGroupYourDatainTableau/Dashboard-HowtoGroupYourData

  1. Right-click the Item dimension and choose Create > Group. This will open the Create Group dialog window.
  2. At the top of the window, in the Field Name text field, enter a name for your grouped dimension or use the default title provided by Tableau, which is Item (group)
  3. Select the first set of letters you wish to group, then click the Group button. Multiselect rows by holding down the control key or the shift key.
  4. Type in a name for the group(i.e. A-C) and press enter.
  5. Repeat steps 5 and 6 to create the D-F and G-H groups, then click OK.
  6. Drag the Item (group) dimension to the Rows shelf and the Count measure to Text in the Marks card.
  7. Add a column header to the Count column by double-clicking Measure Values in the data pane.
  8. Right-click the Measure Values pill now on the Marks card and choose Format. Then, in the formatting pane, choose Numbers > Number (Standard)

References:
Tableau Help: Group Your Data
https://help.tableau.com/current/pro/desktop/en-us/sortgroup_groups_creating.htm#create-a-group-from-a-field-in-the-data-pane

Tableau.com Blog: The one-click trick for create headers for single-measure tables
https://www.tableau.com/about/blog/2015/11/how-create-fast-headers-single-measure-tables-45945


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...