Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

IF statement heirachy

StephanieReid
5 - Atom

Hello, 

 

I am working on a flow that will not always have some of the inputs. There are a total of 6 months possible of inputs, but typically only 2-3 will exist. I am trying to write formulas so that Alteryx will go back to the last possible value. Example, if month 6 doesn't have a value, go to month 5, if month 5 doesn't have a value, go to 4 and so on. Right now I have all the data joined together via a multi join tool. Here is the formula I have setup that keeps resulting in a NULL (or 0 if its a number field) when there are values in the month 1 fields. It is like the formula is stopping at the first IF statement and pulling in the NULL from month 5.

 

if isempty([Month 6 Field 1]) then [Month 5 Field 1] elseif isempty([Month 5 Field 1]) then [Month 4 Field 1] elseif isempty([Month 4 Field 1]) then [Month 3 Field 1] elseif isempty([Month 3 Field 1]) then [Month 2 Field 1] elseif isempty([Month 2 Field 1]) then [Month 1 Field 1] else [Day 1 Field 1]) endif 

 

I have about 30 fields, strings and doubles, I need to apply this formula to and every column is resulting in a blank or 0. 

 

 

1 REPLY 1
mceleavey
17 - Castor
17 - Castor

Hi @StephanieReid ,

 

Can you please provide your workflow and some mock data so we can see what you're trying to achieve. It sounds like there will be a better way to do this than an epic IF statement.

 

M.



Bulien

Labels