Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

if else

HI All,

i have two conditions written i.e.

if(Country='Brazil' and Strategic_Part='Tubes',    

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.200,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1))) ,

if (Match(Country,'Russia','Russian Federation','Indonesia') and Strategic_Part='Tubes',

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.270,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1))) as T1

My first condition(else part not happening) is not working the formula where i have renamed T1 only it is considering ..


Can you please help me where i have missed out.

Thanks,

Bharat

1 Solution

Accepted Solutions
sunny_talwar

Try this

    If(Country='Brazil',

  If(Strategic_Part='Tubes',     

If(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055, [mat con loc cur]*1*-1),

If(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.200, [mat con loc cur]*1*-1)),

If(Match(Country,'Russia','Russian Federation','Indonesia'),

If(Strategic_Part='Tubes',

If(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055, [mat con loc cur]*1*-1),

If(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.270, [mat con loc cur]*1*-1)))) as test

View solution in original post

22 Replies
shansundar
Partner - Creator
Partner - Creator

Hi,

Can you little bit elaborate your issue, is this the select part of the load statement in script.

Thanks,

Shan S

bharatkishore
Creator III
Creator III
Author

Hi,

Yes it is in the script..

shansundar
Partner - Creator
Partner - Creator

if your country values are case sensitive if not you can try using mixmatch instead of match.

Can you please give little more detail to understand the issue clearly.

Thanks,

Shan S

bharatkishore
Creator III
Creator III
Author

Hi,

I have two conditions:

1)

if(Country='Brazil' and Strategic_Part='Tubes',   

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.200,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1)))

this is all one condtion. if this condtion is not satisfied then it need to go else i.e

if (Match(Country,'Russia','Russian Federation','Indonesia') and Strategic_Part='Tubes',

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.270,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1))) as T1

But the problem is the first condition is not working directly it is going to else which is second condition.

Please let me know if you need anything more..

bharatkishore
Creator III
Creator III
Author

stalwar1‌ Sunny bhai if you have time can you please have a look..

sunny_talwar

can you highlight the part of the expression which you think is not right?

bharatkishore
Creator III
Creator III
Author

Sunny Bhai,

if i can take both the expressions individually they are working fine. But when i need to combine both of them into a single one it is not happening like

if(Country='Brazil' and Strategic_Part='Tubes',  

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.200,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1))),

if (Match(Country,'Russia','Russian Federation','Indonesia') and Strategic_Part='Tubes',

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.270,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1))) as T1

The first condition is not working directly is going to else which i named as T1..

In Sheet object i can see the full first condition and t1 but together i should get T1..

Hope i am clear .. please let me know sunny bhai if i am not clear

sunny_talwar

Can you highlight (bold) the condition please

bharatkishore
Creator III
Creator III
Author

Sunny Bhai the first condition:

if(Country='Brazil' and Strategic_Part='Tubes', 

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.200,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1)))


The second condition:

if (Match(Country,'Russia','Russian Federation','Indonesia') and Strategic_Part='Tubes',

if(not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.055),

if(Strategic_Part<>'Tubes' and not IsNull([U-D_NL9s]) and [U-D_NL9s]<>0 and [U-D_NL9s]<>0.01, mat_con_qua*-1*[U-D_NL9s]*1.270,

if(IsNull([U-D_NL9s]) or [U-D_NL9s]=0 or [U-D_NL9s]=0.01, [mat con loc cur]*1*-1))) as T1