Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
tresesco
MVP
MVP

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'

View solution in original post

10 Replies
tresesco
MVP
MVP

Yes, please explain a bit better.

Not applicable
Author

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

er_mohit
Master II
Master II

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
Author

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))))))

Anonymous
Not applicable
Author

Ok, here is my next try:

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

ValueTown1 Town2Result i want
3MM3
4FFMFFM4
5MFFM1,1*5
6MFFN1,1*6
754FFMM1,1*754
3FFMFFM3
23MFM1,1*23
5BerlinBerlin5 Berlin is always *1
56BerlinFFM56Berlin is always *1
6MM6

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!

Anonymous
Not applicable
Author

Ok, here is my next try to explain it:

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

ValueTown1 Town2Result i want
3MM3
4FFMFFM4
5MFFM1,1*5
6MFFN1,1*6
754FFMM1,1*754
3FFMFFM3
23MFM1,1*23
5BerlinBerlin5Berlin is always *1
56BerlinFFM56Berlin is always *1
6MM6

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
Author

try this

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

tresesco
MVP
MVP

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'

jpapador
Partner - Specialist
Partner - Specialist

If(Town1 = 'Berlin', Value,

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