Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have few excel files from which I should be extracting the data.
The excel file name is in the below format.
Test dashboard PKC00002 Health Checks_31May17.xlsx
While extracting data from the file, how do I extract the primary key from the name of the file. In the above example, it would be "PKC0002"
Thanks in advance.
Hi
check below code
LOAD Product_Id,
Product_Line,
Product_Subcategory,
Product_category,
FileBaseName() as FullName,
subfield(FileBaseName(),' ',1) as FirstName
FROM
(biff, embedded labels, table is Sheet1$);
Hi you can try below with your code
a:
LOAD Product_Id,
Product_Line,
Product_Subcategory,
Product_category,
FileBaseName() as new,
subfield(FileBaseName(),' ',1) as x
FROM
(biff, embedded labels, table is Sheet1$);
Hi
check below code
LOAD Product_Id,
Product_Line,
Product_Subcategory,
Product_category,
FileBaseName() as FullName,
subfield(FileBaseName(),' ',1) as FirstName
FROM
(biff, embedded labels, table is Sheet1$);
Use below code in load script
Subfield(FileBaseName(),' ',1)
Thanks Varun
It works Fine.
Is they filenames coming from any external source as field? If so, SubField(FieldName, ' ',1) as FieldName