Skip to main content
Question

Error in DateTimeCalculator


Forum|alt.badge.img

In 2016.1.1, when trying to add 10 hours to a DateTimeCalculator I receive the following error:

DateTimeCalculator_DateFormatter: @Tcl2 -- failed to evaluate expression `DateTimeCalculator_DateFormatter_formatter {FME_NULL_VALUE}' -- wrong # args: should be "string range string first last"

 

 

What am I doing wrong?

Screenshot seemed to fail upload.

Attribute(encoded: utf-8) : `Last_edited_date' has value `20180601010111'

7 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

Put an inspector on the output of the transformer just before the DateTimeCalculator. What is the input? Also printscreen the DateTimeCalculator Parameters. Best is to capture the sample data of one failing features (the Recorder transformer) and share the piece of the workspace. This way others can reproduce your problem.


Forum|alt.badge.img
  • Author
  • November 5, 2018
nielsgerrits wrote:

Put an inspector on the output of the transformer just before the DateTimeCalculator. What is the input? Also printscreen the DateTimeCalculator Parameters. Best is to capture the sample data of one failing features (the Recorder transformer) and share the piece of the workspace. This way others can reproduce your problem.

screen-shot re-uploaded and value provided


nielsgerrits
VIP
Forum|alt.badge.img+54
peterx wrote:

screen-shot re-uploaded and value provided

Sorry, still unable to reproduce :-(

Just to be sure, the attribute name from the inspector is Title case (Last_edited_date) where the attribute name in the printscreen of the DateTimeCalculator is lowercase (last_edited_date). Mixed use of casing did bite me in previous situations but might not be the problem here.

Maybe @takashi can help, as he is the creator of the DateTimeCalculator.


takashi
Influencer
  • November 5, 2018

I wasn't able to reproduce the error, but I noticed that the parameter type for the Source Dataset Attribute parameter in your screenshot seems to be wrong. It should be an Attribute Name type parameter and should look like this:

The transformer in your workspace could have been broken for some reason. Please remove the custom transformer from both the workspace and your system (righ-clikd on the transformer name in the Transformer Gallery then select Delete Definition), then re-add the transformer from the FME Hub.


Forum|alt.badge.img
  • Author
  • November 5, 2018
takashi wrote:

I wasn't able to reproduce the error, but I noticed that the parameter type for the Source Dataset Attribute parameter in your screenshot seems to be wrong. It should be an Attribute Name type parameter and should look like this:

The transformer in your workspace could have been broken for some reason. Please remove the custom transformer from both the workspace and your system (righ-clikd on the transformer name in the Transformer Gallery then select Delete Definition), then re-add the transformer from the FME Hub.

Sorry, what is incorrect?


Forum|alt.badge.img
  • Author
  • November 5, 2018
nielsgerrits wrote:

Sorry, still unable to reproduce :-(

Just to be sure, the attribute name from the inspector is Title case (Last_edited_date) where the attribute name in the printscreen of the DateTimeCalculator is lowercase (last_edited_date). Mixed use of casing did bite me in previous situations but might not be the problem here.

Maybe @takashi can help, as he is the creator of the DateTimeCalculator.

I think there is more than one "last_edited_date" in my workspace so perhaps that is the cause. I ended-up using Python.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 6, 2018

"string range" is a tcl function.

Apparently the date string is stripped apart, probably with a regexp. Seems like this fails and therefore is feeding the "string range" function insufficient arguments.

 

Maybe one or more of your input "last_edited_date" is in wrong format? Are there maybe empty/null/missing record fed to it and it does not test for such?

I never touch these transformers, prefer using clock scan, format etc.

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings