<?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: Daily Report from consolidated data set with date ranges - QV script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1517594#M437134</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;So looking at your script &amp;amp; you data to get the balance to appear against each date between&amp;nbsp;EFF_FROM_DT and&amp;nbsp;EFF_TO_DT you can try using a date data island, although performance wise this can be slow, so depends on what you are doing with the rest of your model.&lt;/P&gt;&lt;P&gt;So in the top (the model with the date data island) you can see no balance for the selected loan on the days before the&amp;nbsp;EFF_FROM_DT using&amp;nbsp;If(Date&amp;lt;=EFF_TO_DT and Date&amp;gt;=EFF_FROM_DT, BALANCE,null()) and can use similar for the other fields/calculations.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20181206_1.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1752iF5A462FDE386655C/image-size/large?v=v2&amp;amp;px=999" role="button" title="20181206_1.png" alt="20181206_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Your calendar code could be as short as;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;date(mindate + IterNo()) AS Date&lt;BR /&gt;WHILE mindate + IterNo() &amp;lt;= maxdate;&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;min(FieldValue('EFF_FROM_DT', recno()))-1 as mindate,&lt;BR /&gt;&amp;nbsp;max(FieldValue('EFF_TO_DT', recno())) as maxdate&lt;BR /&gt;AUTOGENERATE (1);&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 19:10:49 GMT</pubDate>
    <dc:creator>chrismarlow</dc:creator>
    <dc:date>2018-12-06T19:10:49Z</dc:date>
    <item>
      <title>Daily Report from consolidated data set with date ranges - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1515888#M436960</link>
      <description>&lt;P&gt;Hi, i have a need to create a Daily Past Due report that shows percentage of Past Due ($)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not have a daily data set. But the data set contains date fields (FROM Date , TO Date). I am current;y expanding the data set to daily record in the script duplicating the records between the dates. Since I am dealing with large volumes of data I want to see if there is any other way to approach this logic instead of duplicating records at loan level. Thanks&lt;/P&gt;&lt;P&gt;LOAN_HIST:&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;SQL&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;SELECT&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;EFF_FROM_DT,&lt;BR /&gt;EFF_TO_DT,&lt;BR /&gt;BALANCE,&lt;BR /&gt;substring(BRACCT,11,8) as LOAN_NBR,&lt;BR /&gt;DAYSPASTDUE,&lt;BR /&gt;PASTDUE,&lt;BR /&gt;CATEGORY&lt;BR /&gt;FROM PSAPROD.PSADDS."SHF_DLY_CORE_HSTRY" where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;(EFF_FROM_DT &amp;gt;=TO_DATE('01-NOV-18','DD-MON-YY') and EFF_FROM_DT &amp;lt;=TO_DATE('26-NOV-18','DD-MON-YY'))&lt;BR /&gt;or&lt;BR /&gt;(EFF_TO_DT &amp;gt;=TO_DATE('01-NOV-18','DD-MON-YY') and EFF_TO_DT &amp;lt;=TO_DATE('26-NOV-18','DD-MON-YY'))&lt;BR /&gt;or&lt;BR /&gt;(EFF_TO_DT &amp;gt;=TO_DATE('31-DEC-9999','DD-MON-YYYY'))&lt;BR /&gt;order by LOAN_NBR,EFF_FROM_DT;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;LOAN_HIST2:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;*,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Date(EFF_FROM_DT + IterNo() - 1) As Date&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;While EFF_FROM_DT + IterNo() - 1 &amp;lt;= EFF_TO_DT2&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;*,&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;FONT color="#993300"&gt;&lt;STRONG&gt;EFF_TO_DT&lt;/STRONG&gt;&lt;/FONT&gt;='12/31/9999',&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;if&lt;/FONT&gt;&lt;/STRONG&gt;(&lt;STRONG&gt;&lt;FONT color="#993300"&gt;BALANCE&lt;/FONT&gt;&lt;/STRONG&gt;=0,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#993300"&gt;EFF_FROM_DT&lt;/FONT&gt;&lt;/STRONG&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;today&lt;/STRONG&gt;&lt;/FONT&gt;())),&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;if&lt;/FONT&gt;&lt;/STRONG&gt;(&lt;STRONG&gt;&lt;FONT color="#993300"&gt;BALANCE&lt;/FONT&gt;&lt;/STRONG&gt;=0,&lt;STRONG&gt;&lt;FONT color="#993300"&gt;EFF_FROM_DT&lt;/FONT&gt;&lt;/STRONG&gt;,&lt;STRONG&gt;&lt;FONT color="#993300"&gt;EFF_TO_DT&lt;/FONT&gt;&lt;/STRONG&gt;))&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;as&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;EFF_TO_DT2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Resident&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;LOAN_HIST&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;order&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;by&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#993300"&gt;&lt;STRONG&gt;LOAN_NBR&lt;/STRONG&gt;&lt;/FONT&gt;,&lt;FONT color="#993300"&gt;&lt;STRONG&gt;EFF_FROM_DT&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;drop table&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;LOAN_HIST;&lt;/P&gt;&lt;P&gt;LOAN_HIST3:&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;load&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;*,&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;day&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;&lt;FONT color="#993300"&gt;Date&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#800000"&gt;DayOfMonth&lt;/FONT&gt;&lt;/STRONG&gt;,&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;monthstart&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;&lt;FONT color="#800000"&gt;Date&lt;/FONT&gt;&lt;/STRONG&gt;), 'MMM-YY')&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;as&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#800000"&gt;MonthYear&lt;/FONT&gt;&lt;/STRONG&gt;,&lt;BR /&gt;((&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;year&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;&lt;FONT color="#800000"&gt;Date&lt;/FONT&gt;&lt;/STRONG&gt;)*12)+&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;month&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;&lt;FONT color="#800000"&gt;Date&lt;/FONT&gt;&lt;/STRONG&gt;)) - (((&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;year&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;&lt;FONT color="#800000"&gt;PASTDUE&lt;/FONT&gt;&lt;/STRONG&gt;)*12)+&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;month&lt;/STRONG&gt;&lt;/FONT&gt;(&lt;STRONG&gt;&lt;FONT color="#800000"&gt;PASTDUE&lt;/FONT&gt;&lt;/STRONG&gt;)))&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;as&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#800000"&gt;MonthDiff&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;resident&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;LOAN_HIST2;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;drop&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;table&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;LOAN_HIST2;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 19:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1515888#M436960</guid>
      <dc:creator>phoenix</dc:creator>
      <dc:date>2018-12-04T19:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Report from consolidated data set with date ranges - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516236#M436985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you share some (made up) sample data &amp;amp; how you would like it to behave when you make selections (so assuming by creating daily data you want to be able to get a snapshot at any point in time of past due percentage?).&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 13:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516236#M436985</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-12-04T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Report from consolidated data set with date ranges - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516276#M436989</link>
      <description>&lt;P&gt;I have attached sample qvw to the discussion. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 14:13:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516276#M436989</guid>
      <dc:creator>phoenix</dc:creator>
      <dc:date>2018-12-04T14:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Report from consolidated data set with date ranges - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516407#M437021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am on personal edition so cannot open. If you pop some made up examples/samples of the data from your input columns;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EFF_FROM_DT,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EFF_TO_DT,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;BALANCE,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;substring(BRACCT,11,8) as LOAN_NBR,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DAYSPASTDUE,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PASTDUE,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CATEGORY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Into a spreadsheet I am happy to take a look.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chris.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 17:11:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516407#M437021</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-12-04T17:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Report from consolidated data set with date ranges - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516465#M437025</link>
      <description>&lt;P&gt;Attached Test_Data.xls to the post. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 19:51:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1516465#M437025</guid>
      <dc:creator>phoenix</dc:creator>
      <dc:date>2018-12-04T19:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Daily Report from consolidated data set with date ranges - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1517594#M437134</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;So looking at your script &amp;amp; you data to get the balance to appear against each date between&amp;nbsp;EFF_FROM_DT and&amp;nbsp;EFF_TO_DT you can try using a date data island, although performance wise this can be slow, so depends on what you are doing with the rest of your model.&lt;/P&gt;&lt;P&gt;So in the top (the model with the date data island) you can see no balance for the selected loan on the days before the&amp;nbsp;EFF_FROM_DT using&amp;nbsp;If(Date&amp;lt;=EFF_TO_DT and Date&amp;gt;=EFF_FROM_DT, BALANCE,null()) and can use similar for the other fields/calculations.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="20181206_1.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1752iF5A462FDE386655C/image-size/large?v=v2&amp;amp;px=999" role="button" title="20181206_1.png" alt="20181206_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Your calendar code could be as short as;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;date(mindate + IterNo()) AS Date&lt;BR /&gt;WHILE mindate + IterNo() &amp;lt;= maxdate;&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp;min(FieldValue('EFF_FROM_DT', recno()))-1 as mindate,&lt;BR /&gt;&amp;nbsp;max(FieldValue('EFF_TO_DT', recno())) as maxdate&lt;BR /&gt;AUTOGENERATE (1);&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 19:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Daily-Report-from-consolidated-data-set-with-date-ranges-QV/m-p/1517594#M437134</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-12-06T19:10:49Z</dc:date>
    </item>
  </channel>
</rss>

