Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have this QlikView and Qlik Sense Enterprise code that checks for a fieldmap file and remaps column names
Is there a way to check if a file exists in a lib on Qlik Sense SAAS? using either the datafile lib or an Amazon S3 lib?
call vL.FileExist ('$(vG.ImportPath)\fieldmap-$(vL.TrimmedDocName).csv'); //Validate if cache exist
if vL.FileExist='true' then
// Remap the fields with descriptive names
[FieldMap$(vL.TrimmedDocName)]:
MAPPING LOAD
ExistingFieldName,
UserFriendlyFieldName
FROM
[$(vG.ImportPath)\fieldmap-$(vL.TrimmedDocName).csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
WHERE len(UserFriendlyFieldName)>0;
RENAME FIELDS USING [FieldMap$(vL.TrimmedDocName)];
endif
Hi @aritting
You can try with the filezise() function
Where you can replace the vPath variable with the data connection and vFile with the file inside the data connection
LET vPath ='lib://Dropbox/Files/';
LET vFileName ='Crostable.xlsx';
If FileSize('$(vPath)$(vFileName)') THEN
TRACE File exists $(vPath)$(vFileName);
Table:
LOAD
Salesman,
"Year",
Jan,
Feb,
Mar,
Apr,
May,
Jun
FROM [$(vPath)$(vFileName)]
(ooxml, embedded labels, table is Sheet1);
Else
TRACE File does not exist $(vPath)$(vFileName);
End If
Does this work in Qlik Cloud? So far in my testing the answer is no.