Masha Akatieva
10/21/2025, 11:12 AMJoseph Heun
10/21/2025, 11:20 AMDATE in your MAQL condition is not valid syntax for GoodData MAQL. In MAQL, you can directly compare a date label to a date string in the correct format, without wrapping the date string in a DATE() function. The correct approach is to use the date label and compare it to a string that matches the format of your date attribute.
For example, if your date label is {label/dt_m.day} and your date values are in the format YYYY-MM-DD, you can write:
{label/dt_m.day} >= "2025-10-01"
You do not need to use `DATE('2025-10-01')`—this is not supported in MAQL and will result in an error, as you have experienced. The comparison should be made directly between the date label and the string value, as shown in the official documentation:
SELECT {metric/profit} WHERE {label/date_ordered.date} <= "2010-12-22"
or
SELECT {metric/profit} WHERE {label/date_ordered.monthYear} < "2007-05"
(Relational Operators - GoodData Cloud)
So, in your case, you should update your MAQL to:
WHEN (Brand Name {label/dim_brand.brand_name} = "..." AND Created At - Date {label/dt_m.day} >= "2025-10-01") THEN ...
Just ensure that the string "2025-10-01" matches the format of your {label/dt_m.day} attribute.Masha Akatieva
10/21/2025, 11:28 AMMasha Akatieva
10/21/2025, 11:52 AMJoseph Heun
10/21/2025, 12:10 PMBrand Name). If you use attributes in your CASE conditions that are not related to the grouping attribute, the metric cannot be computed and you get this error.
What To Do
• Check your CASE conditions: Make sure that all attributes used in your WHEN/THEN/ELSE logic are directly related to the attribute(s) you are grouping by (here, Brand Name).
• Use BY rule if needed: If you need to evaluate the CASE at a specific grain, use the BY clause to specify the correct dimensionality.
• Aggregation: Always wrap your CASE in an aggregation function like SUM as you are already doing.
Summary:
Your error is due to a mismatch between the attributes used in your CASE conditions and the metric's dimensionality. Adjust your CASE logic or use the BY clause to resolve this, as described in the official documentation (source). In short, you will need to review your LDM and the objects used in your MAQL statment.
GoodData Cloud
CASE
CASE is a conditional statement that performs logical tests on a series of conditions and returns values when a condition is met. The CASE function returns a numeric result. You use CASE for complex conditional expressions that contain two or more conditions.
CASE is followed by WHEN/THEN keywords to specify the conditions, then by ELSE to specify the default return.
If no match is found, the default return expression (ELSE) is used.Masha Akatieva
10/21/2025, 2:00 PMMasha Akatieva
10/21/2025, 2:07 PMJoseph Heun
10/21/2025, 2:32 PMMasha Akatieva
10/21/2025, 3:19 PMJoseph Heun
10/21/2025, 4:09 PMMauricio Cabezas
10/30/2025, 2:02 PMMasha Akatieva
10/30/2025, 3:09 PMJoseph Heun
10/30/2025, 5:43 PM