Hi everyone!
I’m working with an array of 12 months data (each item has a close
value and a datetime
like this):
This array is generated from an Array Aggregator, and I want to calculate the average close
value of the latest 10 months using a Set variable
module.
Here’s the expression I tried:
{{average(map(slice(8.array; 0; 10); get(8.array; “close”)))}}
But this gives me an error:
Function 'map' finished with error! '{empty}' is not a valid key.
or sometimes:Function 'number' not found!
I also tried different approaches with current
, number()
, etc., but it seems not all functions are available in Set variable
.
Has anyone managed to process a sub-array (first 10 values) and calculate a numeric average from a key like "close"
?