<?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 For Loop with two variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573413#M598718</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;i'm trying to figure out, how to code a for loop in Qlikview that is iterating throught two variables at the same time (no nested for Loop)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imagine the code to work like this:&lt;/P&gt;&lt;P&gt;for each vNumber,vLetter in ((1,2,3,4),(A,B,C,D))&lt;/P&gt;&lt;P&gt;trace$(vNumber);&lt;/P&gt;&lt;P&gt;trace$(vLetter);&lt;/P&gt;&lt;P&gt;Next;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired Output would be:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;smbeholl&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2019 15:40:31 GMT</pubDate>
    <dc:creator>BHoll</dc:creator>
    <dc:date>2019-04-25T15:40:31Z</dc:date>
    <item>
      <title>For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573413#M598718</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;i'm trying to figure out, how to code a for loop in Qlikview that is iterating throught two variables at the same time (no nested for Loop)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imagine the code to work like this:&lt;/P&gt;&lt;P&gt;for each vNumber,vLetter in ((1,2,3,4),(A,B,C,D))&lt;/P&gt;&lt;P&gt;trace$(vNumber);&lt;/P&gt;&lt;P&gt;trace$(vLetter);&lt;/P&gt;&lt;P&gt;Next;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired Output would be:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;smbeholl&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 15:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573413#M598718</guid>
      <dc:creator>BHoll</dc:creator>
      <dc:date>2019-04-25T15:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573428#M598719</link>
      <description>&lt;P&gt;Will you always have the same number of items in vNumber and vLetter? and how are they two linked together? the order of their listing?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 16:10:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573428#M598719</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-25T16:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573560#M598720</link>
      <description>You would need to create two loops to accomplish this. One per variable.&lt;BR /&gt;&lt;BR /&gt;for each vNumber in 1,2,3,4&lt;BR /&gt;for each vLetter in 'A', 'B', 'C','D'&lt;BR /&gt;trace$(vNumber);&lt;BR /&gt;trace$(vLetter);&lt;BR /&gt;Next;&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Apr 2019 04:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573560#M598720</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-26T04:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573598#M598721</link>
      <description>&lt;P&gt;I'll always have the same number of items in vNumber and vLetter. Not sure if i'm getting the second part of you question right, but like in my opening post, both variables should take the first value of their list first, then the second and so on.&lt;/P&gt;&lt;P&gt;thanks for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 06:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573598#M598721</guid>
      <dc:creator>BHoll</dc:creator>
      <dc:date>2019-04-26T06:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573605#M598722</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;You would need to create two loops to accomplish this. One per variable.&lt;BR /&gt;&lt;BR /&gt;for each vNumber in 1,2,3,4&lt;BR /&gt;for each vLetter in 'A', 'B', 'C','D'&lt;BR /&gt;trace$(vNumber);&lt;BR /&gt;trace$(vLetter);&lt;BR /&gt;Next;&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is a nested for loop and will give me the following output:&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 06:57:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573605#M598722</guid>
      <dc:creator>BHoll</dc:creator>
      <dc:date>2019-04-26T06:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573614#M598723</link>
      <description>If you are able to combine the two into one value using | as separator then&lt;BR /&gt;you could do this.&lt;BR /&gt;&lt;BR /&gt;FOR EACH vLetterNumber IN 'A|1', 'B|2', 'C|3','D|4'&lt;BR /&gt;LET vNumber=subfield('$(vLetterNumber)','|',2);&lt;BR /&gt;trace $(vNumber);&lt;BR /&gt;LET vLetter=subfield('$(vLetterNumber)','|',1);&lt;BR /&gt;&lt;BR /&gt;trace $(vLetter);&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Apr 2019 07:03:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573614#M598723</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-26T07:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: For Loop with two variables</title>
      <link>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573649#M598724</link>
      <description>&lt;P&gt;Thanks, this is definetly a good work around!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 07:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Loop-with-two-variables/m-p/1573649#M598724</guid>
      <dc:creator>BHoll</dc:creator>
      <dc:date>2019-04-26T07:56:27Z</dc:date>
    </item>
  </channel>
</rss>

