Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
KKTOES
Contributor II
Contributor II

Extract word from a list in a field

Hi everyone, I'm new to Qliksense

I try to extract some specific word in a list, but I don't get the good result, maybe you will have response

field name : S

Id1              [A,B]

id2               [B,C]

id3               [C,A,D]

id4              [D]

 

I would like to have that result :

       S

id1 A

Id1 B

id2 B

Id2 C

 

etc.....

 

I tried to use subfield and Wilmatch  like this : 

 


If( WildMatch(S,'A'),subfield(S, ',' ,1),

   If( WildMatch(S,'B'),subfield(S, ',' ,1),

      If( WildMatch(S,'C'),subfield(S, ',' ,1)  as NewField

 

Have you an idea ?

Thank you

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

Try it with:

subfield(purgechar(S, '[]'), ',') as NewField

Without specifying a third parameter in subfield() Qlik will loop through the list and create a new record for each item.

- Marcus

View solution in original post

3 Replies
marcus_sommer

Try it with:

subfield(purgechar(S, '[]'), ',') as NewField

Without specifying a third parameter in subfield() Qlik will loop through the list and create a new record for each item.

- Marcus

KKTOES
Contributor II
Contributor II
Author

Thank you really much, it works
KKTOES
Contributor II
Contributor II
Author

thanks you really much, easier than I expected and it works