Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I ask you a simple question, I just want to load my QVD's without automatic generation of his name, with the fields.
Note: I have not added any manipulation script, it's automatic and it's only on some applicables QVD (tables).
Example:
Case: QVD_Name.NameField
I just want to load my QVD without "BillingDocumentLinesTemp" automatically. Because I tried to rename it ( all fields) with " as " but it still have a different name.
Goal: Only NameField
It's very Urgent, Thanks for your Help!
Hi,
If it's the fields you need to rename, then I would build a mapping table from the QVD Metadata something like this ...
Let removeString='BillingsDocumentsLinesTemp.';
FieldNameMap:
Mapping LOAD
FieldName as OldFieldName,
If(left(FieldName,len('$(removeString)'))='$(removeString)',subfield(FieldName,'$(removeString)',-1)) as NewFieldName
FROM [???.qvd] (XmlSimple, Table is [QvdTableHeader/Fields/QvdFieldHeader]);
Data:
LOAD * FROM
[???.qvd]] (qvd);
Rename Fields using FieldNameMap;
Maybe building a subroutine so you can call it and pass different removeString parameters for other QVDs would suit.
flipside
Hi,
I have tried this and works for me:
After loading the first table (being a QVD or not):
LET QVDNumber = 0;
After Loading every table (being a QVD or not):
LET QVDNumber = $(QVDNumber) +1;
After loading every QVD table:
LET OldName = TableName($(QVDNumber));
LET NewName = subfield(TableName($(QVDNumber)), '.',2);
rename table $(OldName) to $(NewName);
I am sure this code can be more elegant, using the TableNo() function
Hi SALTO,
Yess, I tried to apply your code and it works very well
A lot of Thanks!!
Results: