Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I got this script :
// Set variables for the date range
LET vStartDate = '2020/01/01';
LET vEndDate = '2020/01/03';
// Loop through the date range and create a QVD file for each day
FOR vDate = $(vStartDate) TO $(vEndDate)
LET vDateString = Num(Date#($(vDate),'YYYY/MM/DD'));
SalesData:
LOAD *
FROM [lib://Google_Drive - abcd@gmail.com/Zu3QCj1hfhyB/stocks_$(vDateString).xlsx];
NEXT
MY FILES ARE :
stocks_2020/01/01.xlsx
stocks_2020/01/02.xlsx
stocks_2020/01/03.xlsx
....
I would like load all tables for 1 year day by day. ( I took only 3 day for the moment).
But it returns me no results
Thanks in advance
@siem try below
// Set variables for the date range
LET vStartDate = floor(makedate(2020,01,01)); // year,month,day
LET vEndDate = floor(makedate(2020,01,03));
Data:
LAOD 0 as Tmp
autogenerate 0;
// Loop through the date range and create a QVD file for each day
FOR vDate = $(vStartDate) TO $(vEndDate)
LET vDateString = text(Date('$(vDate)','YYYY/MM/DD'));
concatenate(Data)
LOAD *
FROM [lib://Google_Drive - abcd@gmail.com/Zu3QCj1hfhyB/stocks_$(vDateString).xlsx];
NEXT
drop field Tmp;
@siem try below
// Set variables for the date range
LET vStartDate = floor(makedate(2020,01,01)); // year,month,day
LET vEndDate = floor(makedate(2020,01,03));
Data:
LAOD 0 as Tmp
autogenerate 0;
// Loop through the date range and create a QVD file for each day
FOR vDate = $(vStartDate) TO $(vEndDate)
LET vDateString = text(Date('$(vDate)','YYYY/MM/DD'));
concatenate(Data)
LOAD *
FROM [lib://Google_Drive - abcd@gmail.com/Zu3QCj1hfhyB/stocks_$(vDateString).xlsx];
NEXT
drop field Tmp;
thanks, it works; can you explain me what does floor(makedate) pls ?
@siem makedate function is used to create a date from individual year, month, day value. This makes date value in actual date format. Floor used to convert date to number format using which we can run the loop.