Hi Team, I'd like to show the latest data load dat...
# gooddata-cloud
c
Hi Team, I'd like to show the latest data load date in a rich text field. I have
BUS_DATE
in the table. How can I display the latest date (MAX(BUS_DATE)) in the rich text?
k
Thinking completed Great question! Displaying a latest date (like
MAX(BUS_DATE)
) in a rich text widget has some important limitations to be aware of in GoodData. The Core Limitation
MAX(date)
in MAQL returns an internal numeric representation (e.g.,
2022
or
2,022
) rather than a human-readable formatted date. Date formatting for metric outputs is not currently supported. [Community Slack] [Community Slack] What You Can Try Option 1: Reference a date attribute label in rich text Instead of using a metric, you can reference a date attribute label directly in the rich text widget using
{label/bus_date.day}
(or
.month
,
.year
depending on your granularity). This will display the date value in context of the current dashboard filters.
Copy code
Latest data load date: **{label/bus_date.day}**
> âš ī¸ Be aware: if the filter context returns multiple values, the widget will show
(Multiple items)
. It's recommended to use this only in combination with a single-value filter. [Rich Text Limitations] Option 2: Use a metric with MAX(date) — with caveats You can create a MAQL metric like:
Copy code
SELECT MAX({label/bus_date.day}, {dataset/your_dataset})
Then reference it in rich text as
{metric/your_metric_id}
. However, as noted above, this will render as a number, not a formatted date string like
mm/dd/yyyy
. [MAX docs] Option 3: Handle it upstream The most robust workaround is to compute the "latest load date" in your data warehouse/ETL layer and expose it as a string attribute in your Logical Data Model (LDM). You can then reference it in rich text as
{label/your_label_id}
and it will display exactly as formatted in the source. Rich Text Variable Reminder If any variable in your rich text widget fails to resolve, all variables in that widget will show
(Data could not be retrieved)
— so make sure all IDs are spelled correctly and exist in your data model. [Rich Text Limitations] In summary, the cleanest path today for a formatted date display is either using a date attribute label directly (with a single-value filter) or pre-computing the formatted date string upstream. Let us know if you need help with any of these approaches! 👍 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.