Alteryx Designer Desktop Discussions

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

formulaa

Hi2023
8 - Asteroid

Hi, 

 

I made a change to a formula and now its not working, so I am sure it is something small I am missing.

 

IF (DateTimeDiff(DateTimeToday(),[LAST_NSMT_DT],'month')<= 15
AND [OT_AM] >=8500) THEN "RUE"
ELSEIF
[CUL_AM] >= 0.8 * [CRT_AM]
AND [CUL_AM] >=9000
AND IsEmpty([LAST_V_T_DT])
AND (DateTimeDiff(DateTimeToday(), ([CN_STMT_CN] = 5) THEN "New Acc"
ENDIF

 

I used to have 2 conditions [cn_STMT_CN=5 AND [CN_STMT_FG] =2 then 'New ACC'

 

but now it is giving an error where it is highlighted red when I took one condition out. Can you assist please

 

thanks

7 REPLIES 7
Yoshiro_Fujimori
15 - Aurora

@Hi2023 ,

 

It seems the IF-THEN-ELSEIF-THEN-ENDIF expression is missing ELSE at the end.

Please try to add ELSE clause (e.g. ELSE Null() or whatever it works for you) just before ENDIF.

 

Hi2023
8 - Asteroid

I added a ELSE before the ENDIF and it still didnt work?

Yoshiro_Fujimori
15 - Aurora

Could you upload your workflow with input data?

Hi2023
8 - Asteroid

I cant due to privacy

 

why else would it not work now?

Hi2023
8 - Asteroid

Its says Malformed Function after the 5,

Yoshiro_Fujimori
15 - Aurora

@Hi2023 ,

 

In general, you will get faster response when the requirement, the input data sample, and the expected output data are provided.

Without them, it is difficult for the outsiders to guess and give you the right answer. Even pseudo data may help.

(see also Community Resources : Posting for Fastest Possible Solution )

 

That said, I try to guess from the information you provided so far.

 

Basically the error message "Malformed Function Call" occurs when the parameter is not properly provided.

In your function,

  (DateTimeDiff(DateTimeToday(),

     ([CN_STMT_CN] = 5)

 

The function DateTimeDiff requires parameters of (dt1,dt2,u), while yours has only two parameters.

I don't know what you want to do here, but you need to complete this function to avoid the error.

 

You may want to continue looking at the error message until there is no error any more.

Good luck.

Deano478
12 - Quasar

@Hi2023 in the DateTimeDiff function you are missing a Date Time Unit which will always cause an error also what is the purpose of the Parenthesis () in the DateTimeDiff that are wrapped around the variable ([CN_STMT_CN] = 5) this does'nt make sense?

Labels