<?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 to use a variable in LOAD statement? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675157#M1262867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tobias, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was helpful but, what if the excel sheet has a column named ProjectName and I want to pull those names. Each row is a different project name which should change to the next name every time I concatenate more to my Table I am creating. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jul 2014 18:09:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-29T18:09:29Z</dc:date>
    <item>
      <title>How to use a variable in LOAD statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675154#M1262859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load all my tables with a variable, so instead of the column names listed after the load statement I just want it to be a variable. That way I can load other tables and keep it running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example (Currently being loaded like this below, with database info and column name being pulled through a variable from a excel file) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple tabs and I Concatenate to MyTableName, and it works fine with using a variable for the database in the connection string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MyTableName:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NameOfFirstColumn as Column1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NameOfSecondColumn as Column2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NameOfThirdColumn as Column3&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NameOfFourthColumn as Column4&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SELECT * FROM blank; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But what I want to do is.. for example &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LET vLoadColumns ()?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MyTableName:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vLoadColumns:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SELECT * FROM blank; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just like the variable for database cycles through the databases I want the data that is pulled after load to be stored in a variable and use that same variable to keep Concatenating MyTableName:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need more clarification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675154#M1262859</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable in LOAD statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675155#M1262862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;List the columnnames and Tablenames in excel and read them into one field using:&lt;BR /&gt;Customer_Columnnames:&lt;/P&gt;&lt;P&gt;Load concat(columnames,',') as Customer_Columnnames&lt;BR /&gt;from ... where Tablename = 'Customer';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then create a variable like this:&lt;/P&gt;&lt;P&gt;let vCustomer_Columnnames = peek('Customer_Columnnames');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use it in load statement like this:&lt;BR /&gt;Customer:&lt;/P&gt;&lt;P&gt;Load $(Customer_Columnnames);&lt;/P&gt;&lt;P&gt;Select....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 15:19:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675155#M1262862</guid>
      <dc:creator>tobias_klett</dc:creator>
      <dc:date>2014-07-29T15:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable in LOAD statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675156#M1262865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need put the $ prefix:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAL:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(IterNo()+$(vMin)-1)&amp;nbsp;&amp;nbsp; as CFecha,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(Date(IterNo()+$(vMin)-1)) as CAño,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date(IterNo()+$(vMin)-1))&amp;nbsp; as CMes,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Week(Date(IterNo()+$(vMin)-1))&amp;nbsp;&amp;nbsp; as CSemana,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekStart(Date(IterNo()+$(vMin)-1)) as CSemIni,&lt;/P&gt;&lt;P&gt;&amp;nbsp; WeekEnd(Date(IterNo()+$(vMin)-1)) as CSemFin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate 1 While IterNo()+$(vMin)-1&amp;lt;=$(vMax);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vMin and vMax are a variable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 15:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675156#M1262865</guid>
      <dc:creator>ecolomer</dc:creator>
      <dc:date>2014-07-29T15:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable in LOAD statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675157#M1262867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tobias, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was helpful but, what if the excel sheet has a column named ProjectName and I want to pull those names. Each row is a different project name which should change to the next name every time I concatenate more to my Table I am creating. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 18:09:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675157#M1262867</guid>
      <dc:creator />
      <dc:date>2014-07-29T18:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable in LOAD statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675158#M1262869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no sure if I get you right, but why not extending the Excel like this.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Variable_Excel.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/63366_Variable_Excel.png" /&gt;&lt;/P&gt;&lt;P&gt;And the script like this.&lt;/P&gt;&lt;P&gt;Customer_Columnnames:&lt;/P&gt;&lt;P&gt;Load concat(columnames,',') as Customer_Columnnames&lt;BR /&gt;from ... where Tablename = 'Customer' and Project ='ProjectXY';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 06:48:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-in-LOAD-statement/m-p/675158#M1262869</guid>
      <dc:creator>tobias_klett</dc:creator>
      <dc:date>2014-07-30T06:48:21Z</dc:date>
    </item>
  </channel>
</rss>

