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.
SOLVED

Required help in IF Statement

anonymous008_G
8 - Asteroid

Hi,

I am trying to create new column based on my below condition. however, this is not working in formula tool. Can someone please help me correcting the IF statement.

 

IF Contains([Period], "One YearEnded") then "Cumulative" ELSEIF Contains([Period], "_2" and "One YearEnded") then "Annulized"
ELSE "Annulized" ENDIF

 

(Screenshot attached)

16 REPLIES 16
alexnajm
17 - Castor
17 - Castor

Very helpful and needed context - based on your table's values, try this: IF Contains([Period],"One YearEnded") THEN "Cumulative" ELSE "Annulized" ENDIF

 

HOWEVER your description of "One "YearEndedMM/DD/YY_2" doesn't match the value in the table - if this is the case, it needs to be adapted: IF Contains([Period],"One YearEnded") AND !Contains([Period],"_2") THEN "Cumulative" ELSE "Annulized" ENDIF

aatalai
14 - Magnetar

@anonymous008_G can you please help clarify what your desired outcome is for Two YearsEnded12/31/23?

 

Is it Annualized YearEnded12/31/23_2

 

and for Four YearsEnded12/31/23 would it be Annualized YearEnded12/31/23_2

HomesickSurfer
12 - Quasar

Hi @anonymous008_G 

 

My approach:

 

This:

IF Contains([Period], "One YearEnded") AND !Contains([Period], "_") THEN "Cumulative" ELSE "Annualized" ENDIF

 

or this:

IF Contains([Period], "Years") OR Contains([Period], "_")  THEN "Annualized" ELSE "Cumulative" ENDIF
anonymous008_G
8 - Asteroid

I want end result as if column contains One YearEnded then Cumulative , if column contain One YearEnded and _2 then Annualized else everything should be annualized. In the raw data One YearEnded12/31/23 this value is double differentiating one value for cumulative and other value which converted as _2 by alteryx is annualized. I don't want any dependencies on date since this is going to change every year.

alexnajm
17 - Castor
17 - Castor

@anonymous008_G my most recent answer meets these requirements!

Required help in IF Statement.png

alexnajm
17 - Castor
17 - Castor

@anonymous008_G I would appreciate one of my posts also being marked as a solution since the same function (bar "_2" instead of "_") was mentioned prior (and you can accept multiple posts as solutions). Thank you in advance!

anonymous008_G
8 - Asteroid

thank you all. this is works now

Labels