简体   繁体   中英

Tableau How to evenly split a Ranking Table into two

I am trying to evenly split a ranking table into two.

I tried to create a calculated field using rank to divide the data into two groups. 在此处输入图像描述 在此处输入图像描述

The problem with this approach is that there are too many entries in the first column because they are tie with rank 1.

在此处输入图像描述

I don't want to break the tie but display evenly in both columns.

So, desired output will look like...

25 states with Rank 1 are displayed in column 1, and the rest 12 rank 1 states and the other states from rank 38 to 49 are displayed in column 2.

In order to split your rows within a specif number (say 25) you can't rely just on rank due to same values for multiple rows.

Even though your Rank calculated field must be shown in the chart, you can add another calculated field based on rank_unique which will provide you a progressive number for rows having the same value for the specified metric.

在此处输入图像描述

Just use the specified function:

RANK_UNIQUE(SUM([Value]),'desc')

And then use the calculated field as a filter to "split" the results as you need (in this example 1-4, 5-8).

在此处输入图像描述

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