Skip to main content
Question

Attribute Creator Not Evaluating Expression


philipwhitten
Contributor
Forum|alt.badge.img+12

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?

 

 

12 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • 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+38
  • Influencer
  • 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+28
  • Contributor
  • December 13, 2018

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

 


philipwhitten
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • December 17, 2018
ebygomm wrote:

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
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • December 17, 2018
erik_jan wrote:

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
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • December 17, 2018
jdh wrote:

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
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • December 17, 2018

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


philipwhitten
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • December 17, 2018
ebygomm wrote:

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+28
  • Contributor
  • December 17, 2018
philipwhitten wrote:

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
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • December 18, 2018
jdh wrote:

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
  • December 19, 2018

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


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • December 19, 2018
philipwhitten wrote:

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?

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