I’m trying to display the % difference of a stock on grafana.
Here’s the queries that return the daily % variation.
Values are parsed from a csv file by telegraf:
SELECT (close / open) - 1 AS "calculated_percentage" FROM "stock" WHERE $timeFilter tz('America/New_York')
This query is working for the daily % variation between open and close.
I would like to be able to aggregate with cumulative_sum to know the total variation between 2 selected date.
When I try to add cumulative_sum around the (close / open) that didn’t work.