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: 
Peony
Creator III
Creator III

wildmatch and leftjoin

Hi All

I have dimention and fact tables like this

Dim.Acc  
   
AccRound1Round2
a11
b12
c22
d13
   
   
Fact.Acc_Live  
   
NameAccLiveVolume
we1a3456
erc446
dfra4567
dvtw3e7

 

Now, in the script, I have a leftjoin like this

Fact.Acc_Live:
Load
  Name,
  AccLive,
  Volume
from Fact.Acc_Live 

Left Join (Fact.Acc_Live)
Load
  Acc as AccLive,
  Round1,
  Round2
from Dim.Acc

The thig is, now I need to leave in the Fact.Acc_Live table only that rows where AccLive = Acc. And i need to do it using WildMatch function. 

Please, anyone have the idea how to do it?


 

 

Labels (1)
1 Solution

Accepted Solutions
Peony
Creator III
Creator III
Author

Not really the same
AccLive field is contains "e" value that not exist in the Acc fileld. So, after applying wildmatch Fact table would not contain the row where  AccLive field  = 'e'

View solution in original post

8 Replies
asinha1991
Creator III
Creator III

you can do something like this for wildmatch

 

Patterntomatch:
Load Concat(chr(39)&'*'&pattern&'*'&chr(39),',') as conacc;
Load *inline [pattern
WORLD
DEER


];

let concatstring=peek('conacc',0,'Patterntomatch');


load * where WildMatch(CHECK,$(concatstring));
FinalTable:
Load *inline [CHECK
WORLDISABADPLACE
THISWORLDISBAD
DEEREATSGRASS
WHATTHEHECK

];

 

 

 

Peony
Creator III
Creator III
Author

Hi
Thank you for your help. Unfortunately I can't undertand how to use your example with the tables and  fieldsname I have.

asinha1991
Creator III
Creator III

I will translate, but can you tell me why do you want to use wildmatch?

I see values in the fields are same

asinha1991
Creator III
Creator III

based on my understanding of question I was suggesting to do this

 

Patterntomatch:
Load Concat(chr(39)&'*'&Acc&'*'&chr(39),',') as conacc;

Load
  Acc ,
  Round1,
  Round2
from Dim.Acc

let concatstring=peek('conacc',0,'Patterntomatch');

Fact.Acc_Live:
load * where WildMatch(AccLive,$(concatstring));

Load
  Name,
  AccLive,
  Volume
from Fact.Acc_Live ;

 






Peony
Creator III
Creator III
Author

Not really the same
AccLive field is contains "e" value that not exist in the Acc fileld. So, after applying wildmatch Fact table would not contain the row where  AccLive field  = 'e'

Peony
Creator III
Creator III
Author

Thank you!

asinha1991
Creator III
Creator III

in that case changing left to right join should be enough no?,

wildmatch is used to check wildcard

Peony
Creator III
Creator III
Author

Indeed. 

Guess I am overthinking this task))