Looker datagroup clarification questions

I want to define a dataGroup in my model file and use it of caching control and PDT regeration control -

Create a dataGroup with max_cache_age = 1h and sql_trigger for PDT refresh at 6AM in model file. If I use the dataGroup on pdt datagroup_trigger, will my PDT build every hour?

max_cache_age is unrelated to PDTs and will not trigger a rebuild. See docs for details

Thank you @davidtamaki ! I also want to get clarification on the applicability of sql_trigger of dataGroup on the sql cache if I apply the dataGroup to an explore in the model file. The below sql_trigger does trigger on weekdays at 6:30 AM CST.

I hope it rebuilds the cache evry weekday at 6:30 AM CST even though the max_cache_age is 80 hrs. I did not find it mentioned in docs. So, want to clarify if the sql cache of explore is refreshed at 6:30AM CST

Datagroup for PDT refresh schedule

INTERVAL 390 MINUTE = 6.5 hours → Triggers at 6:30 AM every day

datagroup: daily_weekday_trigger {
sql_trigger: SELECT
CASE
WHEN EXTRACT(DAYOFWEEK FROM DATETIME(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 390 MINUTE), ‘America/Chicago’)) IN (1, 7) THEN 6 – Saturday/Sunday → Friday
ELSE EXTRACT(DAYOFWEEK FROM DATETIME(TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 390 MINUTE), ‘America/Chicago’))
END AS trigger_value
;;
max_cache_age: “80 hours”
description: “Refreshes PDT at 6:30 AM CST on weekdays, cache valid for 80 hours”
}

That’s correct. You just need tie everything back to the same datagroup. So the explore will use persist_with and the PDT use datagroup_trigger

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.