08-02-2022 05:13 AM
I have a dashboard scheduled to run/send a PDF every morning at 6:00 a.m.
The dashboard has some date logic built in which relies on session variables.
An interesting issue is coming up where the mailed PDF is showing data as of two days ago, not yesterday ( $SV_Yesterday_Day_Number_Of_Week ) but when I run it interactively it runs fine.
Initial theory is that the session variable is not being populated when the dashboard is scheduled to run, but remains cached from the prior day's interactive use.
1) Sound plausible?
2) Can I force the refresh/renewal of a session variable(s) ( or a global variable ) so that dashboards running on a schedule get the most up to date values?
I can work around this for now by not using session variables - but this behavior has me wondering about using session variables in conjunction with schedules and if what I'm seeing is "expected behavior" ( quotes because it's not the behavior *I* expected! ).
If I run a DB process overnight to update a lookup table for instance, will my dashboard reflect that? Right now the answer seems to be "if you run it in Incorta" but maybe not if you schedule it.
A support ticket is next if Community wants to race 😉
08-03-2022 07:17 AM
Hi @RADSr ,
Currently the session/global variables are being cached, unlike system time-based variables. Those variables are refreshed either with new login session or when a column used is refreshed.
So the recommendation is to use the system variable in the dashboard directly, if possible. Unless you are already using a column in the variable definition, and that column is on a schema with scheduled load job.
In the meanwhile, it is already on the radar and will be addressed very soon to exclude any variable that depends on a time-based system variable.
08-03-2022 07:37 AM
Thank you for the response!
Restating just to make sure I have the explanation correct for the customer:
1) Session variable values are populated upon sign-on and the values cached.
2) The cache remains intact until the next sign-on
3) Schedules run under the user's account do not require a sign-on and therefore use the cached values instead of repopulating them. Manually running the report *does* require a sign-on and so the values are refreshed and the newly refreshed values used from that point forward.
If that's the case, would cycling the analyzer service clear the cache and force a re-query of the session variable when the scheduler runs? And, follow-up, I know I can schedule the stop-start on-prem, but is it possible w/ a cloud account?
Alternatively - and I ask from a position of near-100% ignorance of web forms - is it possible to automate the login action from a .bat file or something similar?
08-04-2022 05:33 AM
Yes, some of these workarounds are possible, but let me connect with the support team as we do have a parameter to force re-evaluating time-based variables, that should be officially released soon.