Calculated Column Aggregation

Hi Retool community,

Custom Column aggregations seems like it should be very simple but is proving to be far from that. I'm sure my naivety in JS is the root of my issues:

I have pulled data from MongoDB and applied some additional data filtering with Query JSON with SQL, specifically flattening nested objects and date filtering. There are a few datetime columns which I'm comparing in custom columns using...
{{ moment(currentRow.review_time).diff(moment(currentRow.request_time), 'days',true) }}
...which measures elapsed time in days between columns (since SQL in Retool doesn't support DATEDIFF which would have been quite convenient).

I'd like to get this data in a more manageable format so I can provide some basic high-level descriptive stats. Even just summing the column would be stellar.

Looking for some suggestions on a reasonable way to approach this. My what I imagine would be "logical" SQL approach doesn't seem to work well with however things are formatted in Retool.

Hi @amesery,

You should be able to use formatDataAsArray() to format your results to aggregate/analyze!