Skip to main content
Question

Attribute Creator Not Evaluating Expression

  • Dec 13, 2018 2:54 PM UTC
  • 12 replies
  • 156 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+26
  • Contributor
  • Dec 13, 2018 2:58 PM UTC

Did you use the TextEditor?

You will probably need to use the Mathematical Editor.

Hope this helps.


ebygomm
Evangelist
Forum|alt.badge.img+54
  • Evangelist
  • Dec 13, 2018 3:05 PM UTC

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+41
  • Contributor
  • Dec 13, 2018 3:22 PM UTC

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

 


philipwhitten
Supporter
Forum|alt.badge.img+15
  • Author
  • Supporter
  • Dec 17, 2018 12:11 AM UTC

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
  • Dec 17, 2018 12:26 AM UTC

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
  • Dec 17, 2018 12:32 AM UTC

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
  • Dec 17, 2018 1:43 AM UTC

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
  • Dec 17, 2018 5:15 AM UTC

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+41
  • Contributor
  • Dec 17, 2018 7:05 PM UTC

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
  • Dec 18, 2018 8:54 PM UTC

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

I am using FME 2016.1


hlouie
Contributor
Forum|alt.badge.img+17
  • Contributor
  • Dec 19, 2018 6:51 PM UTC

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


jdh
Contributor
Forum|alt.badge.img+41
  • Contributor
  • Dec 19, 2018 6:56 PM UTC

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?