Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

bkn
Not applicable

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
Not applicable

Re: LIKE Operator in LOAD Script

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

bkn
Not applicable

Re: LIKE Operator in LOAD Script

Actually its not working when i use variable..

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

its_anandrjs
Not applicable

Re: LIKE Operator in LOAD Script

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
Not applicable

Re: LIKE Operator in LOAD Script

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
Not applicable

Re: LIKE Operator in LOAD Script

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.
its_anandrjs
Not applicable

Re: LIKE Operator in LOAD Script

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
Not applicable

Re: LIKE Operator in LOAD Script

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

Re: LIKE Operator in LOAD Script

Use WildCard function

bkn
Not applicable

Re: LIKE Operator in LOAD Script

Not working when using Variable and in LOAD Script