Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to read through multiple qvd files and checking the max value of a particular date field.
sub Member(Filename)
if FileSize(Filename) > 0 then
TempTable:
LOAD *
FROM [$(Filename)](qvd);
AutoNumberQVDDate:
LOAD DISTINCT QVDDate
Resident TempTable;
AutoNumber1:
LOAD max(QVDDate) AS Key
Resident AutoNumberQVDDate;
let maxDate = PEEK('Key',0,'AutoNumber1');
endif
but some qvd files do not have QVDDate in them and have some other date like dss_create_date, so I modified my code to below:
sub Member(Filename)
if FileSize(Filename) > 0 then
TempTable:
LOAD *
FROM [$(Filename)](qvd);
AutoNumberQVDDate:
LOAD DISTINCT QVDDate
Resident TempTable;
AutoNumber1:
LOAD max(QVDDate) AS Key
Resident AutoNumberQVDDate;
let maxDate = PEEK('Key',0,'AutoNumber1');
If (IsNull(maxDate)) then
AutoNumberQVDDate:
LOAD DISTINCT dss_create_date
Resident TempTable;
AutoNumber1:
LOAD max(dss_create_date) AS Key
Resident AutoNumberQVDDate;
endif
I am getting error "File not found table not found", how do I make it work, short of writing seperate functions for each date value.
May be you can use ErrorMode variable. If it set to zero, the errors will be muted. Once the process done, set it back to 1.
Here is a Help link related to what Saran mentioned:
Regards,
Brett