Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load Rolling 12 months of Data from QVD

Hi,

I have 5 years worth of data in a qvd which is updated monthly.  Is it possible to load only the previous 12 months into my qwv when the qvw is opened?

Many thanks,

Fiorano

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Yes, just adjust the where clause to whatever you need. Maybe something like this:

     where mydate >= addmonths(monthend(today()),-13) and mydate < monthstart(today())

It all depends on what data you have in your qvd and in what format.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Add a where clause to your load statement. Something like this example:

Load * from myqvd.qvd (qvd)

where mydate >=  addmonths(today(),-12)

Note: the above where clause is just an example. You'll have to change it to something that fits your scenarion. You may need to specify a date format  for example.

Also, it sounds like you want to trigger a reload on opening the document. You can add a reload action to the OnOpen document trigger to do that. But if I remember correctly that trigger won't work if your document is deployed on Qlikview Server.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi,

Thanks for  your reply! Actually, is it possible to show 'whole' months.  Eg, if I were to refresh the qvw now it would show January-2012 to January-2013?  And if I were to refresh the document in March, it would show Feb-Feb?

Not sure if it helps - nut I have a month number field (1-12) and a financial year field 2011/12, 2012/13

Many thanks again for your time.

Fiorano

Gysbert_Wassenaar

Yes, just adjust the where clause to whatever you need. Maybe something like this:

     where mydate >= addmonths(monthend(today()),-13) and mydate < monthstart(today())

It all depends on what data you have in your qvd and in what format.


talk is cheap, supply exceeds demand
Not applicable
Author

Many thanks!

Fiorano

Not applicable
Author

Hi,

Rather than restrict the data load to a rolling 12 months, I need to display the previous 12 month when the document loads (this way all the data is available - should the user need to see it).  Can this be done relatively easily?

Many thanks again for your time.

Fiorano