<?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: Iterating through a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789135#M1210410</link>
    <description>&lt;P&gt;Hi marcus_sommer, I am using the script below. I am getting the following errors as commented out in the script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for i = rangesum(substringcount('$(vTagNames)', ','), 1) // getting a semantic error here&lt;BR /&gt;let vField = subfield('$(vTagNames)', ',', $(i));&lt;/P&gt;&lt;P&gt;Table4:&lt;/P&gt;&lt;P&gt;CrossTable(TagName, Data)&lt;/P&gt;&lt;P&gt;LOAD timestamp,&lt;BR /&gt;[$(vField)]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;[Scenario.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;BR /&gt;next // The control statement is not correctly matched with its corresponding start statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 10:20:27 GMT</pubDate>
    <dc:creator>ritvik4BI</dc:creator>
    <dc:date>2021-03-08T10:20:27Z</dc:date>
    <item>
      <title>Iterating through a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789053#M1210399</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a variable vTagName = Alpha,Beta,Gamma&lt;/P&gt;&lt;P&gt;Now, I am loading a table which has the following columns: Timestamp, Alpha, Beta, Gamma, x,y andz. The requirement is that I have to load column Timestamp and only those columns present in&amp;nbsp; the variable. i.e Alpha,Beta and Gamma in this case for which I am using&amp;nbsp; the script the following script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario:&lt;BR /&gt;LOAD timestamp,&lt;BR /&gt;$(vTagNames)&lt;/P&gt;&lt;P&gt;FROM&lt;BR /&gt;[Scenario.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script is working fine but now I have a new requirement to read each TagName in one pass.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e. For the variable vTagNames.. in the first pass script should read Alpha, In the second iteration it should read Beta and in the third pass it should read Gamma and later join all three. How to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 06:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789053#M1210399</guid>
      <dc:creator>ritvik4BI</dc:creator>
      <dc:date>2021-03-08T06:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789107#M1210403</link>
      <description>&lt;P&gt;You could do it by treating the variable-content as array and looping through it, maybe like:&lt;/P&gt;&lt;P&gt;for i = rangesum(substringcount('&lt;SPAN&gt;$(vTagNames)&lt;/SPAN&gt;', ','), 1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;let vField = subfield('&lt;SPAN&gt;$(vTagNames)&lt;/SPAN&gt;', ',', $(i));&lt;BR /&gt;&amp;nbsp; &amp;nbsp;t: load [$(vField)], ... from ...;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 09:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789107#M1210403</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-03-08T09:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789135#M1210410</link>
      <description>&lt;P&gt;Hi marcus_sommer, I am using the script below. I am getting the following errors as commented out in the script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for i = rangesum(substringcount('$(vTagNames)', ','), 1) // getting a semantic error here&lt;BR /&gt;let vField = subfield('$(vTagNames)', ',', $(i));&lt;/P&gt;&lt;P&gt;Table4:&lt;/P&gt;&lt;P&gt;CrossTable(TagName, Data)&lt;/P&gt;&lt;P&gt;LOAD timestamp,&lt;BR /&gt;[$(vField)]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;[Scenario.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;BR /&gt;next // The control statement is not correctly matched with its corresponding start statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 10:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789135#M1210410</guid>
      <dc:creator>ritvik4BI</dc:creator>
      <dc:date>2021-03-08T10:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating through a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789155#M1210412</link>
      <description>&lt;P&gt;Yes, I wasn't carefully enough and forgot to set the start-value, change it to:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for i = &lt;STRONG&gt;1 to&lt;/STRONG&gt; rangesum(substringcount('&lt;/SPAN&gt;&lt;SPAN&gt;$(vTagNames)&lt;/SPAN&gt;&lt;SPAN&gt;', ','), 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;let vField = subfield('&lt;/SPAN&gt;&lt;SPAN&gt;$(vTagNames)&lt;/SPAN&gt;&lt;SPAN&gt;', ',', $(i));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;t: load [$(vField)], ... from ...;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 11:04:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Iterating-through-a-variable/m-p/1789155#M1210412</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-03-08T11:04:33Z</dc:date>
    </item>
  </channel>
</rss>

