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?
i use this code for my timeline
LOAD num(floor(Max( [newdatefield] ))) as DataMax,
num(floor(Min( [newdatefield] ))) as DataMin;
LOAD FieldValue('yourdatefield', recno()) as [newdatefield]
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,
Load min(DATE_COLUMN) as MinDate,
max(DATE_COLUMN) as MaxDate;
Load FieldValue('DATE_COLUMN',IterNo()) as DATE_COLUMN
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.
Temp: LOAD Max(Date) AS MaxDate FROM 'YourPath.qvd' (qvd); LET vMaxDate = Num(Peek('MaxDate', 0, 'Temp')); DROP TABLE Temp;