Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Trying to create a word cloud using d3-wordcloud extension.It requires a dimension and a measure which works if there is one word in text field.
I have a comment field in a table, that means text from this field needs to be broken down to words before counting words. Is that possible to do on the go? Let's say break the text field on spaces to keep it simple.
for example:
ID Comment
1 book, pen, fail
2 pen, bird
3 book, bird, food, car
...
Thanks.
Does not seem possible on the fly. The only solution that works is breaking down the sentences to words in load time and then use this second table to count occurrences, something like this.
MyTextData:
LOAD
ID,
PurgeChar(Comment, ',()#"-1234567890') as TextLine
FROM [....]
(qvd)
;
MyWordList:
LOAD ID, lower(SubField(TextLine,' ')) as Word
Resident MyTextData;
...
then in charts use count() of words.
Regards.
hi
you can do this in the script or the front end using subfield function
in your example
put in the dimension the subfield(Comment,',')
or with space subfield(Comment,' ')
Yes.
You should have one common field linking to your word table, may be ID field from your Text table to link fact?.
In front end just use Word as your dimension and count of ids. The most commonly used word will get highlighted and have bigger fonts and vice versa.
Does not seem possible on the fly. The only solution that works is breaking down the sentences to words in load time and then use this second table to count occurrences, something like this.
MyTextData:
LOAD
ID,
PurgeChar(Comment, ',()#"-1234567890') as TextLine
FROM [....]
(qvd)
;
MyWordList:
LOAD ID, lower(SubField(TextLine,' ')) as Word
Resident MyTextData;
...
then in charts use count() of words.
Regards.