There are Query JSON with SQL resources in Retool. I want to calc cumulative sum based on field I received from API request. It calculates wrong in Query JSON with SQL. Is there any way to do it correct?
Example (works right when data from Postgres):
select
date,
sum(metric) over (order by date) as cum_metric
from my_table
Result
date, cum_metric
2021-01-01, 10
2021-01-02, 20
2021-01-03, 30
Example (works wrong when data from API):
select
date,
sum(metric) over (order by date) as cum_metric
from my_table
Result
date, cum_metric
, 60