How can I apply an offset to a timestamp field in a transform?

#1

I’m transforming a canonical to a TimedDataPoint type, and need to populate the mandatory start field with a timestamp value.

My source data does not contain a timestamp for each record (it’s performance curve data with only a relative timestamp); however, it does contain a monthIndex value, which increments for each record in the series.

Given the above, I want to use a hard-coded start date (let’s say 1 Jan 1970), and then apply an offset based on the monthIndex for each record, so that I can still load the data (as I need unique values for start.).

How can I handle this in the transform?

0 Likes

#2

Going off of Riley’s comment here you can do something along these lines:

start : ~ expression "dateTime('1970-01-01', 'yyyy-MM-dd') + period(monthIndex,'MONTH')"
1 Like