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

Struggle with brackets

CiaoPaola
7 - Meteor

hi, 

this is an IF formula with 2 conditions to be checked

 

I created a field to receive the result : CloseDate

absagedatum and bewerbungseingang are Date fields. Lets call them Date1 and Date2

vertrag is a field containing 3 values (1, 2 or 3) or null values. 

 

it says: 

if Date1 is null and vertrag is 1 or 2

then add 2 months to Date2

or CloseDate remains empty

 

If Isnull([absagedatum] AND [vertrag] ='1' OR '2')
then DateTimeAdd([bewerbungseingang],2,"months")
else ''
endif

 

Can't find out where is the syntax error. 

Thank you

Paola

3 REPLIES 3
messi007
15 - Aurora
15 - Aurora

@CiaoPaola,

 

Please see below

 

if isnull([Date1]) and [vertrag] in ( "1","2")
then DateTimeAdd([Date2],2,"Month") 
elseIf Isnull([absagedatum]) AND [vertrag] in ('1' OR '2')
then DateTimeAdd([bewerbungseingang],2,"months")
else ''
endif

 

Let me know if it works or not.

 

Regards,

KarolinaRoza
11 - Bolide

hi @CiaoPaola ,

 

please try with that formula (it depends what type of data column you have, if [vertrag] is string then you need to apply "", if it is Byte then just number is enough):

 

if Isnull([absagedatum]) AND [vertrag]=1 or [vertrag]=2
then
DateTimeAdd([bewerbungseingang],2,"month")
else ''
endif

 

 

 

 

KarolinaRoza_0-1624276404142.png

 

 

Regards,

Karolina

CiaoPaola
7 - Meteor

Hi Karolina

Hi Messi

thank you for your help

 

Karolina, your formula is working fine. 

Yours, Messi, do not but I won't be able to tell you why.

 

However thank you both for your help

have a nice day

Paola

Labels