Is there an AQL way to calculate Date + X Days

Is there any way to take the value of a date dimension and add a specific number of days? I was trying to add 30 days in an ad hoc dimension, but could not find an AQL function for this. We have transaction dates and want to display the invoice due date (30 days after transaction date, for example) as well.

I’m looking for something like SQL’s DATEADD or BigQuery’s DATETIME_ADD.

Hi Becca,

AQL supports adding interval to a date, so you can use a + sign to add any interval you want to a date column.

I just realized the documentation for this is missing though. Let me inform the team about this.

Regards,

2 Likes

Hi Tan,

Perfect! That works!

Thanks,
Becca

Also works to add a calculated metric like this:

Forecast end date by adding forecasted days remaining to the most recently received item.

max(stack_assignment_timing.completed) + interval(tot_dyn_d_remain days)

3 Likes