Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys, I have an Issue.
Every day I store a qvd (to make a daily historic) named 'mkt'&date and everytime I want to load the historic, I just make a load like that: LOAD * From \\...mkt*.qvd(qvd);...
I will have to add a new field, but this field will only exist in the new qvds. I tried to make it, but when I tried to load, it went wrong.
Do you guys know any solutions?
Sincerely, Luiz
Hello Luiz,
The below script will add a new field and replace all your historic qvd's in the same path (Including sub directories). I would suggest (Just to be safe) to take a copy of your qvd's in a separate folder and then try.
Sub ScanFolder(Root)
For each FileExtension in 'qvd'
For each FoundFile in filelist( Root & '\*.' & FileExtension)
HistoricData:
Load *,
'' as NewFieldName
From
'$(FoundFile)' (qvd);
Store HistoricData into '$(FoundFile)' (qvd);
DROP Table HistoricData;
Next FoundFile
Next FileExtension
For each SubDirectory in dirlist( Root & '\*' )
Call ScanFolder(SubDirectory)
Next SubDirectory
End sub
Call ScanFolder('YourFilePath') ;
What was the name of the new file?
Hello Luiz,
The below script will add a new field and replace all your historic qvd's in the same path (Including sub directories). I would suggest (Just to be safe) to take a copy of your qvd's in a separate folder and then try.
Sub ScanFolder(Root)
For each FileExtension in 'qvd'
For each FoundFile in filelist( Root & '\*.' & FileExtension)
HistoricData:
Load *,
'' as NewFieldName
From
'$(FoundFile)' (qvd);
Store HistoricData into '$(FoundFile)' (qvd);
DROP Table HistoricData;
Next FoundFile
Next FileExtension
For each SubDirectory in dirlist( Root & '\*' )
Call ScanFolder(SubDirectory)
Next SubDirectory
End sub
Call ScanFolder('YourFilePath') ;