Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I display the last reload time when opening a Qlikview doc?



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_date

I 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?





1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Instead of messagebox, you can show last reload time in textbox.

'Last reload on - ' & reloadtime()

Thanks & Regards

View solution in original post

12 Replies
Not applicable
Author

Hi,

Instead of messagebox, you can show last reload time in textbox.

'Last reload on - ' & reloadtime()

Thanks & Regards

udaya_kumar
Specialist
Specialist

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?

vijay_iitkgp
Partner - Specialist
Partner - Specialist

You can write ='Last Reload On - '& Reloadtime() in text box. it will show you result.

udaya_kumar
Specialist
Specialist

i got it,

thanks for the help

Not applicable
Author

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');

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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

http://www.quickintelligence.co.uk/

Not applicable
Author

Hi Steve,

How do you define your variables (vLastLoadStart, vLastLoadEnd, vNoOfRows and vVersionNumber) in your script?

Regards

Fredrik

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Not applicable
Author

Thank you Steve.

Your solution with the reload time is very useful for me.

Regards

Fredrik