Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, i am left joining load all the qvd files in a specific directory folder to an existing qvw file table called Data. All the joining files contain two fields (LNUM the key and CUPB). I am trying to dynamically rename the CUPB field from each file as the name of the file from which it is imported, but I can not figure out how to pass a variable name to a field label. I keep getting an error that sees the name for the CUPB field as ' '
Binary c:\Data\201305\201305.qvw;
For Each vFileName in FileList ('C:\Data\BalHist\*.qvd')
Let vFName = FileBaseName();
Left Join (Data)
LOAD
LNUM,
CUPB as $(vFName)
From [$(vFileName)](qvd);
NEXT;
Thanks.
Try: LET vFName = subfield('$(vFileName)','\',-1);
Try: LET vFName = subfield('$(vFileName)','\',-1);
Thank you. This returned the name of the file in addition to the .qvd extension. I simple added a take of the characters to the left of the .qvd extension and it work as expected. Thanks again.
vFName = left(subfield('$(vFileName)','\',-1),6)