How to aggregate multiple column in Tableau?

0 votes

What I have?

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

I would like to aggregate the aff columns to calculate the sum of "value" for each aff. For example, the above gives:

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

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

Jul 9, 2018 in Tableau by Atul
• 10,240 points
200 views

1 answer to this question.

0 votes

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

  1. CTRL Select all 3 dimensions you want to merge and click on the 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 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 Jul 9, 2018 by Atul
• 5,530 points

Related Questions In Tableau

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
2,028 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
1,628 views
0 votes
1 answer

How to select column which are needed to create report in tableau

Please follow this process: Make database connection Join tables Go ...READ MORE

answered Sep 26, 2018 in Tableau by AwesomeSauce
• 860 points
40 views
0 votes
1 answer

How to group bins in a tableau histogram?

One of the simple way is by ...READ MORE

answered Apr 3, 2018 in Tableau by xyz
• 1,550 points
1,143 views
0 votes
1 answer

How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

answered Apr 5, 2018 in Tableau by Atul
• 10,240 points
1,729 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
309 views
0 votes
1 answer

Displaying Aggregations across bar chart in Tableau

Hi Sindhu, 1.You can use average lines to ...READ MORE

answered Mar 8 in Tableau by Cherukuri
• 27,960 points
57 views
0 votes
1 answer

How to aggregate and count the occurrence of TRUE and FALSE?

Hi, you can do any of below ...READ MORE

answered Mar 12 in Tableau by Cherukuri
• 27,960 points
90 views
0 votes
1 answer

How to get Tableau results in python?

Well even I was looking for the ...READ MORE

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

How to calculate profit when cost and revenue are in same column?

You can create the following calculated fields: Profit: SUM(IIF([account_category] ...READ MORE

answered Apr 10, 2018 in Tableau by Atul
• 5,530 points
81 views