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 10, 2018 in Tableau by Atul
• 10,240 points
2,721 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 10, 2018 by ffdfd
• 5,550 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
9,900 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
15,341 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 27, 2018 in Tableau by AwesomeSauce
• 860 points
745 views
0 votes
1 answer

How to fix spelling error in a field or column value using Tableau?

You should be able to use a ...READ MORE

answered Mar 10, 2022 in Tableau by Neha
• 9,020 points
771 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 6, 2018 in Tableau by Atul
• 10,240 points
5,650 views
0 votes
1 answer

Aggregating from multiple columns in Tableau

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

answered Aug 18, 2018 in Tableau by ffdfd
• 5,550 points
5,945 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, 2019 in Tableau by Cherukuri
• 33,030 points
2,138 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, 2019 in Tableau by Cherukuri
• 33,030 points
2,938 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 ffdfd
• 5,550 points
902 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 ffdfd
• 5,550 points
1,189 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP