Alteryx Designer Desktop Discussions

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

Formula to fill in blank cells if condition is met and leaving alone if condition not met

nickrosen28
7 - Meteor

Hi everyone,

 

I am attempting to fill in blank cells if these are met: {category] is "Other" and [Task] is blank

I want to fill the blank with the word "Other"

If those arent met I want to leave the cell alone.

 

Some tasks are blank and some say "Null" i want both instances to say "Other" if the conditions are met.

 

How would I go about doing this?

 

Thanks!

nickrosen28_0-1687204724886.png

 

7 REPLIES 7
hellyars
13 - Pulsar

@nickrosen28 

Try this...

 

if isnull([Task]) then "Other"

elseif isempty([Task]) then "Other"

else null()

endif

 

 

 

hellyars
13 - Pulsar

@nickrosen28 

Sorry..  you can modify the above to

 

 

if [Category]="Other" and isnull([Task]) then "Other"

elseif [Category]="Other" and isempty([Task]) then "Other"

else null()

endif

 

hellyars
13 - Pulsar

@nickrosen28 

I fixed a few typos in the formulas above.

The formula works (don't mind the workflow as I was playing around) -- the Formula tool should be sufficient.

hellyars_0-1687205889371.png

 

hlee36
8 - Asteroid

@nickrosen28

 

hlee36_0-1687205783743.png

 

You can use the formula tool and but make sure to use a temporary column.

 

Also, you can use the function "IsEmpty", which recognizes both blank with "" and null value. And then, you can change the column name.

 

 

Edit:

 

I put space in the bottom three rows and trimmed that to put blank value.

 

hlee36_0-1687206150958.png

 

hlee36_1-1687206174197.png

 

 

Check all the rows are now "Other"

 

hlee36_2-1687206235821.png

 

nickrosen28
7 - Meteor

Thanks for the speedy reply!

 

It works with 1 issue, all of the other "task" cells are Null for the ones that use to have data in them.

 

For example for a row with Category "Forecast" used to have task "Update Model"

Now it says "Forecast "and task "null".

 

Just need a small edit where it will leave the columns alone rather than turning them null if they dont meet the criteria in the If then portion of the statement.

 

Thanks again, trying to figure it out but wont work.

binuacs
20 - Arcturus

@nickrosen28 If your formula has a hard-coded value you will not get the desired result

binuacs_0-1687214808642.png

 

hellyars
13 - Pulsar

@nickrosen28 

 

Don't know which idea you are responding to, but it might be as simple as changing the end of an IF statement

 

 

 

use

else ""  
endif

This will generate an empty cell if the criteria are not met

vs

else null() 
endif 

This will generate a null value of the criteria are not met

 

 

Labels