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.

robert2012
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,1Smiley Wink

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

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

robert2012
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:

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!

robert2012
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:

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

Re: 2 times if

try this

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

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

jpapador
Valued Contributor

Re: 2 times if

If(Town1 = 'Berlin', Value,

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

Community Browser