<?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: Customer Days Calculation Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161092#M378532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The day calls are slightly off in some months&lt;DEL&gt;I wonder if this is because we need to add 1 to certain calculations. I could live with minor variances like that for sake of simplicity, but this approach turns a 7 rows into over 480 rows and doubles the fields&lt;/DEL&gt;this will make my data set too large to manage without my getting large hardware upgrade.  Was hoping for something a little more dynamic and not tied to a month (i.e. week or day).  I can appreciate how a dynamic function could affect app performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am basically substituting cancel date for expiration date (if cancel date exists), checking if contract was effective in the period, and returning the days in period, unless it became effective within period or ended within period, then modifying calculation of days accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to meet in middle so days calc can work for any time dimension and without creating an enormous table? Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Aug 2016 17:11:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-26T17:11:10Z</dc:date>
    <item>
      <title>Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161088#M378528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any ideas on how to approach calculation of customer days with in a period such as monthly, like below.&amp;nbsp; I need to calc customer days for cancel rate calculation and having trouble thinking through this one.&amp;nbsp; The concept is simple, but this one over my head at this point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Cust Days.bmp" class="jive-image image-1" src="/legacyfs/online/135371_Cust Days.bmp" style="height: 177px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 05:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161088#M378528</guid>
      <dc:creator />
      <dc:date>2016-08-24T05:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161089#M378529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, you may want to restructure the data first and then create the straight table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raw:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cust#, Contract Effective Date, Contract Expiration Date, Contract Cancel Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 1/1/2016, 31/12/2016,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 15/2/2016, 14/2/2017, 6/5/2016&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3, 5/3/2016, 5/3/2017,&lt;/P&gt;&lt;P&gt;&amp;nbsp; 4, 4/4/2016, 4/4/2017,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 25/4/2016, 25/4/2017,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, 10/5/2016, 10/5/2017,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, 15/5/2016, 15/5/2017, 20/5/2016&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;if([Contract Cancel Date]='',[Contract Expiration Date],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([Contract Expiration Date]&amp;lt;[Contract Cancel Date],[Contract Expiration Date],[Contract Cancel Date])) as EndDate,&lt;/P&gt;&lt;P&gt;[Contract Effective Date] as StartDate&lt;/P&gt;&lt;P&gt;Resident Raw;&lt;/P&gt;&lt;P&gt;! ! !&lt;/P&gt;&lt;P&gt;FOR i=1 to NoOfRows('Data')&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET startM=NUM(month(FieldValue('StartDate',$(i))));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET endM=num(month(FieldValue('EndDate',$(i))));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET startY=num(year(FieldValue('StartDate',$(i))));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET endY=num(year(FieldValue('EndDate',$(i))));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET startD=num(day(FieldValue('StartDate',$(i))));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET endD=num(day(FieldValue('EndDate',$(i))));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET MD = 12*($(endY)-$(startY))+($(endM)-$(startM))+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET CusValue = FieldValue('Cust#',$(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; for j = 1 to $(MD)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ModifiedData:&lt;/P&gt;&lt;P&gt;&amp;nbsp; load&lt;/P&gt;&lt;P&gt;&amp;nbsp; $(CusValue) as Cust#_N,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(j)=1,date(makedate($(startY),$(startM),$(startD))),date(monthstart(addmonths(makedate($(startY),$(startM),$(startD)),$(j)-1)))) AS StartDate_N,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(j)=$(MD),date(makedate($(endY),$(endM),$(endD))),date(monthend(addmonths(makedate($(startY),$(startM),$(startD)),$(j)-1)))) as EndDate_N,&lt;/P&gt;&lt;P&gt;&amp;nbsp; num(&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(j)=$(MD),makedate($(endY),$(endM),$(endD)),monthend(addmonths(makedate($(startY),$(startM),$(startD)),$(j)-1))) -&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(j)=1,makedate($(startY),$(startM),$(startD)),monthstart(addmonths(makedate($(startY),$(startM),$(startD)),$(j)-1)))&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,'#0') as #Days,&lt;/P&gt;&lt;P&gt;&amp;nbsp; monthname(if($(j)=1,makedate($(startY),$(startM),$(startD)),monthstart(addmonths(makedate($(startY),$(startM),$(startD)),$(j)-1)))) as month&lt;/P&gt;&lt;P&gt;&amp;nbsp; AutoGenerate 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; NEXT j;&lt;/P&gt;&lt;P&gt;NEXT i;&lt;/P&gt;&lt;P&gt;!&lt;/P&gt;&lt;P&gt;drop table Raw;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 02:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161089#M378529</guid>
      <dc:creator />
      <dc:date>2016-08-25T02:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161090#M378530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.  I will look at this ASAP—it’s a lot for me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 16:05:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161090#M378530</guid>
      <dc:creator />
      <dc:date>2016-08-25T16:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161091#M378531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post).&lt;/P&gt;&lt;P&gt;If not, please make clear what part of this topic you still need help with &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 16:10:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161091#M378531</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-08-25T16:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161092#M378532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The day calls are slightly off in some months&lt;DEL&gt;I wonder if this is because we need to add 1 to certain calculations. I could live with minor variances like that for sake of simplicity, but this approach turns a 7 rows into over 480 rows and doubles the fields&lt;/DEL&gt;this will make my data set too large to manage without my getting large hardware upgrade.  Was hoping for something a little more dynamic and not tied to a month (i.e. week or day).  I can appreciate how a dynamic function could affect app performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am basically substituting cancel date for expiration date (if cancel date exists), checking if contract was effective in the period, and returning the days in period, unless it became effective within period or ended within period, then modifying calculation of days accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to meet in middle so days calc can work for any time dimension and without creating an enormous table? Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 17:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161092#M378532</guid>
      <dc:creator />
      <dc:date>2016-08-26T17:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161093#M378533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the script given last time, I basically stacked the data, which make it easier to create the straight table. If you do not need to calculate for all months/weeks/days, instead, want to output the result based on single input (1 particular month for example), there is a easier way. May I know what's the end result in mind? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 01:27:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161093#M378533</guid>
      <dc:creator />
      <dc:date>2016-08-29T01:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161094#M378534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will be taking number of cancels over customer days for a cancel rate in a given day, week, month or other custom time dimensions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 14:55:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161094#M378534</guid>
      <dc:creator />
      <dc:date>2016-08-29T14:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161095#M378535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gary, in my opinion, if you want to create a table with time dimension, it is easier to have this dimension as a field in the data source. In current data table, it is easier to calculate customer day by customers, however, not by time dimensions, because time dimension is not part of the data...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 02:03:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161095#M378535</guid>
      <dc:creator />
      <dc:date>2016-08-30T02:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Days Calculation Help</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161096#M378536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx. I don't mean time like minutes/seconds--my terminology could have been more clear.  I mean time periods, like days, weeks, months, quarters, years, etc...  I have more than 2 million customers.  If I use your approach, my 2 million rows turns into 150 million or more, and that just allows for monthly calculation of customer days, when I need to be able to quantify customer days for any given day, week, month or combination of such.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 07:59:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Days-Calculation-Help/m-p/1161096#M378536</guid>
      <dc:creator />
      <dc:date>2016-08-30T07:59:19Z</dc:date>
    </item>
  </channel>
</rss>

