14.7. EXTRACT() and DATE() in Looker Studio
In this lesson, we'll discuss two functions in Looker Studio, EXTRACT()
and DATE()
, that help extract specific date parts from a given date time value. Both methods can be useful in various situations where you only need the date portion of a date time field and not the associated time.
Using the EXTRACT() Function
To extract the date part from a datetime value, use the EXTRACT()
function:
EXTRACT(date_part FROM datetime_expression)
In this formula, date_part
should be replaced with the specific part you want to extract from the given datetime expression (e.g., month, week, or date). In our example, we'll extract the date part from the first rebill date calculation:
EXTRACT(date FROM first_rebill_date_expression)
Where first_rebill_date_expression
is the expression used to calculate the first rebill date.
Using the DATE() Function
The DATE()
function is another method that extracts the date from a datetime value:
DATE(datetime_expression)
This function removes the time from the given datetime expression and only returns the date. In our example, we can apply the DATE()
function to the first rebill date calculation:
DATE(first_rebill_date_expression)
Where first_rebill_date_expression
is the expression used to calculate the first rebill date.
These two functions, EXTRACT()
and DATE()
, allow you to isolate specific parts of datetime values in Looker Studio, offering more flexibility in reporting and analysis. They can be especially helpful when you only need the date portion of the datetime value and want to discard the associated time.
β 14.2. Calculating Membership Duration with CURRENT_DATE()
β 14.3. Advanced Date Range Selector
β 14.5. DATETIME_ADD() in Looker Studio
β 14.6. DATETIME_DIFF() in Looker Studio
β 14.7. EXTRACT() and DATE()
β 14.8. Embedding Videos in Looker Studio
β 14.9. Embedding Forms in Looker Studio
β 14.10. Embedding Google Docs
β 14.11. Quicker Data Freshness with Blending & BigQuery
β 14.12. Extract Data in Looker Studio
β 14.13. Creative Use Cases for Extract Data in Looker Studio
β 14.14. Discussion: Dashboard Types in Looker Studio
β 14.15. Discussion: Dashboard Design and Layout Considerations
π© Receive my weekly Looker Studio tips
π₯Β Subscribe to my YouTube channel
π Connect with me on LinkedIn