Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am using below script for getting the qvd's updated time but in my path there are n-numbers of qvds are there I want some specific qvds date n time I have tried to add below code but its not working?
L
Let vQVDPath = '....\qvd';
A:
LOAD QVD_NAMES AS QVDTableName
FROM
[QVD_List.xlsx]
(ooxml, embedded labels, table is Sheet1);
For Each File in FileList(vQVDPath& '\*.qvd')
B:
Load
FileName() as TableName
,FileTime() as FileCreateTime
,QvdCreateTime('$(File)') as QVDCreateTime
,SubField(SubField('$(File)','\',-1),'.',1) as QVDTableName
From [$(File)] (qvd);
Next File
Regards,
KK
Let vQVDPath = '....\qvd'; is this line correct?
Should it be Let vQVDPath = '..\qvd'; or Let vQVDPath = '..\..\qvd';
Try adding trace commands to see if your variables are being created correctly, and enable the document log
Also add $() around vQVDPath to force the variable to be evaluated.
trace FilePath is [$(vQVDPath) & '\*.qvd')] ;
For Each File in FileList($(vQVDPath) & '\*.qvd')
trace File is [$(File)] ;
B:
Load
FileName() as TableName
,FileTime() as FileCreateTime
,QvdCreateTime('$(File)') as QVDCreateTime
,SubField(SubField('$(File)','\',-1),'.',1) as QVDTableName
From [$(File)] (qvd);
Next File
Colin Thanks for your reply but my concern is for exists clause use with in line file.
Do you need only the info of the files from your Excel-List? Then the second part is misleading.
Try (aircode):
FOR i = 0 TO NOOFROWS('A') -1
LET sFile = PEEK('QVDTableName', i, 'A');
TableInfo:
LOAD
FILENAME('$(sFile)') AS TableName,
FILETIME('$(sFile)') AS FileCreateTime,
..... etc
NEXT i
Hi Peter,
have tried ur code also but after that excel code is not getting executed
A:
LOAD QVD_NAMES
FROM
[\.....\QVD_List.xlsx]
(ooxml, embedded labels, table is Sheet1);
FOR i = 0 TO NOOFROWS('A') -1
LET sFile = PEEK('QVDTableName', i, 'A');
TableInfo:
LOAD
FILENAME('$(sFile)') AS TableName,
FILETIME('$(sFile)') AS FileCreateTime;
NEXT i
What is not working?
Does the Excel have complete pathnames?
Also the PEEK has to refer to the name in the Excel, i.e. QVD_NAMES
how values look like in QVD_NAMES excel file.. is it Qvdname.qvd or just Qvdname?
You refer to "exists" and "inline" in your reply, but your example script does not use a "Where exists" clause nor an inline load. Can you clarify?
Have you tried stepping through your load script using Debug mode?
This would help as it would expand each line to show how the variables re being expanded and would identify which line of the script is erroring.
Can you then come back with any specific errors rather than simply saying "it is not working".
Which line is erroring?
Does the vQVDPath variable hold the expected value?
Does the File variable hold the correct filenames?
Are the fields QVDCreateTime, QVDTableName etc. holding valid data?
I had missed path sorry