Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to achieve the function in "Load" statement, which "in" like SQL?

How to achieve the function in "Load" statement, which "in" like SQL?

For example:

Load *,if(InsCode in $(vInsCode),1,0) as Flag from Fact.qvd(QVD);

$(vInsCode)=('0021','33A1','4263',......)

If the InsCode equal '0021' or '33A1' or '4263' or ....,I want to flag this row by a new column named Flag.

And "vInsCode" is a variable.

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try this way.

    Load *

     from XYZ

     where wildmatch(InsCode,'0021','33A1','4263',......);

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Miguel_Angel_Baeyens

Hi,

Use the conditional with the match() function to create the flag

Table:

LOAD *,

     If(Match(InsCode, $(vInsCode)) > 0, 1, 0) AS Flag

FROM Fact.qvd (qvd);

Make sure that $(vInsCode) has all possible values single quoted and comma separated.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica