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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
TimGl
Contributor
Contributor

Wildmatch for multiple entries

Hello Qlik Community,

I have a problem with my Data Model I can't solve by myself.

I have a table like this:

IDComponents
1*A*
2*A*
3*B*
4*B*
5*A*,*B*
6*A*,*B*,*C*
7*A*
8*B*
9*C*

 

and I'm Using 

Pick(wildmatch(components,'*A*','*B*','*C*'),'A','B','C') as Name;

to get

NameID
A1
A2
B3
B4
A5
A6
A7
B8
C9

 

Wildmatch only takes the first entry but I actually need all the entries in components to get a table like this

NameID
A1
A2
B3
B4
A5
B5
A6
B6
C6
A7
B8
C9

 

am I completely wrong here with the use of wildcards? Has anybody suggestions?

1 Solution

Accepted Solutions
Taoufiq_Zarra

@TimGl  Maye be like :

load ID,purgechar(subfield(Components,','),'*') as Components;
LOAD * INLINE [
    ID, Components
    1, *A*
    2, *A*
    3, *B*
    4, *B*
    5, "*A*,*B*"
    6, "*A*,*B*,*C*"
    7, *A*
    8, *B*
    9, *C*
];

 

output:

Taoufiq_Zarra_0-1628766385155.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

1 Reply
Taoufiq_Zarra

@TimGl  Maye be like :

load ID,purgechar(subfield(Components,','),'*') as Components;
LOAD * INLINE [
    ID, Components
    1, *A*
    2, *A*
    3, *B*
    4, *B*
    5, "*A*,*B*"
    6, "*A*,*B*,*C*"
    7, *A*
    8, *B*
    9, *C*
];

 

output:

Taoufiq_Zarra_0-1628766385155.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉