Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

Load only the last day's data

Hi!

I have a very heavy qvd document that runs once an hour for about 20 mins, which brings data for several years.

Some of the loads in the document are incremental, and some are full.

My task is to create the same document but it will have to show only the last 24 hours and be reloaded every 10 mins.

What's the way to do this?

Plus what's the way to do this without interrupting the every-hour process (cause the exact same tables will be used in 2 documents)?

13 Replies
tresesco
MVP
MVP

If you have a timstamp field in source file, you can try like:

Let vTime=Now()-Time#(24,'hh');

Load

          *

From <> Where <TimestampFiled> >= '$(vTime)' ;

Note, you have to careful of format of timestamp.

its_anandrjs

You can try also but add a timestamp field in the database

Let vTime24 =  Timestamp(Now()-1);

Load

*

From Location

Where  YourTimestampField >= Timestamp(Now()-1);

Or

Load

*

From Location

Where  YourTimestampField >= $(vTime24);


and schedule the application 24 back and when you can reload the application it gives 24 back data from Now()

linoyel
Specialist
Specialist
Author

OK, thank you for your responses!

One more thing:

Lets say I have a new qvd document that contains 1 tab and it reloads every 20 mins.

Is it possible to add it to another qvd document that reloads every 1 hour?

Meaning that when  the user will open the main document, he'll see one tab updated every 20 mins and all other tabs updated every 1 hour?

tresesco
MVP
MVP

Use the concept of Binay load.

Application1 ->20mins reload

Application2 ->1Hr reload

Application2 should be incorporated in Application1 using binary load.

linoyel
Specialist
Specialist
Author

Thank you!!!

Last question :

When I reload the documents in QMC - they appear in QV desktop --> Open in Server.

But the small document with 1 tab that reloads every 20 mins is only a help document which I'll binary upload into the main one, as you've suggested.

Is there a way to hide the help document from users?

(I know that if I schedule the small doc in Task Scheduler it would solve the issue, but I prefer to have all my docs in the same place and reload them in QMC)

tresesco
MVP
MVP

... feel like crying ! you did not mark mine as correct !

Well, coming to your next question. Yes, you just have to restrict the UI part; don't design it for that.

its_anandrjs

Thanks if you got correct answer from the thread so mark the appropriate answer as Correct or Helpful for members and close the thread. If you have another question then post a thread.

Thanks & Regards

linoyel
Specialist
Specialist
Author

Hahaha sorry

Just didn't know which one of your answers to mark as correct cause there are quite a few

Where should I restrict the UI part?...

tresesco
MVP
MVP

If you use binary load, only the model comes to the new application, not the UI part. And users are not aware of the model. So, design your UI in the new application(may be Help one for your case) to keep the ones from another application.