Discover the winners & finalists of the 2022 Dataiku Frontrunner Awards!READ THEIR USE CASES

Negation of 'arrayContains' in the Formula Language?

Level 3
Negation of 'arrayContains' in the Formula Language?

suppose I want to do a SQL condition using the formula inside the prepare recipe.

Query:        ( ID IN (11,12,13) AND CITY NOT IN ('LA','NY','CA')) OR (ZIP NOT IN (111000,111011))

In formula language in Dataiku :

(arrayContains([11,12,13],'ID') {# for IN} &&  ---------???--------) OR (-------???-------)

what to write for 'NOT IN'?

0 Kudos
1 Reply

Hi Pankaj,


You can use not() to have the opposite of a statement. In your case, evaluating that an array does not contain an element could be done with not(arrayContains(YOUR_ARRAY, YOUR_VALUE).

See more about boolean functions in Formula in the related documentation:


You can also use directly ! : !arrayContains(YOUR_ELEMENT, YOU_VALUE)


Hope this helps!



0 Kudos