Hi All,
I have a column INDEX in my tableau work work book. Based upon Top in I have to create a calculated field which shows the number of project. so if there are n TOP in Index column then n project are available.
Input
ID | INDEX |
1 | TOP |
2 | 1 |
3 | 2 |
4 | 2 |
5 | 3 |
6 | 3 |
7 | 4 |
8 | 4 |
9 | TOP |
10 | 1 |
11 | 2 |
12 | 2 |
13 | 3 |
14 | 3 |
15 | 4 |
16 |
44 |
Output
ID | FILTER | INDEX |
---|---|---|
1 | PROJ_1 | TOP |
2 | PROJ_1 | 1 |
3 | PROJ_1 | 2 |
4 | PROJ_1 | 2 |
5 | PROJ_1 | 3 |
6 | PROJ_1 | 3 |
7 | PROJ_1 | 4 |
8 | PROJ_1 | 4 |
9 | PROJ_2 | TOP |
10 | PROJ_2 | 1 |
11 | PROJ_2 | 2 |
12 | PROJ_2 | 2 |
13 | PROJ_2 | 3 |
14 | PROJ_2 | 3 |
15 | PROJ_2 | 4 |
16 | PROJ_2 | 4 |
Here you go:
I created a calculated field to assign the filter number as shown above, and then add a simple prefix to display the filter as required.
Hope this helps. The workbook is attached.