<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how I can create a variable connection?. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/how-I-can-create-a-variable-connection/m-p/1825855#M67896</link>
    <description>&lt;P&gt;Hi to read all files from a estructure you can use a code like the example 2 of this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/For%20Each.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/For%20Each.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Keeping you strategy you can use nested for's, like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Sat, 31 Jul 2021 07:19:26 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2021-07-31T07:19:26Z</dc:date>
    <item>
      <title>how I can create a variable connection?.</title>
      <link>https://community.qlik.com/t5/App-Development/how-I-can-create-a-variable-connection/m-p/1825847#M67891</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I need help. how I can create a variable connection?.&lt;BR /&gt;It's a data source build everyday by a bot.&lt;/P&gt;&lt;P&gt;These folders are with this structure:&lt;/P&gt;&lt;P&gt;$Year/$Month/$Day/archivo_$Year_$Month_$Day.xls&lt;/P&gt;&lt;P&gt;(Month ='00')&lt;BR /&gt;(Day='00')&lt;/P&gt;&lt;P&gt;I resolved for $Year with:&lt;/P&gt;&lt;P&gt;"LET vFrom=2020;"&lt;BR /&gt;LET vTo=Year(Today());&lt;/P&gt;&lt;P&gt;For vAño=$(vFrom) to $(vTo) "&lt;/P&gt;&lt;P&gt;But It's'nt working for $Month and $Year&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could anyone help me, please?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 22:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-I-can-create-a-variable-connection/m-p/1825847#M67891</guid>
      <dc:creator>Nayarett</dc:creator>
      <dc:date>2021-07-30T22:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: how I can create a variable connection?.</title>
      <link>https://community.qlik.com/t5/App-Development/how-I-can-create-a-variable-connection/m-p/1825855#M67896</link>
      <description>&lt;P&gt;Hi to read all files from a estructure you can use a code like the example 2 of this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/For%20Each.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/For%20Each.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Keeping you strategy you can use nested for's, like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jul 2021 07:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/how-I-can-create-a-variable-connection/m-p/1825855#M67896</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-31T07:19:26Z</dc:date>
    </item>
  </channel>
</rss>

