<?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 Month do...loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234374#M85802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it very easily without using a loop.&lt;/P&gt;&lt;P&gt;Create a table with Every month of the year (Could be more if you want ).&lt;/P&gt;&lt;P&gt;Left Join to the current table 9so every Customer has 12 rows or more (Cartesian Join ).&lt;/P&gt;&lt;P&gt;Divide the Value by 12 to get the monthly value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try on similar lines. You do not need a for loop in any case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Nov 2009 20:00:46 GMT</pubDate>
    <dc:creator>vidyut</dc:creator>
    <dc:date>2009-11-06T20:00:46Z</dc:date>
    <item>
      <title>Month do...loop</title>
      <link>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234373#M85801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, New user here! I have a table which lists:&lt;/P&gt;&lt;P&gt;Customer, Contract value (year), start-up date of contract.&lt;/P&gt;&lt;P&gt;I want a script so that I can create a new table to split from annual contract value to contract value per month. (It needs to be script so that I can use the table for further analysis)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG.&lt;/P&gt;&lt;P&gt;Current Table:&lt;/P&gt;&lt;P&gt;Customer A, $120000, 1Jan2010.&lt;/P&gt;&lt;P&gt;Customer B, $480, 1Mar2010.&lt;/P&gt;&lt;P&gt;Desired Table:&lt;/P&gt;&lt;P&gt;Customer A, $10000, 1Jan2010&lt;/P&gt;&lt;P&gt;CustomerA, $10000, 1Feb2010&lt;/P&gt;&lt;P&gt;CustomerA, $10000, 1Mar2010&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Customer B, $40, 1Mar2010&lt;/P&gt;&lt;P&gt;Customer B, $40, 1Apr2010&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;Customers have different contract start up dates&lt;/P&gt;&lt;P&gt;I think it should be possible through a do...loop, but can't seem to get the code correct. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 18:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234373#M85801</guid>
      <dc:creator />
      <dc:date>2009-11-06T18:56:27Z</dc:date>
    </item>
    <item>
      <title>Month do...loop</title>
      <link>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234374#M85802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it very easily without using a loop.&lt;/P&gt;&lt;P&gt;Create a table with Every month of the year (Could be more if you want ).&lt;/P&gt;&lt;P&gt;Left Join to the current table 9so every Customer has 12 rows or more (Cartesian Join ).&lt;/P&gt;&lt;P&gt;Divide the Value by 12 to get the monthly value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try on similar lines. You do not need a for loop in any case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 20:00:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234374#M85802</guid>
      <dc:creator>vidyut</dc:creator>
      <dc:date>2009-11-06T20:00:46Z</dc:date>
    </item>
    <item>
      <title>Month do...loop</title>
      <link>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234375#M85803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou for your reply. However I only want the monthly value to show for 12 months.&lt;/P&gt;&lt;P&gt;For example Customer A has a 12 month contract from Jan2010. Therefore they will have a monthly value from Jan2010-Dec2010, but not for January 2011 and later dates.&lt;/P&gt;&lt;P&gt;Customer B will have a monthly value from Mar2010-Feb2011, but not Jan2010, Feb 2010 or Apr2011.&lt;/P&gt;&lt;P&gt;Because customers have different contract start dates I can not see how a simple left join will work, since I then need to specify which 12 months need to have the monthly value and which ones should be blank/0.&lt;/P&gt;&lt;P&gt;I think your example does not take account of the start date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 20:26:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234375#M85803</guid>
      <dc:creator />
      <dc:date>2009-11-06T20:26:41Z</dc:date>
    </item>
    <item>
      <title>Month do...loop</title>
      <link>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234376#M85804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; it does take care of that. Instead of creating a Calendar, you just generate a number say OFFSET=1..12 and do the join. Create a new field NewMonth=OFFSET+CurrentMonth, and that should do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 20:36:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234376#M85804</guid>
      <dc:creator>vidyut</dc:creator>
      <dc:date>2009-11-06T20:36:36Z</dc:date>
    </item>
    <item>
      <title>Month do...loop</title>
      <link>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234377#M85805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, you are right. I have set up an offset column and it works perfectly now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 21:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-do-loop/m-p/234377#M85805</guid>
      <dc:creator />
      <dc:date>2009-11-06T21:03:52Z</dc:date>
    </item>
  </channel>
</rss>

