Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
adamdavi3s
Master
Master

YTD flag difference reloading in app and reloading on server

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)

Capture.PNG

And here is the exact same table, loaded 30 second later but loaded by the Server (not publisher)

Capture2.PNG

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

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
adamdavi3s
Master
Master
Author

Hi Jonathan,

Yep we have a prj folder so that explains it thank you!

How irritating!

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
adamdavi3s
Master
Master
Author

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>

adamdavi3s
Master
Master
Author

For anyone coming across this thread, this issue has been worked on and will hopefully be resolved by 12.10 SR5 or SR6

jonathandienst
Partner - Champion III
Partner - Champion III

Good to know

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein