Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tiklabaq
Creator
Creator

Search string with field content

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:

StringData
BCResult1
GHResult2
KResult3
XY

Result4

Now I need something like this:

if(substringcount(Description,String)>0,Data)

The result should be so:

DescriptionData
ABCDResult1
EFGHResult2
IKLResult3
XYZResult4

Thank you very much

Best Regards,

Ibrahim

1 Solution

Accepted Solutions
sunny_talwar

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

];

View solution in original post

2 Replies
sunny_talwar

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

];

tiklabaq
Creator
Creator
Author

Thank you very much Sunny. It works