Skip to main content
Question

Attribute Creator Not Evaluating Expression

  • December 13, 2018
  • 12 replies
  • 90 views

philipwhitten
Supporter
Forum|alt.badge.img+15

I have an AttributeCreator that is meant to create a new attribute called "regDate" with the value:

@DateTimeParse(@Value(supByRegPlanDate), %Es)

 

The output for regDate is the string: @DateTimeParse(1543293100000, %Es)

However, I am expecting an output similar to: 20181127043140

Any suggestions why the output is showing the expression that had obtained the value from the feature, but, not created a DateTime?

 

 

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.

12 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • December 13, 2018

Did you use the TextEditor?

You will probably need to use the Mathematical Editor.

Hope this helps.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • December 13, 2018

Your input time is not in seconds but in milliseconds, convert to seconds before parsing. You cannot use the arithmetic editor for datetime expressions (but you will to convert to seconds!) I think you have to separate it into two statements e.g.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • December 13, 2018

Use the following expression @DateTimeParse(@Evaluate(@Value(supByRegPlanDate)/1000),%Es)

 


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • 50 replies
  • December 17, 2018

Your input time is not in seconds but in milliseconds, convert to seconds before parsing. You cannot use the arithmetic editor for datetime expressions (but you will to convert to seconds!) I think you have to separate it into two statements e.g.

Hello egomm,

I am unable to view your example.

Phil


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • 50 replies
  • December 17, 2018

Did you use the TextEditor?

You will probably need to use the Mathematical Editor.

Hope this helps.

I did use the String Editor, when I change to the Arithmetic Editor i get the output of <null>.


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • 50 replies
  • December 17, 2018

Use the following expression @DateTimeParse(@Evaluate(@Value(supByRegPlanDate)/1000),%Es)

 

That expression give the output of: @DateTimeParse(1543293100, %Es)

Previously I had the output of: @DateTimeParse(1543293100000, %Es)

I am still not getting the @DateTimeParse expression to evaluate.

 


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • 50 replies
  • December 17, 2018

How do I test whether my version of FME has a licence or access to use the @DateTimeParse function?


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • 50 replies
  • December 17, 2018

Your input time is not in seconds but in milliseconds, convert to seconds before parsing. You cannot use the arithmetic editor for datetime expressions (but you will to convert to seconds!) I think you have to separate it into two statements e.g.

It did need to be two separate statements, thank you.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • December 17, 2018

That expression give the output of: @DateTimeParse(1543293100, %Es)

Previously I had the output of: @DateTimeParse(1543293100000, %Es)

I am still not getting the @DateTimeParse expression to evaluate.

 

What version of FME are you using? It's working for me.


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • 50 replies
  • December 18, 2018

What version of FME are you using? It's working for me.

I am using FME 2016.1


hlouie
Contributor
Forum|alt.badge.img+16
  • Contributor
  • 33 replies
  • December 19, 2018

Is this what you're looking for @DateTimeParse(@Evaluate(@div(@Value(supByRegPlanDate),1000)),%Es)


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • December 19, 2018

I am using FME 2016.1

I don't have that version anymore, it does work in 2017 and 2018.1 though.

I'm curious, in the attributeCreator if you just entered @Evaluate(@Value(supByRegPlanDate)/1000) do you get 1543293100 or the expression as text?

 

 

Likewise of you entered @DateTimeParse(1543293100, %Es) does it give you the correct formatting or the expression again?