1) Give a description of the problem
I want to parse a json with a lot of data (weather each 5 minutes for the day). So I want to parse the last hour only and its not even sure that the data represent 1 hour (if web request is done close from midnight). I would like to use a formula inside the square bracket that represent the index of the data… Something like:
(count($response.observations.metric.pressureTrend)>12?sum(count($response.observations.metric.pressureTrend),-12):0)
so if the data is enough it will gives the last hour but if not it will give the latest data. The only thing is that when I use this formula like this it doesnt works
$response.observations.metric.pressureTrend[(count($response.observations.metric.pressureTrend)>12?sum(count($response.observations.metric.pressureTrend),-12):0)]
It looks like we could not use formula inside those brackets (I tried to simply use sum(2,2) and the last bracket turned red…
thanks!