Cathy Liu
08/06/2026, 3:40 AMkapa.ai
08/06/2026, 3:40 AMCASE WHEN metric. There are a couple of problems to address:
Why the CASE Metric Isn't Working 1. CASE doesn't work at the base data level
Your metric:
SELECT CASE WHEN {label/HALF} = "H1" THEN {metric/venue_egm_h1_half_lga}
ELSE {metric/venue_egm_h2_half_lga_2}
END
CASE evaluates on the aggregation dimension, not at the row level. When the CASE condition attribute (HALF) is not directly related to the visualization's slicing dimension, the metric cannot be computed. [CASE statement]
2. CASE with metric references in THEN/ELSE branches
The recommended pattern is to wrap CASE inside a SUM aggregation container, and use facts rather than referencing other metrics directly in the branches. [CASE statement]
Recommended Fix Instead of the CASE approach, since you already have your two filtered metrics (venue_egm_h1_half_lga and venue_egm_h2_half_lga_2), the simplest and most robust solution is to sum them directly using IFNULL to handle cases where one half has no data:
SELECT IFNULL({metric/venue_egm_h1_half_lga}, 0) + IFNULL({metric/venue_egm_h2_half_lga_2}, 0)
This avoids the CASE limitation entirely. Without IFNULL, if one metric returns NULL (e.g., no H1 data for a venue), the entire sum returns NULL. [IFNULL fix]
If You Must Use CASE Wrap it inside SUM and use facts directly:
SELECT SUM(
SELECT CASE
WHEN {label/HALF} = "H1" THEN {fact/VENUE_EGMS}
ELSE {fact/VENUE_EGMS}
END
)
However, note that if you're slicing by an attribute unrelated to HALF in your visualization, you'll still get a "wrong case conditions" error. In that case, the IFNULL + addition approach above is the better path. [CASE dimensionality]
Also, since the GoodData support team has admin access to your workspace, they may be able to look directly at the metric and dashboard to help diagnose further. đ 0 button đ 0 button âšī¸ Tip: Mention @kapa.ai in the thread for follow-ups.
đ Our Support team monitors all messages and will jump in if needed.Cathy Liu
08/06/2026, 3:45 AM