Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

Preserve the Reload time

Hello All,

I have a condition in which I want to preserve the reload time , so that when the application runs again it show the last reload time.

I am attaching the sample application in which the reload time should preserve on the basis of the variable value.

Thanks in advance

Ferha Sharma

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

The red color highlighted text in below expression is a variable which was created by me i.e Last reload date and time will perform as an ARRAY function.

Let vReloadTime = Left(Date(Now(1),'MM/DD/YYYY hh:mm:ss TT') & '|' & vReloadTime,45);


The below part is to capture the application reload time. You may ask why I am using 1 in the now function. You should check the help file for the reason.

Capture.PNG

Date(Now(1),'MM/DD/YYYY hh:mm:ss TT') - Latest reload time


In the below step, I am concatenating the latest reload time with previously stored variable values (Date & Time).


Date(Now(1),'MM/DD/YYYY hh:mm:ss TT') & '|' & vReloadTime


You can test the expression like below.


Capture.PNG

Capture.PNG

As you can see, whenever you run the application the reload time will be concatenated and stored in a variable. In your case, you need to display last two reload times. So we can exclude rest of the reload times and keep only last two reload times.

For that I have manually hard coded second pipe symbol position which is 45. Hope you aware about left function.

Capture.PNG

So whenever you reload only the last two reload times will be stored and old ones will be excluded.

Capture.PNG

To display the reload times seperately in front end, I have used subfield function.

Capture.PNG

Did you reload the application and check the "Last Refresh" and "Previous Refresh" time? This is working fine as per your question.

View solution in original post

16 Replies
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Or I would say that I want to preserve the reload time even after the next reload.

olivierrobin
Specialist III
Specialist III

hello

why don't you store it in a csv file ? (use STORE after you LOAD)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What is not working in the sample you posted?

-Rob

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Rob in the sample the condition is working but my issue is I have to store reload time for 2 tasks of the same application so for the 2nd time when application runs again it refresh the reload time for 1st task also and I want to preserve it to use it in front end of the application .

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Oliver yes I could do it but I have 2 tasks for the same application and they run one after the other so when application reload 2nd time first reload time also refresh.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The ReloadTime() function returns the time of the last completed reload. So if you want to display in the UI the last two reloads you can do so like this:

1. In your script. set a variable or load a field to ReloadTime().

2. In the UI display both this variable and ReloadTime() -- which gets reset when the load finishes.

In the script:

LET vLastReload = ReloadTime();

In the UI:

='Last Reload: ' & ReloadTime() & ", Previous Reload: " &vLastReload

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Thanks for your reply Rob , I understood your point but the variable vLastreload also get refresh when we reload the application again so how  should I stop vLastreload to refresh in the second reload.

Gysbert_Wassenaar

Can you explain under which conditions the reloadtime should be refreshed and when it shouldn't be, but keep the value of the previous reload?


talk is cheap, supply exceeds demand
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Hi Gysbert,

I have to develop an application which shows applications and there corresponding reload times but the issue in this is one application gets reloaded twice or thrice through qmc and I have to show both reload times for both the tasks  for same application so now the problem is when the same application gets reloaded 2nd time the last reload time also gets refreshed so I want to stop 1st reload time to refresh when 2nd reload happen.