Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I was reading a really interesting article by Rob Wunderlich: “FASTEST” METHOD TO READ MAX(FIELD) FROM A QVD which was written for QlikView. I was wondering how much of the findings were applicable to Qlik Sense so I am trying to port his example over to Qlik Sense to see if I could replicate the efficiencies he achieved with “FieldValues”. Prior to this exercise, I was under the impression that QlikView and Qlik Sense were essentially interchangeable at the load script level. However, the line below is a clear example of where that doesn’t appear to be the case.
Let vTestStart = GetTime();
/* presumably the value returned by the getTime function is the number of milliseconds since 1 January 1970 00:00:00 */
When I looked up QlikView functions and statements not supported in Qlik Sense I didn’t see any references to GetTime(). In fact, when I looked for documentation on GetTime() it doesn’t show up in the help under any Qlik product. Can anyone help explain what is going on with this mysterious function?
To get the script to run in Sense I substituted the following line as an approximation of GetTime() in QV:
Let vTestStart = (Num(Now(1))*86400)-((now(1)-date('1/1/1970'))*86400);
BTW Open Rob's test document and select Tools->Edit Module... from the QV Desktop menu bar...
I have reconsidered my ‘fix’ to calculate the runtime duration from milliseconds since 1970 and decided to go with the standard Now(1) function. Since Now returns I dual I have to specify Num to ensure I get the numeric portion. Then subtracting 2 dates regardless of whether I measure from 1900 or 1970 should return the same duration. My guess is that GetTime() has some performance benefits in QlikView that caused Rob to use that function over the standard Now function.
BTW Open Rob's test document and select Tools->Edit Module... from the QV Desktop menu bar...
Hi Peter,
Your explanation really help clear things up, thanks! Do you know if there is an equivalent feature to call VBScript in Sense? Clearly I don't need it for this situation but it would be helpful to know for other projects. I appreciate your help!
Nope.
You're posting in a forum called QlikView Formus & Resources ->Scripting. I can tell you quite a lot about QlikView, but not about Qlik Sense.
If you want more feedback from Qlik Sense experts, then you may want to move your discussion to a forum like Qlik Sense - App Development & Usage or Qlik Sense - Data Connectivity by following the steps outlined here: QlikCommunity Tip: How to move your discussion thread
I made a new post for my follow up question:
What is the equivalent feature to create VBScript function in QlikSense
Thanks again for your help!