<?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: Create dates in a range for future cash-flows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10299#M605136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this one too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;Security,&lt;BR /&gt; date( date(NextCoupon)&amp;nbsp; + ( (IterNo()-1)* ((date(MaturityDate)-date(NextCoupon))/CouponFrequency ) )) as test, &lt;BR /&gt; &lt;/P&gt;&lt;P&gt;from a &lt;BR /&gt;While IterNo()-1&amp;lt;=CouponFrequency ;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2018 12:43:30 GMT</pubDate>
    <dc:creator>qliksus</dc:creator>
    <dc:date>2018-06-13T12:43:30Z</dc:date>
    <item>
      <title>Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10291#M605128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all - I am trying to solve a problem which I believe is related to looping through records to generate additional entries in the calendar. My data-set consists of table number 1 below, with one record per product and two date fields that effectively represent start and end dates for the new data shown in table 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to accomplish in table 2 is for each product to create extra date rows that relate to the 'next coupon' date at a frequency determined by the coupon frequency column (number of payments in a year) up to a maximum of the maturity date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example Data&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Security&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Next Coupon&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Coupon Frequency&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Coupon Rate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Maturity Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Nominal Amount&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;US61747YCJ29&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23/09/2018&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5.0%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23/09/2019&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;250,000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;XS0471074582&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;02/12/2018&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2.5%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;02/12/2019&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300,000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table below shows the results I think I need to be able to create a summary chart of the coupon dates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anticipated Result Table&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Security&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Coupon Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;US61747YCJ29&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23/09/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;US61747YCJ29&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;24/03/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;US61747YCJ29&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23/09/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;XS0471074582&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;02/12/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;XS0471074582&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;02/12/2019&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have been able to create a master calendar to link together the maturity date and the next coupon but I think now I need to loop to add the extra rows. I have read a few of the example of this on this site but I cannot see clearly how to apply to this situation. I have attached my working file as far as I got.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for any help or pointers anyone is able to give. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 18:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10291#M605128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-11T18:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10292#M605129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with While clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BONDS:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;Date(AddMonths([Next Coupon], (12/[Coupon Frequency]) * (IterNo()-1))) as [Coupon Date]&lt;/P&gt;&lt;P&gt;While AddMonths([Next Coupon], (12/[Coupon Frequency]) * (IterNo()-1)) &amp;lt;= [Maturity Date];&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Security, Next Coupon, Coupon Frequency, Coupon Rate, Maturity Date, Nominal Amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; US61747YCJ29, 23/09/2018, 2, 5.0%, 23/09/2019, "250,000"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XS0471074582, 02/12/2018, 1, 2.5%, 02/12/2019, "300,000"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 18:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10292#M605129</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-11T18:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10293#M605130</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;one solution might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_304503_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/204850_QlikCommunity_Thread_304503_Pic1.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15287464912906110" jivemacro_uid="_15287464912906110"&gt;
&lt;P&gt;table1:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;LOAD * FROM [&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2061" data-containertype="14" data-objectid="304503" data-objecttype="1" href="https://community.qlik.com/thread/304503"&gt;https://community.qlik.com/thread/304503&lt;/A&gt;&lt;SPAN&gt;] (html, codepage is 1252, embedded labels, table is @1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;table2:&lt;/P&gt;
&lt;P&gt;LOAD Security,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayName([Next Coupon]+365.2425/[Coupon Frequency]*(IterNo()-1)) as [Coupon Date]&lt;/P&gt;
&lt;P&gt;Resident table1&lt;/P&gt;
&lt;P&gt;While DayName([Next Coupon]+365.2425/[Coupon Frequency]*(IterNo()-1)) &amp;lt;= [Maturity Date];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 20:01:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10293#M605130</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2018-06-11T20:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10294#M605131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks once again Sunny - correct answer as always!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That did solve my initial need, I now have one follow up if I may. I used your instructions above to add dates to my master calendar so I have all dates that either principal or coupon are paid on across a list of bonds. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="html" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15287928433826170 jive_text_macro" jivemacro_uid="_15287928433826170" modifiedtitle="true"&gt;
&lt;P&gt;//This is the list of maturity dates&lt;/P&gt;
&lt;P&gt;DateLink:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISIN,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MATURITY as Date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'PRINCIPAL' as DateType&lt;/P&gt;
&lt;P&gt;RESIDENT BONDS;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//This is the list of coupon payment dates&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISIN,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(AddMonths(NEXT_CPN, (12/CPN_FREQ_CD) * (IterNo()-1))) as Date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'COUPON' as DateType&lt;/P&gt;
&lt;P&gt;RESIDENT BONDS&lt;/P&gt;
&lt;P&gt;While AddMonths(NEXT_CPN, (12/CPN_FREQ_CD) * (IterNo()-1)) &amp;lt;= MATURITY;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Call Calendar Generator for field 'date'&lt;/P&gt;
&lt;P&gt;CALL CalendarFromField('Date','CommonCalendar', '');&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I now create a table or a chart for the results, I used the 'DateType' to define principal or coupon and sum the relevant amount (notional or coupon) to get the cash-flows. However, on non-coupon or principal dates there is no value and the chart/pivot provides no result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have unticked 'supress zero values' but this does not make a difference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to create a 'dummy' value in the table for non-coupon or principal dates to force it to recognise those dates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 08:46:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10294#M605131</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T08:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10295#M605132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What expression are you using to calculate principal or coupon in your chart? May be try to add this to your chart and see if this works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;YourExpression + Sum({1} 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 08:54:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10295#M605132</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-12T08:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10296#M605133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - that is a neat little trick and does force the extra dates, although if I then drill down into the results (e.g. select a particular year) then the results table will isolate that year and keep the rest of the records (which are then blank but not of interest, especially if I have 50+ years of dates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The results pivot I am using is Year and Month (from the common calendar) and two expressions, one sum of principal, one sum of coupons. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 09:01:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10296#M605133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T09:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10297#M605134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about if you just do this... assuming you have set analysis or if statement in YourExpression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;YourExpression + Sum(0)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 09:03:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10297#M605134</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-12T09:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10298#M605135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent - thanks Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 09:52:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10298#M605135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T09:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create dates in a range for future cash-flows</title>
      <link>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10299#M605136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this one too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;Security,&lt;BR /&gt; date( date(NextCoupon)&amp;nbsp; + ( (IterNo()-1)* ((date(MaturityDate)-date(NextCoupon))/CouponFrequency ) )) as test, &lt;BR /&gt; &lt;/P&gt;&lt;P&gt;from a &lt;BR /&gt;While IterNo()-1&amp;lt;=CouponFrequency ;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 12:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-dates-in-a-range-for-future-cash-flows/m-p/10299#M605136</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2018-06-13T12:43:30Z</dc:date>
    </item>
  </channel>
</rss>

