Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

How to add values within a particular column in tableau

|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"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I created sample data like you have given. Now proceed this way

enter image description here

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

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...