Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Wrong number of parameters in expression

MHS
8 - Asteroid

Good afternoon,

 

I am attempting to write an expression through the formula tool and continue to get an error message that reads "wrong number of parameters for the function Null".  I have written these types of expressions in the past and have never run into this issue.  I am guessing that it is a relatively easy fix which I am unable to determine what to change.  Any help would be greatly appreciated.

 

MHS_0-1618336225948.png

 

 

Thanks!

7 REPLIES 7
mceleavey
17 - Castor
17 - Castor

Hi @MHS ,

 

Are you trying to input a null value as the last clause? if so, drop the "0" from in the parentheses. Just null().

 

M.



Bulien

MHS
8 - Asteroid

Hi @mceleavey,

 

I attempted that earlier and get a different error message of "Invalid type in operator >=".  I have tried to change up the greater than or equal to portion, but cannot get rid of the error message?

 

MHS_0-1618337278972.png

 

 

 

mceleavey
17 - Castor
17 - Castor

@MHS , this is due to the data type. What is the data type of the field?



Bulien

MHS
8 - Asteroid

Hi @mceleavey,

 

I have it coming into the formula tool as a date, does this need to be changed?

 

Maskell_Rascal
13 - Pulsar

Hi @MHS 

 

When referencing a date field, you need to put quotes around the date in your formula. 

IF [Field1]>= '2020-03-19' THEN '2020.07' ELSE Null() ENDIF

 

Thanks!

Phil

mceleavey
17 - Castor
17 - Castor

@MHS , you are comparing dates in a string field. Wrap the dates in a todate() function:

 

if [created] >=todate(2020-01-01) then "2020.01" etc.

 

M.



Bulien

MHS
8 - Asteroid

Hi @Maskell_Rascal and @mceleavey,

 

Thanks for all the help with this, the quotations addressed the error and the workflow ran successfully!

 

Matt

 

Labels