Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to drop quite some fields from my datamodel and I have listed around 60 fieldnames in an Excel list (colum name: "Name".
Is it possible to drop all these fields in a simple statement using the Excel list?
Thank you,
Chris
Some code for you:
FieldsToRemove:
LOAD
Name
FROM [lib://Data/fields_to_remove.xlsx]
(ooxml, embedded labels, table is Testing);
for i=0 to NoOfRows('FieldsToRemove')-1
let vFieldName=Peek('Name',$(i), 'FieldsToRemove');
drop field "$(vFieldName)";
next i;
drop table FieldsToRemove;
Change path and sheet name accordingly to your needs!