Is there a way to do date offset using Calculations?

  • 15 May 2015
  • 6 replies

I’d like to create a Calculation in a look in order to calculate a date field that is always offset from another date column by a certain number of days.

I don’t see any functions for working with dates. Is this possible?

6 replies

Userlevel 5

Hey JD - Date manipulation isn’t currently possible with table calculations. However, this feature is still in beta, and we looking for use cases to add new features like these! I will pass this on to our product team. Do you have a more specific use case for this calculation that you would like to share?

I wanted to be able to add a column that was offset by a number of days from another column. I was able to get our BI team to add another field. Thanks!

We also need something like this, let me know if we can do this in lookml, adding or subtracting n number of days from a date

Userlevel 5

Arsi and JD - We actually just added date operations to table calcs in Looker 3.30! We have some information about this here. If you haven’t been upgraded to 3.30 yet, talk to Looker support if you’d like to be updated earlier.

If you want to to date operations in LookML, we have some info about doing that here.

Colin seems to have found a way to offset dates in table calculations, assuming your result set has contiguous-day data and that you always order by date.

These links don’t work -- can they be included with the full URL please! :)