Looker Studio Function: Looker Studio YEARWEEK Complete Guide with Examples : Use case
Category: DATE function
The YEARWEEK() function in Looker Studio returns a combined year and week number from a given date. It is highly useful for week-based analysis, WoW (Week-over-Week) performance comparison, campaign tracking, and operational planning. This function is ideal for time-series analysis where data must be grouped into weekly buckets across different years.
Purpose of the Yearweek Function
1. Week-Based Performance Tracking
Helps monitor weekly KPIs such as traffic, sales, conversions, and support volume to identify growth trends and performance fluctuations.
2. Accurate Week Segmentation Across Years
YEARWEEK ensures that week numbers remain consistent even when the week crosses year boundaries (e.g., Week 1 of 2026 may start in late December 2025).
3. Smooth Trend Visualisation
Perfect for plotting metrics in weekly line charts, eliminating daily noise and producing clean, readable time series.
Type of Calculation & Practical Use Cases
✅ Week-Over-Week Analytics
Compare performance between consecutive weeks for optimization.
✅ Campaign & Marketing Performance
Measure the effectiveness of weekly campaigns or content publishing cycles.
✅ Weekly Revenue & Forecasting
Aggregate financial data by weekly buckets for real business insights.
✅ Cohort & Behavioral Studies
Segment users based on the week of signup, purchase, or engagement.
YEARWEEK(date_expression)
| Parameter | Type | Description |
|---|---|---|
| date_expression | Date | The date field used to extract the year-week number |
How Does the Yearweek Function Work?
The function reads a date and returns a numeric result that combines year + week number.
For example, Week 3 of 2025 will return 202503.
When should use the Yearweek Function Work?
Use YEARWEEK() when your analysis requires:
Annual sales comparison
Multi-year trend dashboards
Forecasting & budget planning
Year-based data segmentation
Filtering data by selected year
Example of YEARWEEK() with Result
Example 1: Basic Usage
YEARWEEK(Order_Date) | Order_Date | Output |
|---|---|
| 2025-01-05 | 202502 |
| 2025-03-10 | 202511 |
| 2024-12-30 | 202501 |
Example 2: Weekly Sales Grouping
Use YEARWEEK(Date) as a dimension and SUM(Sales) as a metric to build a Week-wise revenue chart.
Example 3: Week-Over-Week Growth
(SUM(Revenue) – LAG(SUM(Revenue), 1, YEARWEEK(Date))) / LAG(SUM(Revenue), 1, YEARWEEK(Date))
Example 4: Segment Purchase Behavior
WHEN YEARWEEK(Purchase_Date) = YEARWEEK(TODAY()) THEN “Current Week”
ELSE “Previous Weeks”
END
Tips & Best Practices
🔹 Use with WEEKDAY() to identify best performing weekdays within week buckets
🔹 Combine with FILTER or custom parameters for dynamic week range selection
🔹 Standardize timezone settings before comparing weekly numbers
🔹 Works best in trend lines, area charts, and pivot tables
It returns a combined value representing the year and week number (e.g., 202507).
Yes — it is ideal for weekly dashboards, WoW comparisons, forecasting, and campaign analysis.
Yes, it assigns weeks consistently even when weeks overlap two different years.
Convert text to date using PARSE_DATE() before using YEARWEEK.
Absolutely — it provides cleaner trend visualization than daily data.
Established in 2020, Lets Viz Technologies provides a full range of high-quality data analysis and data visualization services. We are also an authorized Zoho Partner.
Sitelinks
