Seamlessly Switching Between Data Sources Based on Date - On UA and GA4 Blend

Challenge: I'm building a report that blends data from both Universal Analytics (UA) and Google Analytics 4 (GA4) depending on the date. I want Looker Studio to seamlessly transition between sources at a specific cutoff date, but I'm getting stuck with formula errors.

Desired Outcome: My ultimate goal is to have a single report that shows sessions data:

  • Before October 5, 2023: Use data from the SBUA source.
  • On and after October 5, 2023: Use data from the SBGA4 source.

Formula Attempts:

I've tried several formulas like this as a calculated field in either the dimensions or metrics fields:

IF(DATE(YEAR([SBUA.Date]), MONTH([SBUA.Date]), DAY([SBUA.Date])) <= DATE(2023, 10, 05), [SBUA.Sessions], [SBGA4.Sessions])

I've also tried using TODATE and DATE_TRUNC functions, but I keep getting errors like "Invalid formula - Unsupported expression."

Explanation of Formula Components:

  • .Date: This references the "Date" field within the specified data source. I did this because I'm comparing dates, not the entire data source itself.
  • .Sessions: This references the "Sessions" metric within the data source. This is the actual data I want to switch between based on the date condition.
  • DATE(2023, 10, 05): This specifies the cutoff date for switching between sources.

My Request:

I'm seeking your help to:

  • Debug my existing formulas: Identify the syntax issue or function incompatibility causing the errors.
  • Refine the formula if needed: Ensure the formula accurately switches between sources and retrieves the desired session data.
  • Understand alternative approaches: Are there other ways to achieve this data source blending based on date in Looker Studio?
0 0 79