14.4. WEEKDAY() Function
In this lesson, we will explore the WEEKDAY() function in Looker Studio, which allows you to extract and display the day of the week from a given date. This can be useful in various analyses such as identifying popular days for a website, planning staff schedules for a call center, or tracking site activity across days of the week.
Extracting Day of the Week
To extract the day of the week from a date, use the WEEKDAY()
function:
WEEKDAY(date)
This function returns a number between 0 and 6, where Sunday is represented by 0 and Saturday by 6.
Displaying the Name of the Day
By default, the WEEKDAY() function does not return the name of the day, only its index. To show the actual day name, you must use a CASE
statement to map the numerical output to the corresponding day name:
CASE WHEN WEEKDAY(date) = 0 THEN "Sunday"
WHEN WEEKDAY(date) = 1 THEN "Monday"
...
WHEN WEEKDAY(date) = 6 THEN "Saturday"
END
This CASE
statement checks the output value of the WEEKDAY()
function and returns the corresponding name of the day for each value.
Considerations
Although Looker Studio doesn't support lookup tables, you can use functions like WEEKDAY()
and CASE
to achieve similar objectives. Using these functions, you can create customized analyses and visualizations based on your data, allowing you to extract valuable insights from your data set.
Remember to take advantage of the flexibility provided by Looker Studio functions to enhance your data analysis and presentation. Understanding these functions and their applications allows you to provide better insights and optimize your operations based on relevant metrics.
β 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