Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I need your help. How can I make a search in a string with field content from another table, for example a helping csv.
For example:
Table1:
Description |
---|
ABCD |
EFGH |
IKL |
XYZ |
in the csv file will be the string to search and the result to show:
Table2:
String | Data |
---|---|
BC | Result1 |
GH | Result2 |
K | Result3 |
XY | Result4 |
Now I need something like this:
if(substringcount(Description,String)>0,Data)
The result should be so:
Description | Data |
---|---|
ABCD | Result1 |
EFGH | Result2 |
IKL | Result3 |
XYZ | Result4 |
Thank you very much
Best Regards,
Ibrahim
Try with MapSubString()
MappingTable:
Mapping
LOAD String,
'/' & Data & '\' as Data;
LOAD * INLINE [
String, Data
BC, Result1
GH, Result2
K, Result3
XY, Result4
];
FactTable:
LOAD Description,
TextBetween(MapSubString('MappingTable', Description), '/', '\') as Data;
LOAD * INLINE [
Description
ABCD
EFGH
IKL
XYZ
];
Try with MapSubString()
MappingTable:
Mapping
LOAD String,
'/' & Data & '\' as Data;
LOAD * INLINE [
String, Data
BC, Result1
GH, Result2
K, Result3
XY, Result4
];
FactTable:
LOAD Description,
TextBetween(MapSubString('MappingTable', Description), '/', '\') as Data;
LOAD * INLINE [
Description
ABCD
EFGH
IKL
XYZ
];
Thank you very much Sunny. It works