Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using Qlik Sense Business ( Qlik Server).
I have several .csv files in Google Drive and need just to load the LAST LOADED or MODIFIED file in Google Drive.
I am tryed to do the following but I am getting an error.
ERROR
LIB CONNECT TO 'Google_Drive - luisccmm@gmail.com';
SalesFolder: //Here Your getting all the file names that are present in the source folder//
LOAD
// RecNo() AS Records,
FILENAME() AS KEY
FROM [lib://Google_Drive - luisccmm@gmail.com/1LEHzEv6dSDSWXWPtcHn5c2_XSDVWMDsA7/*.CSV]
(txt, utf8, embedded labels, delimiter is ',', msq);
MAX_FILE: // Using resident your loading only the file that has minimum Timestamp//
LOAD
Minstring(KEY) AS MAX_FILE
RESIDENT SalesFolder;
LET vMaxFile=peek('MAX_FILE','-1','MAX_FILE'); // Storing that (maxfile/min File) in a variable//
DROP TABLE SalesFolder;
SalesFolderWithMaxDate: // loading only the file that has max timestamp from the source folder//
lOAD
ClientID,
BillingID,
SalesmanID,
Salesman,
OrderID,
ServiceID,
Service,
SalesDate,
OrderDate,
InstallDate,
ChurnDate,
DisconnectDate,
NullDate,
ZipCode,
Network,
BuildingID,
PisoPortaID,
Address,
Escalera,
Piso,
Porta,
OldServiceID,
OldService,
"Type",
Campaign,
AddressActivationDate,
OrderedThrough,
estado_finca,
churn_reason,
cancel_reason,
InterestID
FROM
[lib://Google_Drive - luisccmm@gmail.com/1LEHzEv6dSDSWXWPtcHn5c2_XSDVWMDsA7/$(vMaxFile)]
(txt, utf8, embedded labels, delimiter is ',', msq);