Community Conundrums are live! Learn more

set a column to Null based on a condition with DSS Formula

Level 2
set a column to Null based on a condition with DSS Formula
Jump to solution

I have a column that I want to set to Null based on condition on another column value.

I succeeded to build the formula but did not find the keyword for Null

if(and(isNotNull(myColumn) ,myOtherColumn!= 'VALUE'), NULL, myColumn)

For the moment I put '' instead, but this is not what I want.

 Thank you for your answer,

Mohammed

0 Kudos
3 Replies
Dataiker
Dataiker

Hi,

The prepare recipe does not distinguish between empty string and null so '' should do what you want.

0 Kudos
Level 2
Author

Thank you Clément for your reply.

The issue is that the column is used later in the flow in a join reciepe and then the blank '' is different from Null  (Database wise)

0 Kudos
Dataiker
Dataiker

Hi,

In a database it's indeed different. However, the prepare recipe will always write-out NULL to the database for empty cells.

0 Kudos