Reputation: 75
|NAME|ITEM |VALUE|
|john| pen | 4 |
|john| book | 7 |
|john| cup | 3 |
|Eric| pen | 9 |
|Eric| book | 8 |
|Eric| cup | 1 |
I want to create a field or column called "office" which equals the sum of the values of pen & book , that is, office = "pen + book"
Upvotes: 1
Views: 391
Reputation: 26238
I created sample data like you have given. Now proceed this way
create a calculated field office
with the following calculation
SUM(
IF [item] = "pen" OR [item] = "book" then [value] ELSE 0 END
)
Add this field to viz and your desired output is ready
Upvotes: 2
Reputation: 3167
What you're looking for should be the Group functionality:
https://help.tableau.com/current/pro/desktop/en-us/sortgroup_groups_creating.htm
Upvotes: 0