<?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: Problem in using variable in Loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948497#M959066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You. It works!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2015 01:45:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-09T01:45:38Z</dc:date>
    <item>
      <title>Problem in using variable in Loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948495#M959064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't run this script as it shows as&lt;/P&gt;&lt;P&gt;vMonthLoop =&amp;nbsp; to &lt;/P&gt;&lt;P&gt;in the debugger&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand what's wrong with this,&lt;/P&gt;&lt;P&gt;Can anyone help to fix my script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;let vStartYear = Min(AccidentYear);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;let vEndYear = Max(AccidentYear);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;//*************************Finding the Max Development Month for each Year*********************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;FOR vMonthLoop = $(vStartYear) to $(vEndYear)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;&amp;nbsp; Left Join(CTRNPF)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;&amp;nbsp; LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;&amp;nbsp; max(DevelopmentMonth) AS MaxMonth$(vMonthLoop)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;&amp;nbsp; Resident CTRNPF_Max where AccidentYear=$(vMonthLoop);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 02:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948495#M959064</guid>
      <dc:creator />
      <dc:date>2015-11-06T02:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using variable in Loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948496#M959065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't aggregate field values just like you've done in your vStartYear and vEndYear definitions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to do the aggregations in a LOAD statement, then peek() the values from the table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXT:&lt;/P&gt;&lt;P&gt;LOAD Min(AccidentYear) as Min,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(AccidentYear) asMax&lt;/P&gt;&lt;P&gt;Resident YourTablewithAccidentYear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;let vStartYear = Peek('Min',0,'EXT');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;let vEndYear = Peek('Max',0,'EXT');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'book antiqua', palatino;"&gt;DROP TABLE EXT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Check the variables in script debugger at this point. Both should hold numeric values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 14:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948496#M959065</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-11-06T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using variable in Loop</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948497#M959066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You. It works!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 01:45:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-using-variable-in-Loop/m-p/948497#M959066</guid>
      <dc:creator />
      <dc:date>2015-11-09T01:45:38Z</dc:date>
    </item>
  </channel>
</rss>

