Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I need help. how I can create a variable connection?.
It's a data source build everyday by a bot.
These folders are with this structure:
$Year/$Month/$Day/archivo_$Year_$Month_$Day.xls
(Month ='00')
(Day='00')
I resolved for $Year with:
"LET vFrom=2020;"
LET vTo=Year(Today());
For vAño=$(vFrom) to $(vTo) "
But It's'nt working for $Month and $Year
Could anyone help me, please?
Hi to read all files from a estructure you can use a code like the example 2 of this link:
Keeping you strategy you can use nested for's, like:
FOR vAño=$(vFrom) to $(vTo)
FOR vMes=1 to 12
LET vMesCarga=Num(MakeDate($(vAño),$(vMes)));
LET vMaxDia=Day(MonthEnd($(vMesCarga)));
FOR vDia=1 to $(vMaxDia)
LOAD...
From [PathToStructure\$(vAño)\$(vMes)\$(vDia)\archivo_$(vAño)_$(vMes)_$(vDia).xls]
(....)
NEXT
NEXT
NEXT
Executed today this will read from 1/1/2020 to 31/07/2021, it may need some fixes to control files that may not exist, using the first option (the help page example) you can avoid most issues, you can use FileName() to extract year, month and day from xls file name.