Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hey everyone!
Currently I am using the prepare recipe, and specifically the Create if, then, else statements processor. For one of the if statements, I want to write an if statement that check if each value in a specific column is not contained in a given array. I know that I can compare a value with another value; however, I would like to compare a value with an array of values (string in this case).
Is there any way to do that?
Hi,
I don't see a way to do this with if then else processor but instead you can use a formula:
You can use "arrayContains" https://doc.dataiku.com/dss/latest/formula/index.html
if(arrayContains([2010, 2020, 2030], year), "true", "false")
Thanks
Hi,
I don't see a way to do this with if then else processor but instead you can use a formula:
You can use "arrayContains" https://doc.dataiku.com/dss/latest/formula/index.html
if(arrayContains([2010, 2020, 2030], year), "true", "false")
Thanks
That's clear Alex! Thank you! Appreciate your help!
I’m not clear that this can be done using the create, if, then else visual prepare recipe step. I am wondering if you can use the formula recipe step to get what you want done.
here is a post that seems to be related to your use case
If you want to use the create, if then else step for other reasons you might simply use the formula step to create a temporary Boolean column with the answer if you found or did not fine that item you were looking for. Then in the create if then else column you would simply reference the temporary column you created.
Hello,
You can achieve this with the Create...If..then processor by using the operator "is none of the strings".
Best,
I am already using the formula processor; however, I thought that the if, then, else processor might give a more accurate result.
Thank you so much for your response. I appreciate your help!