Min Date Per Group

Okrasee
Participant I

I want to calculate the earliest(min) date per group in my explore.
I applied formula: add_days(min(diff_days(now(),${my_table.date})),now()) but it returns the earliest date among all rows as in for each row the earliest date is the same despite of different groups.
What I want to achieve is:

Group                Date
A                    2020-01-09
B                    2019-08-01
C                    2016-10-05

Rather than:

Group                Date
A                    2016-10-05
B                    2016-10-05
C                    2016-10-05

Would this be possible? Making changes in lookml is also welcomed but adding custom calculation would be ideal. Thanks in advance.

0 1 1,178
1 REPLY 1

Conceptually, I would interpret this as a measure, since you need to consider all records in a group while only returning the one row in the result set.

In some cases, you are able to define measures from the explore interface using custom measures. However, for the date datatype, the only custom measure we support at this time is a count. So, I would recommend adding this measure to your LookML

Top Labels in this Space
Top Solution Authors