Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to see if there is a way to use another field within a LOAD in a WildMatch function.
I have a field that contains a number and some other characters like "1234_testing_iso" or "12345_impala_pad" and then I have another field which is essentially a cost code such as "1234" or "2345".
I am trying to see if I can make a WildMatch function using the second field as the expression to reference.
Field1 = 1234_testing_iso or 12345_impala_pad
Field2 = 1234 or 12345
What I had in mind would be something like:
IF(WIldMatch(Field1,'*(Field2)*'),'Match','No Match')
If it was comparing "1234_testing_iso" to field 2 (1234) there would be a "Match". Comparing it to (2345) would get "No Match".
Comparing "12345_impala_pad" to (1234) would be a "Match" and compared to (2345) would also be a "Match"
Ideas?
My bad, try this
If(WildMatch(Field1,'*' & Field2 & '*'), 'Match', 'No Match')
May be this
If(WildMatch(Field1,'*Field2*'), 'Match', 'No Match')
I tried that but then it was taking the actual name of "Field2" and looking for F-I-e-l-d-2 in the string instead of Field2 as a "variable"
My bad, try this
If(WildMatch(Field1,'*' & Field2 & '*'), 'Match', 'No Match')
May be like this??
Test:
Load F1,
F2,
if(SubStringCount(F1,F2)>0, 'Match','NoMatch') as Result1;
//if(KeepChar(F1,'0123456789')=F2, 'Match','NoMatch') as Result2;
Load * Inline
[
F1,F2
1234_testing_iso,1234
12345_impala_pad,2345
];
Hi Sunny,
What if Field1 and Field2 are from seperate tables?
I have two separate tables, 1st with keywords and the 2nd with Description, both tables cannot be joined
Thanks in advance,.
Would you be able to share a sample to show how everything looks?
i'm trying to find keywords in the description, if exist then return 1 if not then 0 for example.
Data1:
Load* Inline [
Keyword,
Mark,
Benjamin,
Jose,
];
Data2:
Load* Inline [
Description,
Mark Simon,
Gabby Caprio,
Nico Jose,
];
Thanks in advance.
Hi Sunny,
Thanks for you prompt reply. I was hoping for a keepchar() solution however the function cannot identify words but only characters (Char) . Furthermore, because it can only check characters, I cannot check whether the functions can compare from one table to another.
Do you maybe know what kind of solution I can use or maybe I'm not using the function correctly.
Thanks in advance.