Explore Courses Blog Tutorials Interview Questions
0 votes
in BI by (17.6k points)

Sample Table:

id     aff1    aff2    aff3    value
1       a        x      b        5
2       b        c      x        4
3       a        b      g        1

What I want?

Aggregate the aff columns to calculate the sum of "value" for each aff.

For example:

aff    sum
a       6
b       10
c       4
g       1
x       9

 Is it possible to do it in tableau without remaking the table by unfolding it along all the aff columns?

1 Answer

0 votes
by (47.2k points)
edited by

You can use Tableau’s inbuilt pivot method as below, without reshaping in source .

  1. CTRL Select all 3 dimensions you want to merge , and click on pivot .

enter image description here

  1. You will get your new reshaped data as below, delete other columns :

enter image description here

  1. Finally build your view.

enter image description here

I hope this answers .Rest other options for the above results include JOIN at DB level, or creating multiple calculated fields for each attribute value which are not scalable.

Get certified in this field to make your career. Enroll in Tableau Certification now.

Related questions

Browse Categories