Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Interesting !!! Checking ...
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
];
Where did you use "Wildmatch" function?
Title looks Wildmatch but not sure why it's needed
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.
Why do you want function Wildmatch??
I prefer function ApplyMap rather join
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
];
This one makes clear? I believe All users should be present rather A & XX.