Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've never seen this before but ran into this interesting situation where it matters if I run script as my local desktop user or if I run it as my QV Publisher user.
The date field is stored into Sql Server as a 'date' field...so it looks like this. 2020-01-02.
What has happened (and I totally don't understand it) is that.
If I run script on desktop (server credential'd), "developer" credentials
Date(Date#,'YYYY-MM-DD'),'M/D/YYYY') returns 1/2/2020.
If I run script on QV Publisher, but using the Publisher's credentials
Date(Date#,'YYYY-MM-DD'),'M/D/YYYY') returns - (a null or dash or whaterver you wanna call it).
What was happening is I built all my scripts...they run...I put them in publisher and they fail.
I then put this code in place and it works...the blurred text is my "developer" credentials.
BUT WHY??? I just don't get it.
First check how OSUSER() is getting in published? Normally, Publisher holds with Internal Domain tag as well
And the other thing, is Second part of condition, Is that returning anything?
(D User) = Local Desktop with Server rights, OSUser()=Domain\MyUser - user has admin rights on the server
(P User) = Server Desktop and Publisher, OSUser()=Domain\ServiceUser - admin service account on the server
not sure what you mean by "is second part of condition".
When running on the Server Itself with Service User Account... (P User) as I referenced above.
returns NULL with DATE(DATE#(InvDate,'YYYY-MM-DD'),'M/D/YYYY')
returns 1/2/2020 with DATE(InvDate,'M/D/YYYY')
When running with the (D User) as I referenced above.
returns 1/2/2020 with DATE(DATE#(InvDate,'YYYY-MM-DD'),'M/D/YYYY')
just realized what you were referencing, sorry.
Yes the second part of the condition returns 1/2/2020 when running it on the Service itself via QV Desktop or QV Publisher as the OSUser()=Domain\ServiceUser account.
Publisher has some Date format capable. But, You case is generic what I resume.
1) Check in different browsers
2) What version you are using
3) Is that IE or AJAX
@brooksc57 The only other thing that comes to mind is something with the service account setup on the server is looking at a different environment variable or something related to date formatting, so may want to check that out too, only thing that came to mind that might explain things, Regional Settings is what I am think of I think.
Regards,
Brett
Probably your app missed the various interpreting-variables which are automatically generated within the script-tab "Main" (of course they could be manually changed, out-sourced, deleted). If they don't exists Qlik takes OS settings and they might be different between your local machine and the server.
- Marcus