Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Fill Blank rows with 0 using IF and ISEMPTY

Tummi
5 - Atom

I'm trying to better understand the IF and ISEMPTY function on one of my flows. Currently I have a column with rows of numbers while some rows are blank. I'm trying to create a formula that within that column if there are any rows blank, then fill with 0. The current formula I have written out is:

 

IF ISEMPTY([Column ]) THEN 0 ELSE [Column ] ENDIF

 

However, the output doesn't seem to fill the blank rows and am unsure what the error may be on my end to fix the formula.

5 REPLIES 5
cjaneczko
13 - Pulsar

Are the cell empty or null? You may need to use IsNull([Column]) instead of IsEmpty().

DataNath
17 - Castor

Hey @Tummi, IsEmpty() ought to work absolutely fine here. I'd check the rows are truly empty/null i.e. aren't just a space or something. If so you could try a slightly modified expression like:

 

IF ISEMPTY(Trim([Column ])) THEN 0 ELSE [Column ] ENDIF

 

This will strip whitespace and make the cell empty so that your if condition is triggered if that is the case.

Tummi
5 - Atom

It's showing up as a blank value. Doesn't indicate as null

Tummi
5 - Atom

Not sure how the trim fixed it but it definitely worked! Thank you for the help!

DataNath
17 - Castor

@Tummi although the records *look* blank/empty, they sometimes aren't i.e. might just be a single space/bit of whitespace. Trim removes all whitespace and thus renders the record to be *actually* empty/null. Therefore, when you wrap the IsEmpty() check around that, it will trigger as true and fill with your 0 value. Hope this helps!

Labels