Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count on specific Field Content

Is there a way to extract a specific text portion of a field and conduct a count on that specific item? What would the syntax be and where would it appear (load script or sheet object)?

Also when extracting that specific text can I import it into a separate field?

Field Content Example: Apple Tree , Orange Tree, Lilac Tree

I would want to extract the word 'Tree' into a separate field and also count the different varieties of apple, orange, and lilac

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

LOAD

     MyField,

     if(substringcount(MyField, 'Tree'),'Tree') as FieldThatContainsTheValueTree,

     if(substringcount(MyField, 'Tree'), trim(replace(MyField, 'Tree','')))  As TreeVariety

FROM ...


In the front end you can create a chart object with TreeVariety as dimension and count(TreeVariety) as expression.


talk is cheap, supply exceeds demand