Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to create a script that loads xlsx file each day if the file exists. If not, just skip for that date.
I get an error message on vFileExsist variable (see below). I assume that an issue is because I am trying to load from lib: which is not the correct path for this case.
SET vFileName='lib://Geo/SPGI_$(vToday).xlsx';
Let vFileExsist=if(FileSize($(vFileName))>0,-1,0); // error ( The following error occurred:Unexpected token: 'Metrics', expected one of: ',', ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', ...
if $(vFileExsist) then
For_Upload:
NoConcatenate
LOAD
PO_ID as PO_ID_FOR_UPDATE,
FINAL_RCA as FINAL_RCA_FOR_UPDATE,
"Comment"
FROM [lib://Geo/SPGI_$(vToday).xlsx]
(ooxml, embedded labels, table is in)
where isnull(FINAL_RCA)<>0;
Thanks in advance for help.
Hi,
You can try:
Let vFileExsist=if(FileSize('$(vFileName)')>0,-1,0);
Hi,
You can try:
Let vFileExsist=if(FileSize('$(vFileName)')>0,-1,0);
Hi,
you can use the following expression to check if the file exists:
Apparently this worked fine 🙂