Alteryx Designer Desktop Discussions

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

Parse Error at Char(0):Formula Tried to apply numeric operator to string value

Alex_A
7 - Meteor

Hi, I am trying to convert a column containing Julian dates to calendar dates using the replace tool.

Expression which generates the error:

DATETIMEADD(TOSTRING(FLOOR([Ref Date]/1000)+1900)+"-01-01",MOD([Ref Date],1000)-1,"days")

 

[Ref Date]=ToNumber(IF [SDPPDJ]=Null() THEN [SDIVD] ELSE IF [SDIVD]=Null() THEN 0 ELSE [SDPPDJ] ENDIF ENDIF) 

 

Basically I have 2 columns coming from JD Edwards Tables via ODBC connection: SDIVD & SDPPDJ. They both contain dates in julian format (e.g. 118015). When combining them together - ToNumber(IF [SDPPDJ]=Null() THEN [SDIVD] ELSE IF [SDIVD]=Null() THEN 0 ELSE [SDPPDJ] ENDIF ENDIF) - there is no issue, but when I am trying to convert them to a calendar date I receive the error message above.

 

I replaced the [Ref Date] with [SDIVD] and then the conversion works.

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus

 

@Alex_A,

 

Somewhere in your incoming [Ref Date] data, the column contains or has been set to a STRING data type.  When [Ref Date] is numeric, your code works.  While you can convert (via a SELECT) the field to an INT64 (likely INT32 is big enough), any non-numeric  values will convert to 0.

 

Please check this out and see if it solves the issue.

 

Cheers,

Mark

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Alex_A
7 - Meteor

After reading your reply I noticed the Data Type drop down for the Ref Date filed, which defaulted to String. After changing this to Int32 the flow now runs smoothly.

Thank you!

Labels