Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
filter the data (years) when you load from the database
with a where clause in the sql section of the load script
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.
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;
Hi,
When u r loading QVD into dashboard simply filter data on Year.
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.
Hi Onno,
In Finance module u need whole data for calculation purpose.
For example Open item calculation.
Regards,
Mukesh Chaudhari
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.
Hi Onno,
what u r saying might be right but as per his sentence he did not want Data in Dashboard.