is PREVIOUS({label/BUS_DATE.year}) the right one?
# gooddata-cloud
c
is PREVIOUS({label/BUS_DATE.year}) the right one?
k
Based on the knowledge sources, the correct MAQL syntax for
FOR Previous
uses
{attribute/...}
references, not
{label/...}
. The documented syntax is:
Copy code
SELECT {metric/revenues} FOR Previous({attribute/quarter})
So for your case, the correct form would likely be:
Copy code
SELECT {metric/your_metric} FOR Previous({attribute/BUS_DATE.year})
Using
{label/BUS_DATE.year}
may work depending on your data model setup, but the standard documented syntax references the attribute, not the label. [FOR Previous] A few additional things to keep in mind: •
PREVIOUS({label/BUS_DATE.year})
is equivalent to
FOR Previous({attribute/...}, 1)
— it shifts back by one year. [Time Macros] • If your visualization uses multiple date objects,
FOR PREVIOUS
will only shift the specific date attribute you specify — it cannot dynamically shift all date filters applied to the metric. [Community Slack] If you're seeing unexpected results, double-check whether you should be using
{attribute/BUS_DATE.year}
instead of
{label/BUS_DATE.year}
, and confirm that the date dimension identifier matches your data model. šŸ‘ 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.