cancel
Showing results for 
Search instead for 
Did you mean: 

HANA studio If Else Scenario

vaibhav_rathore
Participant
0 Kudos

Hi All,

i am applying a logic like:

if("Material"='xxx' or "Material"='yyy' and ("Type"='261' or "Type"='262'), "Qty",0)

In the above case i want to display Quantity if Either of the Material and Either of the Type is true. Both of the conditions before and after AND must satisfy.

But the result i am getting is considering only Material even if the Type is different, for eg

Material Type Qty (Wrong)

xxx 101 5000

Material Type Qty (Correct)

xxx 262 1000

Please help me if i am missing something.

Regards

Vaibhav

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

I think you have to enclose the Material conditions also in brakes, otherwise if the Material is 'xxx' the further conditions are not considered anymore. At the moment the Type conditions are only applied in case the Material is 'yyy'.

if(("Material"='xxx' or "Material"='yyy') and ("Type"='261' or "Type"='262'), "Qty",0)
vaibhav_rathore
Participant
0 Kudos

Hi Florian,

Got the solution for the above scenario the same way you suggested.

if(("Material"='xxx' or "Material"='yyy') and ("Type"='261' or "Type"='262'), "Qty",0)

Thanks and Regards

Vaibhav

Answers (0)