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!
I wanted to use a prepare recipe instead of a python code one to do some error handling (for some maintenance reason).
One thing i tried to do was to reproduce this line from python :
if "str" in array_of_str :
// do something
else :
// do an other thing
Unfortunately, it's a little bit more complicated to do with dataiku formula. Contains works only with string, in doesn't work, and doing one if for each element of the array is not a scalable solution.
So, here is what i came up with :
if( arrayContains( forEach( [], item, item==column),"true"),column,"ERROR")
Don't forgot to replace the [] and name of the variable with yours 🙂
Hope I helped !
Solved it above, but just in case :
if( arrayContains( forEach( [], item, item==column),"true"),column,"ERROR")
Don't forgot to replace the [] and name of the variable with yours 🙂
Solved it above, but just in case :
if( arrayContains( forEach( [], item, item==column),"true"),column,"ERROR")
Don't forgot to replace the [] and name of the variable with yours 🙂
Would you mind sharing your solution to the above? It may be interesting to other users 🙂
I shared it in the question already 🙂
I wanted to do like in stack overflow when you can ask and answer your question on the same place but I don't think it's possible here so i did this.
But sure i'll write the answer in the validated answer as well.
Thank you for your contribution!