Alteryx Designer Desktop Discussions

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

One Condition If Then

verde0903
8 - Asteroid

Hello,

 

Which is the best formula to use when creating an if then formula with one criteria.  In the example attached, I need the formula that if under column Type it equals to City to return the City Name.  If Type is State to  return the State.

 

Thanks,

Maylen

5 REPLIES 5
ShankerV
17 - Castor

Hi @verde0903 

 

One way of doing this with One IF formula is.

 

ShankerV_0-1677206698668.png

ShankerV_0-1677206733600.png

 

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @verde0903 

 

One more way is to use the Formula tool also.

 

ShankerV_0-1677206976549.png

 

 

ShankerV_1-1677206992720.png

ShankerV_2-1677207004546.png

 

 

Many thanks

Shanker V

binuacs
20 - Arcturus

@verde0903 using IIF() statement

IIF([Type] = 'City',[City Name],IIF([Type]='State', [State], Null()))

binuacs_0-1677219135791.png

 

verde0903
8 - Asteroid

Thank you.  It worked.

verde0903
8 - Asteroid

Thank you.  Both suggestions worked.

Labels