Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
prat1507
Specialist
Specialist

Linking fields using wildcards

Hi Team

I have two tables with columns Col1 and Col2 respectively. The columns contain value as follows:

Col1:

*apple*

*cat*

Col2

apple1

apple2

apple3

I want to link the two tables on the fields above, is it possible? Please play around in the load script in order to achieve this. Any help would be appreciated.

Regards
Pratyush

 

Labels (2)
1 Solution

Accepted Solutions
vitaliichupryna
Creator III
Creator III

Hi Pratyush!

I think you should make mapping with wildcard this solution was developed by Rob Wunderlich , you can find it here: 

http://qlikviewcookbook.com/recipes/download-info/mapping-with-wildcards/

You just need put you data in the wildmap table

LOAD * INLINE [
Key, Label
*apple*, 1
*cat*, 2
*dog*, 3
]

And then add Key to both tables as in example below

Table1:
LOAD *, $(vMapExpr(Col1)) as Key
;
LOAD *  INLINE [
Col1, Category
*apple*, fruits
*cat*, animals
]
;
Table2:
LOAD *, $(vMapExpr(Col2)) as Key
;
LOAD *  INLINE [
Customer, Col2
A, apple1
B, apple2
C, apple3
A, cat1
D, dog1
]

  

Thanks,

Vitalii

View solution in original post

3 Replies
tresesco
MVP
MVP

Have you tried MapSubString()?
vitaliichupryna
Creator III
Creator III

Hi Pratyush!

I think you should make mapping with wildcard this solution was developed by Rob Wunderlich , you can find it here: 

http://qlikviewcookbook.com/recipes/download-info/mapping-with-wildcards/

You just need put you data in the wildmap table

LOAD * INLINE [
Key, Label
*apple*, 1
*cat*, 2
*dog*, 3
]

And then add Key to both tables as in example below

Table1:
LOAD *, $(vMapExpr(Col1)) as Key
;
LOAD *  INLINE [
Col1, Category
*apple*, fruits
*cat*, animals
]
;
Table2:
LOAD *, $(vMapExpr(Col2)) as Key
;
LOAD *  INLINE [
Customer, Col2
A, apple1
B, apple2
C, apple3
A, cat1
D, dog1
]

  

Thanks,

Vitalii

prat1507
Specialist
Specialist
Author

Fantastic!! That worked, thanks a lot...... You truly saved my day!

Regards
Pratyush