Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)
recategorized by

I am preparing a data visualization in Tableau. I have some data that can be simplified like this:

Name, Score, Tag

Joe, 5, A;B

Phil, 7, D

Quinn, 9, A;C

Bill, 3, A;B;C

I would like to generate a word cloud on the Tag field that counts occurrences of each item A,B,C. So I need to generate this: 

A,3

B,2

C,2

D,1

In other words, I need help working with a field that contains a list of delimited values. In the example data; is the delimiter, but it could be anything. I would like the word cloud to update as the user applies filters, e.g. dragging a slider to set score > 5. So the tag count has to be done on the fly.

I'm pretty sure I'll need to use field calculations and table calculations..? Possibly I'll need to have a separate table tracking the tags..?

I have no problem building the word cloud and other viz elements. What I'm looking for help with is parsing the delimited list field and calculating the tag counts.

I do have full control over the source data, so if there is an easier way to do this by reorganizing the schema, I'd be glad to do that. I thought of breaking the field up into separate tag1, tag2, tagXfields and trying to count over the separate fields... but not sure if this is any simpler.

Thanks for any tips.

1 Answer

0 votes
by (47.2k points)
  • In this case, a better approach is to reshape the data before feeding it to Tableau. Tableau works best with normalized data.

  • Preprocess it to look like:

Name, Score, Tag

Joe, 5, A

Joe, 5, B

Phil, 7, D

Quinn, 9, A

Quinn, 9, C

Bill, 3, A

Bill, 3, B

Bill, 3, C

  • Now, the standard Tableau word cloud charts should work well, and it will scale easily as you add more tags and data.

  • Standard step is to reshape data to normalize it prior to analysis with Tableau. Sometimes you can do it automatically, say with custom SQL, but often you'll have to use some sort of script first. If your data comes from Excel, Tableau has a plug in that can help with reshaping data. Look for it on the Tableau knowledge base.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...