Announcing the winners & finalists of the Dataiku Frontrunner Awards 2021! Read their inspiring stories

Nested IF with OR

Solved!
Edouard
Level 1
Nested IF with OR

Hi Guys,

I'm struggling to write the following formula using IF and OR

IF Anp_SPIKE_Class_lead1 is equal to '1' OR Anp_SPIKE_Class_lead2 is equal to '1' then Fill in '1' ELSE Fill in '0' END

IF (OR Anp_SPIKE_Class_lead1==1,  Anp_SPIKE_Class_lead2==1, 1, 0)

Any help would be greatly appreciated. 

Thank you.

0 Kudos
2 Solutions
tgb417
Neuron
Neuron

@Edouard 

You have not said where in DSS you are trying to write this formula.  I'm going to guess that you are trying to use a visual recipe formula step.

In that case you were very close.  You might try an extra set of "(" and ")" and the functions "if" and "or" are case sensitive.  Try something like this.

if(or(Anp_SPIKE_Class_lead1==1,  Anp_SPIKE_Class_lead2==1), 1, 0)

I hope that help out.

Here is a link to a related conversation if the above does not work out for you.

https://community.dataiku.com/t5/Using-Dataiku-DSS/Nested-IF-with-OR-inbetween/td-p/10987

Welcome to the Dataiku Community.

 

--Tom

View solution in original post

0 Kudos
Edouard
Level 1
Author

Superb! Thank you, Tom.

View solution in original post

0 Kudos
2 Replies
tgb417
Neuron
Neuron

@Edouard 

You have not said where in DSS you are trying to write this formula.  I'm going to guess that you are trying to use a visual recipe formula step.

In that case you were very close.  You might try an extra set of "(" and ")" and the functions "if" and "or" are case sensitive.  Try something like this.

if(or(Anp_SPIKE_Class_lead1==1,  Anp_SPIKE_Class_lead2==1), 1, 0)

I hope that help out.

Here is a link to a related conversation if the above does not work out for you.

https://community.dataiku.com/t5/Using-Dataiku-DSS/Nested-IF-with-OR-inbetween/td-p/10987

Welcome to the Dataiku Community.

 

--Tom

View solution in original post

0 Kudos
Edouard
Level 1
Author

Superb! Thank you, Tom.

View solution in original post

0 Kudos
A banner prompting to get Dataiku DSS