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

Wildmatch in joining keys

Hi All,

Please let me know how to use wildmatch in joining keys

example

Table1:

Region, User

|Corporate Sector|, A

|Sector 1|, B

|Sector 2|, C

FactTable:

Region,                                                         Country

Corporate Sector Asia Pac Value Y,                 India

Sector A Europe N,                                         US


If i use wildmatch in Joining keys when user A is selected fact table country India should be selected . i have to do this in script part


Thanks in advance


8 Replies
Anil_Babu_Samineni

Interesting !!! Checking ...

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

Can you try this?

FactTable:

Mapping Load * Inline [

Region,                             Country

Corporate Sector Asia Pac Value Y,  India

Sector A Europe N,                  US

];

Table1:

LOAD User, If(SubStringCount(ApplyMap('FactTable', Region), Region), ApplyMap('FactTable', Region)) as Region,

If(Region = ApplyMap('FactTable', Region), 'Yes', 'No') as OWM_Flag;

LOAD PurgeChar(Region, '|') as Region, User Inline [

Region, User

|Corporate Sector|, A

|Sector 1|, B

|Sector 2|, C

];

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pipuindia99
Creator III
Creator III

Where did you use "Wildmatch" function?

Anil_Babu_Samineni

Title looks Wildmatch but not sure why it's needed

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pradosh_thakur
Master II
Master II

If you need wildmatch anyhow then try this

Table:
Load * Inline [

Region,                             Country

Corporate Sector Asia Pac Value Y,  India

Sector A Europe N,                  US

];

join(Table)

LOAD  PurgeChar(Region, '|') as Region1, User  Inline [

Region, User

|Corporate Sector|, A

|Sector 1|, B

|Sector 2|, C

];

Table1:

noconcatenate LOAD *

Resident Table

where WildMatch(Region, '*' & Region1 & '*')

;

DROP Table Table ;

PS:I will prefer the applymap any day rather than join and wildmatch.

Learning never stops.
Anonymous
Not applicable
Author

Why do you want function Wildmatch??

I prefer function ApplyMap rather join

tresesco
MVP
MVP

Using MapSubString() it would be little easier. Try like:

Map:

Mapping Load

       Purgechar(Region, '|') as Region,

      '#'&User&'@' as User

Inline [

Region, User

|Corporate Sector|, A

|Sector 1|, B

|Sector 2|, C

AAAA, XX

];

Table1:

LOAD

       *,

      TextBetween(MapSubString('Map', Region),'#','@') as User;

LOAD * Inline [

Region,                             Country

Corporate Sector Asia Pac Value Y,  India

Sector A Europe N,                  US

AAAABBB,                              Canada

];

Capture.JPG

Anil_Babu_Samineni

This one makes clear? I believe All users should be present rather A & XX.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful