Forum Discussion
How to create word cloud from a column that has multiple values in a single row?
- 6 years ago
I threw together a PBIX. Attached.
You could split the values out in Query Editor and then create a new table like:
Table =
VAR __Column1 = SELECTCOLUMNS('Table',"Words",[Column 1])
VAR __Column2 = SELECTCOLUMNS('Table',"Words",[Column 2])
VAR __Column3 = SELECTCOLUMNS('Table',"Words",[Column 3])
VAR __Column4 = SELECTCOLUMNS('Table',"Words",[Column 4])
VAR __Column5 = SELECTCOLUMNS('Table',"Words",[Column 5])
VAR __Column6 = SELECTCOLUMNS('Table',"Words",[Column 6])
VAR __Column7 = SELECTCOLUMNS('Table',"Words",[Column 7])
RETURN
UNION(__Column1, __Column2, __Column3, __Column4, __Column5, __Column6, __Column7)
Feed [Words] column in this table into your word cloud.
Hi Greg_Deckler ,
Thanks for responding so quickly.
So here's what I understand -
a. VAR __Column1 to VAR __Column7 are the columns generated using the delimiter?
b. To create an attribute called Table, I need to "Add New Column " by right clicking on the dataset on the Visualization page
c. Which is [Column 1] in your query? When are these generated?
Can you maybe use some dummy names for the tables and columns?
Thanks.
- Greg_Deckler6 years ago
Community Champion
No, you would use New Table to create a new table in your data model. [Column 1], [Column 2] ... are the columns created when you split out your original column. I am creating variables (__Column1, __Column2...) to hold their contents and then using UNION to append them all together.
- saipawar6 years ago
Helper IV
Okay.. I think I am getting it. Just a little more help in the beginning of the query.
Looks like I am messing up the syntax when creating a new table
Can you please check the syntax for the first two lines? I tried the open and closed braces.
Thanks for being patient with me.
Cheers.
- Greg_Deckler6 years ago
Community Champion
Sure,
Table =
VAR col1 = ...
col1 will be the name of your variable.