简体   繁体   中英

Create and display table column hierarchy in Tableau

My table currently has a number of similar numerical columns I'd like to nest under a common label.

My current table is something like:

| Week | Seller count, total | Seller count, churned | Seller count, resurrected |
| ---- | ------------------- | --------------------- | ------------------------- |
|   1  |         100         |           10          |              4            |
|   2  |         105         |           12          |              5            |

And I'd like it to be:

|      |       Seller count            |
| Week | Total | Churned | Resurrected |
| ---- | ----- | ------- | ----------- |
|   1  |  100  |   10    |      4      |
|   2  |  105  |   12    |      5      |

I've seen examples of this, including a related instructional video , but this video hides the actual creation of the nested object (called "Segment").

I also tried creating a hierarchy by dragging items in the "Data" tab on top of one another. This function appears to only be possible for dimensions (categorical data), not measures (numerical data) like mine.

Even so, I can drag my column names from the measures side onto the dimensions side to get them to be considered dimensions. Then I can drag to nest and create the hierarchy. But then when I drag the top item of the hierarchy ("Seller count" in the example below) into the "Columns" field, I get the warning "the field being added contains 92,000 members, and maximum recommended is 1,000". It thinks this is categorical data, and is maybe planning to create a subheading for each value (100, 105, etc.), instead of the desired hierarchy sub-items as subheadings.

Any idea how to accomplish this simple hierarchical restructuring of my column labels?

Actually, this is some data restructuring and Tableau isn't best suited for it. Still, it is simple one and you can do it like this-

  • I recreated one table like yours in excel, and imported it in Tableau

在此处输入图像描述

在此处输入图像描述

  • Rename the three cols, (removed seller count from their names)

在此处输入图像描述

  • selected these three columns at once, and select pivot to transform these like

在此处输入图像描述

  • Rename these columns again

在此处输入图像描述

  • create a text table in tableau, as you have shown in question

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM