Skip to main content
Solved

Transform attribute after list indexer

  • February 18, 2022
  • 2 replies
  • 16 views

I get data via API in a JSON format. The values from "Points" need to be stored in seperate attributes. I managed to do so with JSON Fragmenter (json["points"][*]). With list indexer I can then store each index (0 & 1) to an attribute. But I can not transform then this attribute with DateTimeConverter.  

In the log I saw, that the list structure still exists in my dataset. I also found this information in the Feature Information (see screenshot).

 

How can I actually transform the list into a proper attribute?

 

JSON Structure:

{

  ...

  "name" : "xy",

  "modified" : "2022-02-16T10:16:53.066Z",

  "points" : [

   [ 1642633200000, 123.99 ],

 

String replacer Output vs. Feature Information:

image

Best answer by takashi

Hi @hodelc​ , looks like the datetime value e.g. "1642633200000" is an elapsed time from the epoch in milliseconds. I think the DataTimeComverter could recognize it as a valid datetime value from epoch if you converted it to the value in seconds.

datetime = datetime / 1000 

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • Best Answer
  • February 18, 2022

Hi @hodelc​ , looks like the datetime value e.g. "1642633200000" is an elapsed time from the epoch in milliseconds. I think the DataTimeComverter could recognize it as a valid datetime value from epoch if you converted it to the value in seconds.

datetime = datetime / 1000 


  • Author
  • February 18, 2022

Hi @Takashi Iijima​ 

Thanks, this solved my problem! I did the calculation with ExpressionEvaluator_Output


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