Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have written a simple VBscript macro in the Edit module:
sub
dim
set
set
msgbox
end
Which tests out absolutely fine.
I have changed the Requested Module Security and Current local security to System Access.
I have added it to the Document properties in the Triggers OnOpen list of actions:
Run Macro Macro name Reload_data
Clear All
Activate Sheet Sheet ID SH01
I have set the security of the document to Macro Override Security
sub ("Last Time Data Was Reloaded in the System was " & LastReloadedTime & ". (Data is automatically reloaded at 13:00 Mon-Sat.)" ) adoc=qvdoc.getproperties QVDOC=ActiveDocument LastReloadedTime Reload_dateI have saved, closed, exited and reopened Qlikview but it will not display my message box created in the macro - any ideas anyone with more experience than myself?
Hi,
Instead of messagebox, you can show last reload time in textbox.
'Last reload on - ' & reloadtime()
Thanks & Regards
Hi,
Instead of messagebox, you can show last reload time in textbox.
'Last reload on - ' & reloadtime()
Thanks & Regards
hi upendra,
do i need to use this 'Last reload on ' & reloadtime() code in expression or i should create macro for this?
i should show the last reload time in textbox, how can i show that?
You can write ='Last Reload On - '& Reloadtime() in text box. it will show you result.
i got it,
thanks for the help
I want to display vRunTime as message box , Kindly let me know how can i do this
LET vStart = num(now());
Store * from tempqvd into tempqvd.qvd (qvd) ;
LET vRunTime = interval(now() - $(vStart),'mm:ss');
HI Srinivasan,
I would recommend using a simple Text Object with the run time in. If you want a dialog box that you click to close you could make the Text Object conditional and have an action which on click changes a variable to make the text box disappear (see my blog post on buttons http://www.quickintelligence.co.uk/qlikview-buttons/ ).
Personally though, I have variables I set in every load script then the following in a text object at the foot of the first tab of every document:
='Last load date: ' & date(vLastLoadStart, 'DD MMM YYYY hh:mm:ss') & '
Load duration: ' & date(vLastLoadEnd - vLastLoadStart, 'hh:mm:ss') & '
Number of Rows: ' & num(vNoOfRows, '#,##0') & '
Version Number: ' & num(vVersionNumber, '#,##0.00')
Typically this is in a small font in a light colour, but if someone wants to find that information it is there.
Regards,
Steve
Hi Steve,
How do you define your variables (vLastLoadStart, vLastLoadEnd, vNoOfRows and vVersionNumber) in your script?
Regards
Fredrik
Hi Fredrik,
At the start of the script I set these:
let vLastLoadStart = now();
let vNoOfRows = 0;
let vVersionNumber = 0.01;
After each table load I increment this:
let vNoOfRows = vNoOfRows + Alt(NoOfRows('Bridge'), 0);
And then and the end I set the final variable:
let vLastLoadEnd = now();
That populates everything that is required for the text box I referenced above.
-Steve
Thank you Steve.
Your solution with the reload time is very useful for me.
Regards
Fredrik