Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ashishpalkar
Creator III
Creator III

If Statement in Script

Hi There

I have to create following if statement in Load Script

If(a=1,b=2,c=3,Y,N) as Data;

in above statement , a , b and c are coming from 3 different QVD's.

How to achieve this?

Thanks,

1 Solution

Accepted Solutions
PrashantSangle

Hi,

can you explain in simple statement.

if(a=1 AND b=2 AND c=3,'Y','N') as Data

or

if(a=1 OR b=2 OR c=3,'Y','N') as Data

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 🙂

View solution in original post

9 Replies
petter
Partner - Champion III
Partner - Champion III

Where do you want your If statement - in a new load statement? Which file, database or QVD does this If draw it's data from? You give us too little information to be able to give you sound advice.

petter
Partner - Champion III
Partner - Champion III

2015-10-03 #1.PNG

PrashantSangle

Hi,

can you explain in simple statement.

if(a=1 AND b=2 AND c=3,'Y','N') as Data

or

if(a=1 OR b=2 OR c=3,'Y','N') as Data

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 🙂
PrashantSangle

Capture.PNG

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 🙂
qlikviewwizard
Master II
Master II

Data:

load * ,If(a=1 and b=2 and c=3,'Y','N') as If_Statement;

Load * inline [

a,b,c

1,2,3

4,5,6

7,8,9

];

Hope this will help you.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

QVTableName:

LOAD

*,

If(a=1 AND b=2 AND c=3,Y,N) as Data

FROM DataSource;


Hope this helps you.

Regards,

jagan.



Anonymous
Not applicable

hi ashish,

Table1:

Load ID,a

From a.qvd;

concatenate

Load ID,b

From b.qvd;

concatenate

Load ID,c

From c.qvd;

Table:

noconcatenate

Load *,

If(a=1 and b=2 and c=3,Y,N) as Data // or try If(a=1 or b=2 or c=3,Y,N)

Resident  Table1;

ashishpalkar
Creator III
Creator III
Author

Thanks Neetha , your solution worked for me.

jagan
Luminary Alumni
Luminary Alumni

Hi Ashish,

If you got the answer close this thread by giving correct answer, it helps others in finding answers easily.

Regards,

Jagan.