Skip to main content
Question

Error in DateTimeCalculator

  • November 5, 2018
  • 7 replies
  • 55 views

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'

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • November 5, 2018

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
  • 49 replies
  • November 5, 2018

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+60
  • 2940 replies
  • November 5, 2018

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
Celebrity
  • 7843 replies
  • 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
  • 49 replies
  • 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.

Sorry, what is incorrect?


Forum|alt.badge.img
  • Author
  • 49 replies
  • November 5, 2018

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
  • 2252 replies
  • 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.