Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a qvd containing 618,994,678 records. I did the optimized qvd load and now I want to fetch the maximum date from this qvd. what is the best way to do it so that it consumes less time to give the maximum date?
Thank you
Anusha
Try Like below:
Filterdate:
Load
date(Max(DATE_COLUMN),'DD/MM/YYYY') as maxdate
from QVD;
SET vmaxdate=peek('maxdate', 0, 'Filterdate');
Looks like Max(Date) will consume lot of time.
hi,
i use this code for my timeline
Temp:
LOAD num(floor(Max( [newdatefield] ))) as DataMax,
num(floor(Min( [newdatefield] ))) as DataMin;
LOAD FieldValue('yourdatefield', recno()) as [newdatefield]
AUTOGENERATE (FieldValueCount('yourdatefield'));
LET vDataMin = Peek('DataMin',-1,'Temp');
LET vDataMax = Peek('DataMax',-1,'Temp');
it's way faster than simple max() applied on the date field.
hope it helps,
Andrew
temp:
LOAD DATE_COLUMN
FROM
[S00.QVD]
(qvd);
MinMaxDate:
Load min(DATE_COLUMN) as MinDate,
max(DATE_COLUMN) as MaxDate;
Load FieldValue('DATE_COLUMN',IterNo()) as DATE_COLUMN
autogenerate(1)
while not IsNull(FieldValue('DATE_COLUMN',Iterno()));
Drop Table temp;
Anusha, If the goal is to load the QVD file optimized, then do that into a Temp table as the last poster recommended and then run your addtional code against the Temp table and once you have what you need drop the Temp table from the data model. If Victor's post was what you used to solve things, please remember to give credit and let others know things worked by using the Accept as Solution button on the post(s) that helped you get to your solution. If you did something else, consider posting that and then mark it, and if you are still working on things, update the post with where you are with things.
Regards,
Brett
https://qlikviewcookbook.com/2013/09/fastest-method-to-read-maxfield-from-a-qvd/
Temp:
LOAD Max(Date) AS MaxDate FROM 'YourPath.qvd' (qvd);
LET vMaxDate = Num(Peek('MaxDate', 0, 'Temp'));
DROP TABLE Temp;