Looker Studio calculated field – Older date from a date field
May 3, 2022
- by Mehdi Oudjida
The Looker Studio (ex Google Data Studio) calculated field below returns the older date from a date dimension. The min date in other words.
- Explanations of the formula
- Get the older date of the date field using MIN function
- Use LEFT_TEXT to extract the date part of the date time
- Parse the text to cast it as a date using PARSE_DATE function when it is a unaggregated dimension
- If you need a standalone field, without blending, it is easier to create a calculated field as an aggregated metric, using only MIN function (second formula below)
- Input
- Any date type dimension
- Output
- The older date
- Used functions
Older date as a dimension
PARSE_DATE("%Y/%m/%d",LEFT_TEXT(MIN(Date),10))
Older date as an aggregated metric
MIN(Date)