Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi All,
while writting a if statement in script
if file = true then
load * from table
else
"File not saved on Drive"
end if
above gives an error .. please advise
thanks
Hi,
Try this for excel file
SET vFileName='\\10.199.199.199\shared\QAReport.xlsx';
// Set a variable indicating if the file exists or not. -1 is True, 0 is False
LET vFileExists = if(FileSize('$(vFileName)') > 0, -1, 0);
IF $(vFileExists) THEN
Data:
LOAD *
FROM $(vFileName)(ooxml, no labels, table is Sheet1); // Sheet1 is the sheet name in your excel file
ELSE
MsgBox('File Not exists.');
END IF;
Hope this helps you.
Regards,
Jagan.
hi All,
any luck on this request
Hi,
Try like this
SET vFileName='Refund.qvd';
// Set a variable indicating if the file exists or not. -1 is True, 0 is False
LET vFileExists = if(FileSize('$(vFileName)') > 0, -1, 0);
IF $(vFileExists) THEN
Data:
LOAD *
FROM $(vFileName);
ELSE
MsgBox("File Not exists.");
END IF;
Hope this helps you.
Regards,
Jagan.
hi jagan and all,
while using the above solution if the file is present on shared drive or not
vfileExists always give 0 value
please advise
thanks
Hi,
This script is working for me
SET vFileName='\\10.199.199.199\shared\Sales.qvd';
// Set a variable indicating if the file exists or not. -1 is True, 0 is False
LET vFileExists = if(FileSize('$(vFileName)') > 0, -1, 0);
IF $(vFileExists) THEN
Data:
LOAD *
FROM $(vFileName)(qvd);
ELSE
MsgBox('File Not exists.');
END IF;
Hope this helps you.
Regards,
Jagan.
i have xls file will that make a difference
set vFileName='\\........\sales.xls';
Jagan it worked but when i reload and file is not there then msg do not pop ups.
Hi,
Try this for excel file
SET vFileName='\\10.199.199.199\shared\QAReport.xlsx';
// Set a variable indicating if the file exists or not. -1 is True, 0 is False
LET vFileExists = if(FileSize('$(vFileName)') > 0, -1, 0);
IF $(vFileExists) THEN
Data:
LOAD *
FROM $(vFileName)(ooxml, no labels, table is Sheet1); // Sheet1 is the sheet name in your excel file
ELSE
MsgBox('File Not exists.');
END IF;
Hope this helps you.
Regards,
Jagan.
Hi,
I am getting the popup if the file is not available. Can you attach the script.
Regards,
Jagan.
Hi Jegan,
Thank for this ans. It helped me:
Hi,
Try this for excel file
SET vFileName='\\10.199.199.199\shared\QAReport.xlsx';
// Set a variable indicating if the file exists or not. -1 is True, 0 is False
LET vFileExists = if(FileSize('$(vFileName)') > 0, -1, 0);
IF $(vFileExists) THEN
Data:
LOAD *
FROM $(vFileName)(ooxml, no labels, table is Sheet1); // Sheet1 is the sheet name in your excel file
ELSE
MsgBox('File Not exists.');
END IF;