difference between dates and grouping the results by another dimension

can someone help me with how to find the difference between 2 dates? date_diff() or diff_days() is not working apparently in Looker somehow.

I am trying to find ${leaving_date}-${inserted_date}, these 2 are timestamps (yyyy-mm-dd 00:00:00) and lies in 2 different views in my looker. really appreciate it if someone could help me on this!

0 2 1,061
2 REPLIES 2

You can use a dimension of the type: duration where you specify sql_start and sql_end. Then by choosing intervals, Looker will perform all the calculations automatically for you.

Here is the link to the doc: https://docs.looker.com/reference/field-params/dimension_group

2f2e4e32-44e0-4758-af1c-380db36f9691.png

Thanks Dawid, this helps a lot!

Top Labels in this Space
Top Solution Authors