Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
OK so I wasn't quite sure which forum to post this under so it can go here as I know it is the most frequently monitored.
This is going to sound crazy so bear with me, its absolutely doing my head in.
I have a master calendar QVD generator which has a number of 'flags' in it, one of which is calculated using the formula below:
,YearToDate(Date)*-1 as CurYTDFlag
Ok nothing fancy right?
Here is the table when reloaded in the app (either on my machine or the server)
And here is the exact same table, loaded 30 second later but loaded by the Server (not publisher)
I have a second flag using the YearToDate function which behaves the same way
All three systems are running V12 SR 4 (12.0.20300.0
I can't explain this different behaviour but it is consistent behaviour, I mean it is easy to work around (one of many examples being if(InYear(Date,now(),0)=-1 AND Date <=now(),1,0) ) but the YearToDate function is nice and easy to use
From the help:
Returns true if a date falls within the year to date, else false. If none of the optional parameters are used, the year to date means any date within one calender year from January 1 up to and including the date of the last script execution.
I expect the difference is due to the last script execution date, which may be different depending on where the app was reloaded.
Do you have a -prj folder in the sale location as the calendar qvd? This will cause the last script execution date to be value 0 when the app is opened, so YearToDate() will always be false. The server reload is not affected in the same way, so YearToDate() works correctly.
From the help:
Returns true if a date falls within the year to date, else false. If none of the optional parameters are used, the year to date means any date within one calender year from January 1 up to and including the date of the last script execution.
I expect the difference is due to the last script execution date, which may be different depending on where the app was reloaded.
Do you have a -prj folder in the sale location as the calendar qvd? This will cause the last script execution date to be value 0 when the app is opened, so YearToDate() will always be false. The server reload is not affected in the same way, so YearToDate() works correctly.
Hi Jonathan,
Yep we have a prj folder so that explains it thank you!
How irritating!
I don't know why opening a document with a -prj file zeroes the last reload time, but the ReloadTime() function is affected the same way. I can think of no logical reason for this behaviour, so I consider this to be bug.
I would have to agree, it has to be a bug in that Qlik isn't reading the value back as it is sure as heck writing it to the prj folder (Doc Properties)
<LastReloadTimeAsISOString>2016-12-23T07:42:06.000Z</LastReloadTimeAsISOString>
For anyone coming across this thread, this issue has been worked on and will hopefully be resolved by 12.10 SR5 or SR6
Good to know ![]()