Is there a way to do date offset using Calculations?

deprecated
(JD Maresco) #1

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?

0 Likes

#2

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?

0 Likes

(JD Maresco) #3

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!

0 Likes

(Arsi Shiva) #4

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

0 Likes

#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.

0 Likes

(Ovi Hentea) #6

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.

0 Likes