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.

Not applicable

mutliple if

Hi All,

I am trying to work in QV scripting by applying multiple If Conditions.

1 Solution

Accepted Solutions
MVP
MVP

Re: How to work with multiple if statements

first, start simple with 2 or 3 conditions and if works add some other conditions

second I don't think you need "and if" but something like that with, at the end, a number of ) as the number of conditions

if(condition1, value1,

if(condition2, value2,

if(condition3, value3,

value4

))) as field,


if you post the doc we can better check the syntax

3 Replies
MVP
MVP

Re: How to work with multiple if statements

first, start simple with 2 or 3 conditions and if works add some other conditions

second I don't think you need "and if" but something like that with, at the end, a number of ) as the number of conditions

if(condition1, value1,

if(condition2, value2,

if(condition3, value3,

value4

))) as field,


if you post the doc we can better check the syntax

Re: How to work with multiple if statements

I am trying to work in QV scripting by applying multiple If Conditions.

But my brackets are not working properly

Really? Where?Smiley Happy

How long did it take to write this statement?

Congratulation for the effort anyway...

As Massimo suggested you something else than IF..

hrlinder
Honored Contributor

Re: How to work with multiple if statements

amazing, how do you want to control that Statement?

as I noticed there are a lot of duplicates

just one idea:

why not provide an inline table with all combinations
I donot know your datamodel, so how to connect to toher tables?

TEST:

load * Inline [

[WS_Category], [Claim_Activity], [Claim Process],  [RequestType], OUTPUT

Russia, Scrap,,, [QV_Cash_Out]+[Replacement Costs]

Turkey,,,,,,[QV_Cash_Out]

Sermicro,,,,QV_Cash_Out]+ 350,

RTS,,TCA,CC,,[Tariff to be paid to claimer(EUR)]+[Replacement Costs]