Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ARicha05
Contributor
Contributor

Create a Table of Unique Strings in a Column

My data structure is like so:

Fruit_Basket_Column

Apple, Orange, Banana

Kiwi

Orange, Apple

Banana, Kiwi

Apple

 

Now, I would like to create a new table that, given the Fruit_Basket_Column as an input, only displays unique strings (fruit, separated by commas above, though some baskets contain multiple fruit). My desired output is like so:

 

Desired_Table

Apple

Orange

Banana

Kiwi

 

With this table created, the app user could select one or multiple of these fruits, and the resulting plots, etc. would build by only retaining observations which contain at least one of the selected fruit/s in the Fruit_Basket_Column (irrespective of whether these baskets contain other fruits). Ideally I'd like to accomplish this in the table 'dimension' function, perhaps a combinations of 'Contains' and some string function?? Help! Thanks.

 

 

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Take a look at my example below. 

Baskets:

Load * inline [

Owner, Fruit_Basket_Column

Vegar, "Apple, Orange, Banana"

Rob, Kiwi

Hannah, "Orange, Apple"

Arvind, "Banana, Kiwi"

Siw, Apple];

 

Desired_Table:

Load 

Fruit_Basket_Column,

Subfield(Fruit_Basket_Column,  ',') as Fruit

Resident Baskets;

View solution in original post

1 Reply
Vegar
MVP
MVP

Take a look at my example below. 

Baskets:

Load * inline [

Owner, Fruit_Basket_Column

Vegar, "Apple, Orange, Banana"

Rob, Kiwi

Hannah, "Orange, Apple"

Arvind, "Banana, Kiwi"

Siw, Apple];

 

Desired_Table:

Load 

Fruit_Basket_Column,

Subfield(Fruit_Basket_Column,  ',') as Fruit

Resident Baskets;