Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bkn
Contributor II
Contributor II

LIKE Operator in LOAD Script

I am trying to filter the List Box with some words inside it and wants to use Variable and also need to use '*'.

WHERE [Chain] LIKE '*(vR1)*';  ---this is working when i use variable. Note: i need to use variable

Thanks in advance.

9 Replies
MarcoWedel

WHERE [Chain] LIKE '*$(vR1)*';

bkn
Contributor II
Contributor II
Author

Actually its not working when i use variable..

WHERE [Chain] LIKE '*$(vR1)*';

its_anandrjs

Hi,

It is working in any list box expression properties write

This are example

Ex:-

1.  Let vR1 = 'T';

=if([Chain] LIKE '*$(vR1)*',[Chain])

Or in the load script it will be

2. In any load script

Raw:

LOAD * Inline [

Chain

A

BTT

dddTjh

C

T

R ];

Let vR1 = 'T';

N:

NoConcatenate

LOAD * Resident Raw Where Chain LIKE '*$(vR1)*';

DROP Table Raw;

Regards

Anand

bkn
Contributor II
Contributor II
Author

Hi Anand, Thanks for quick response. When variable vR1 is string, its working fine. But i need to pick the certain name from the list(column) and put it in variable and use that variable to Where clause.

PrashantSangle

Hi,

You can do one thing .

When you are creating variable that time use * to concat it

like your variable like

Let vR1 = '*Name*';

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
its_anandrjs

Definitely it will work try to enter the TT string in the variable and load the data

Raw:

LOAD * Inline [

Chain

A

BTT

dddTjh

C

T

R ];

let vR1 = 'TT';

N:

NoConcatenate

LOAD * Resident Raw Where Chain LIKE '*$(vR1)*';

DROP Table Raw;

bkn
Contributor II
Contributor II
Author

Yes, this works when we use hardcoded value such as TT in variable.

My requirement is to get the value in variable from the Table.

Example:

'NTNAME' is a table which has value like Jack,Ryan,Anand,..

I need to put the NTNAME inside that variable and use that variable in WHERE Clause.

Thanks.

Not applicable

Use WildCard function

bkn
Contributor II
Contributor II
Author

Not working when using Variable and in LOAD Script