In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Why am I getting error Type mismatch in operator +

ndubal
5 - Atom

'= IF(A'+ ToString(([Record Added Date])+1,0) +'>$B$6,'+'"New",'+'"Existing"'

 

ndubal_0-1663771583338.png

 

Date Type [Record Added Date]: Date Time 

 

The below formula works to have an excel output with formulas. Where [Record ID (Column A)] is Byte Data Type

"= (B"+tostring([Record ID (Column A)]+1,0)+"*C"+tostring([Record ID (Column A)]+1,0)+")"

2 REPLIES 2
mceleavey
17 - Castor
17 - Castor

Hi @ndubal ,

 

because the data types are different. 

In the formula you are using a Tostring() to change the preceeding number to a string which you are then attempting to add to a number. Try wrapping the tostring in a tonumber():

 

'= IF(A'+ tonumber(ToString(([Record Added Date])+1,0)) +'>$B$6,'+'"New",'+'"Existing"'

 

 

I hope this helps.

 

M.



Bulien

Christina_H
14 - Magnetar

You're trying to add 1 to a datetime field, which isn't possible.  If you want to add something to the date you need to use the DateTimeAdd function.

e.g. '= IF(A'+ ToString(DateTimeAdd([Field1],1,'day'),0) +'>$B$6,'+'"New",'+'"Existing"'

Christina_H_0-1663772706641.png

Although the output doesn't make sense for an Excel formula.  Is this actually the output you want?

Labels
Top Solution Authors