Aggregating multiple column in Tableau

0 votes

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, the above aggregation should result to:

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

Ideally, I want to do this directly in tableau without remaking the table by unfolding it along all the aff columns.

Jun 29, 2018 in Tableau by ghost
• 1,790 points
23 views

1 answer to this question.

0 votes

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 answer your query . 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.

answered Jun 29, 2018 by Atul
• 5,530 points

Related Questions In Tableau

0 votes
1 answer

Counting number of elements in a comma seperated column in Tableau

If you have access to the database, ...READ MORE

answered Jun 19, 2018 in Tableau by xyz
• 1,550 points
138 views
+1 vote
1 answer

Is it possible to define a color code scheme just for one column in Tableau?

Follow the below steps : Remove your current ...READ MORE

answered Jul 23, 2018 in Tableau by Atul
• 10,240 points
93 views
0 votes
1 answer

How to get multiple Sets of Measure Names with different Filters on a single sheet in Tableau?

The easiest solution to your query is: 1) ...READ MORE

answered Aug 23, 2018 in Tableau by Naruto
• 710 points
978 views
0 votes
1 answer

Filtering in Tableau by combining multiple fields

Try This Create 3 parameter Start Date End Date City Now Create a ...READ MORE

answered Aug 29, 2018 in Tableau by Atul
• 10,240 points
42 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
1,360 views
+1 vote
1 answer
0 votes
1 answer

Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
50 views
+2 votes
1 answer
0 votes
1 answer

How to aggregate multiple column in Tableau?

You can use Tableau’s inbuilt pivot method ...READ MORE

answered Jul 9, 2018 in Tableau by Atul
• 5,530 points
111 views
0 votes
1 answer

Aggregating from multiple columns in Tableau

You can use Tableau’s inbuilt pivot method ...READ MORE

answered Aug 17, 2018 in Tableau by Atul
• 5,530 points
98 views