# 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.

New Contributor III

## 2 times if

Hi all,

I have a really difficult problem:

I want to calculate in this way:

if column1 = A,B,C

and if (A=A(comlumn2);B=B (comlumn2);C=C(comlumn2) then Value(column3)*1; else do Value(column3)*1,1

if  column1 = D then  Value(column3)*1

So there are two if sentences.

Thank you for helping!

If you need a better explanation - just tell me! :-)

1 Solution

Accepted Solutions
MVP

## Re: 2 times if

try this:

If( Town1='Berlin', Value, If(Town1=Town2, Value, Value * 1.1))

assuming '1,1' is your typing mistake and you meant '1.1'

10 Replies
MVP

## Re: 2 times if

Yes, please explain a bit better.

Not applicable

## Re: 2 times if

if you want to do nested if-Statements, here as a good tool:

http://www.qlikblog.at/tools/Nested-If-Generator.html

Hope this helps a little bit

Honored Contributor II

## Re: 2 times if

try like this way

if  column1 = D then  Value(column3)*1 else

if column1 = A,B,C

and if (A=A(comlumn2);B=B (comlumn2);C=C(comlumn2) then Value(column3)*1; else do Value(column3)*1,1;

Not applicable

## Re: 2 times if

example of nested if--

if(Value='5',X,

if(Value='4',Y,

if([Indicator Number]='7' and Value='3',Z,

if(([Indicator Number]='8' or [Indicator Number]='9') and Value='2',ABC,

if(Value='1',A,

if(Value='2',P,Q))))))

New Contributor III

## Re: 2 times if

Ok, here is my next try:

I have a table with one value and two columns of towns:

 Value Town1 Town2 Result i want 3 M M 3 4 FFM FFM 4 5 M FFM 1,1*5 6 M FFN 1,1*6 754 FFM M 1,1*754 3 FFM FFM 3 23 M FM 1,1*23 5 Berlin Berlin 5 Berlin is always *1 56 Berlin FFM 56 Berlin is always *1 6 M M 6

So If the Town1 and the Town 2 is not the same I want to multiply the value with 1,1 !

If it is the same i want the same value => multiply with 1.

Berlin should not be affectet and always be multiplied with 1

Hope that helps!

New Contributor III

## Re: 2 times if

Ok, here is my next try to explain it:

I have a table with one value and two columns of towns:

 Value Town1 Town2 Result i want 3 M M 3 4 FFM FFM 4 5 M FFM 1,1*5 6 M FFN 1,1*6 754 FFM M 1,1*754 3 FFM FFM 3 23 M FM 1,1*23 5 Berlin Berlin 5 Berlin is always *1 56 Berlin FFM 56 Berlin is always *1 6 M M 6

So If the Town1 and the Town 2 is not the same I want to multiply the value with 1,1 !

If it is the same i want the same value => multiply with 1.

Berlin should not be affectet and always be multiplied with 1

Hope that helps!

Not applicable

## Re: 2 times if

try this

if(Town1=Town2 or Town1='Berlin',Value,11*Value)

MVP

## Re: 2 times if

try this:

If( Town1='Berlin', Value, If(Town1=Town2, Value, Value * 1.1))

assuming '1,1' is your typing mistake and you meant '1.1'

Valued Contributor

## Re: 2 times if

If(Town1 = 'Berlin', Value,

If(Town1 =Town2, Value, Value * 1.1))