Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide years data.

     Hello Experts,

I have data from database 2010 -2015. but I want show only last 3 years data. I dont want 2010, 2011 data into my Qlikview dashbords. How to block it and how to take only those two years data backup into SaveQVD_2010.QVD, SaveQVD_2011.QVD.?/

Thanks

12 Replies
oknotsen
Master III
Master III

TempTable:

Load *

From source;

TableA:

noconcatenate

Load *

resident TempTable

where Year = 2010

;

Store TableA into SaveQVD_2010.qvd;

drop table TableA;

TableA:

noconcatenate

Load *

resident TempTable

where Year = 2011

;

Store TableA into SaveQVD_2011.qvd;

drop table TableA;

FinalTable:

noconcatenate

Load *

resident TempTable

where Year > 2011;

drop table TempTable;

----

End result is a table that only contains 2012-2015; why have more data in your data model if you do not want to use it anyway.

I assume it can be done more cool / nice, but this should work.

May you live in interesting times!
maxgro
MVP
MVP

filter the data (years) when you load from the database

with a where clause in the sql section of the load script

oknotsen
Master III
Master III

Wouldn't that require to go to your source multiple times? Once for 2010, once for 2011 and once for the rest?

In my code example he will go to the source once and do the "where" part in QlikView which asks less time of your source and probably is faster.

May you live in interesting times!
maxgro
MVP
MVP

from what I understand he has data in a database from 2010 to 2015 and he wants to show only last 3 years in dashboard (from 2012); so I prefer to read from the db only the years I need (2012-2015) in the dashboard

pseudo code could be

for year in 2012..2015    

     $(year):

     sql select

     from database

     where yearfield = $(year);

     store $(year) into saveqvd_$(year).qvd (qvd);

     drop table $(year);

next;

mukesh24
Partner - Creator III
Partner - Creator III

Hi,

When u r loading QVD into dashboard simply filter data on Year.

oknotsen
Master III
Master III

He is not loading from QVD, he loading from Database.

Even if he was loading from QVD and does not want 2010 and 2011 in his application, filtering on it is not a structural solution as filters get cleared and the data is still in the system.

May you live in interesting times!
mukesh24
Partner - Creator III
Partner - Creator III

Hi Onno,

  In Finance module u need whole data for calculation purpose.

For example Open item calculation.

Regards,

Mukesh Chaudhari

oknotsen
Master III
Master III

That might be in your situation, but San Reddy made clear he only wants 2012-2015 data in his application.

In other words:

What you are saying might be true for you, but is irrelevant for this specific situation.

May you live in interesting times!
mukesh24
Partner - Creator III
Partner - Creator III

Hi Onno,

what u r saying might be right but as per his sentence he did not want Data in Dashboard.