Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Before February 2023, the auto calendar code for one app worked as expected, but after one update in the system it stopped giving the desired result in one of the fields. After some research, I've found the issue is the usage of a variable inside the auto calendar.
We have one variable to know when the app was opened:
let vL.ReferenceDate = monthstart(today(2));
The variable is later used to calculate the offset of FY:
year(yearstart(($1), 0, 4)) - year(yearstart((vL.ReferenceDate), 0, 4)) as FY_offset
The workaround for the issue was to remove the variable and do a direct calculation of the date:
(year(yearstart(($1), 0, 4)) - year(yearstart(monthstart(today(2)), 0, 4))) as FY_offset,
Even though this works now, there's another case with the same issue where we need the latest date of the data which we peek from another table:
Last_Date:
Load
monthstart(date(max(invoice_mth))) as MAX_DATE
Resident REVENUE;
LET vMAX_invoice_mth = peek('MAX_DATE', 0, Last_Date);
Unfortunately, we can’t replace the variable with calculation directly as Qlik can’t use peek function there, so the workaround doesn't work.
Any idea of why this is happening? Code for the auto cal is attached.