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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement else nothing

Hi,

I want to make a if statement already in teh laoding script. Lets say i have a list of 5 clients. If client is 3 then Banana else just keep the original valuesof 1,2,4,5.

Client:

1

2

3 = Banana

4

5

Is this possible?

4 Replies
oknotsen
Master III
Master III

Lets assume the field this 1-5 is in is called "theField" (and A, B, C, E and F are random other fields from the same table):

LOAD

A,

B,

C,

if(theField = 3, 'Banana', theField) as aField

E,

F

from some source

;

May you live in interesting times!
PradeepReddy
Specialist II
Specialist II

try like this...

Load *,

if(Client='3', 'Banana', Client) as Client

From Source;

maxgro
MVP
MVP

another one could be

Client:

load

  Client as ClientOrig,

  pick(wildMatch(Client, 3, '*'), 'Banana', Client) as Client 

inline [

Client

1

2

3

33

4

5

];

Anonymous
Not applicable
Author

For the best maintenance try this

Map_ClientName:

Mapping

LOAD * INLINE [

    ID, Name

    3, Banana

];

ClientTable:

Load

     ApplyMap('Map_ClientName',Client) as Client

From Source.xls;

Applymap if no find ID in the Map_ClientName, put the original Client value.

So, if in the future you need other Name for your client, just add to the Map_ClientName.