<?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 Status in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574795#M479599</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at the attached .qvw file.&amp;nbsp; Make sure to look at the load script as I had to add to use IntervalMatch to add a calendar table to your start and end dates (the synthetic key that IntervalMatch creates is fine, and should be there).&amp;nbsp; The charts should also be calculating what you're looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jan 2014 19:59:43 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2014-01-27T19:59:43Z</dc:date>
    <item>
      <title>Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574794#M479598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table that has the following&lt;/P&gt;&lt;P&gt;Customer ID&lt;/P&gt;&lt;P&gt;Status&lt;/P&gt;&lt;P&gt;Status StartDate&lt;/P&gt;&lt;P&gt;Status EndDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 4 different status categories, Active, On Hold, Pending, Inactive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I create charts that show the average duration that a customer stays in each category, and also a count of customers by status, over time? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 19:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574794#M479598</guid>
      <dc:creator />
      <dc:date>2014-01-27T19:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574795#M479599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at the attached .qvw file.&amp;nbsp; Make sure to look at the load script as I had to add to use IntervalMatch to add a calendar table to your start and end dates (the synthetic key that IntervalMatch creates is fine, and should be there).&amp;nbsp; The charts should also be calculating what you're looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 19:59:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574795#M479599</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-27T19:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574796#M479600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can calculate the duration by subtracting the StartDate from the EndDate. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load CustomerID,&lt;/P&gt;&lt;P&gt;Status,&lt;/P&gt;&lt;P&gt;Status StartDate,&lt;/P&gt;&lt;P&gt;Status EndDate,&lt;/P&gt;&lt;P&gt;interval([Status EndDate] - [Status StartDate],'d') as Duration&lt;/P&gt;&lt;P&gt;From ...mysource...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then create a straight table object in the front end with Customer ID (and Status) as dimension(s) and as expression &lt;EM&gt;avg(Duration)&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For counting customers by status over time you need to create reference dates for each status. See this blog post for an explanation of how to do that: &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/02/12/reference-dates" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;Creating Reference Dates for Intervals&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 20:06:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574796#M479600</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-01-27T20:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574797#M479601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, this is a big help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 19:44:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574797#M479601</guid>
      <dc:creator />
      <dc:date>2014-01-28T19:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574798#M479602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 19:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574798#M479602</guid>
      <dc:creator />
      <dc:date>2014-01-28T19:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574799#M479603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark correct and helpful answers so others can find solutions to their problems too &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 19:49:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574799#M479603</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-28T19:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574800#M479604</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;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I'm using personal edition, I can't open any qvd, can u please post the expression to plot chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 05:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574800#M479604</guid>
      <dc:creator />
      <dc:date>2014-01-31T05:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Customer Status</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574801#M479605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load Script:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer ID, Status, Status StartDate, Status EndDate&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Active, 1/1/2014, 1/7/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, On Hold, 1/8/2014, 1/10/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Pending, 1/11/2014, 1/20/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Inactive, 1/20/2014, 1/25/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, Active, 1/1/2014, 1/10/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, On Hold, 1/10/2014, 1/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, Pending, 1/15/2014, 1/21/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, Inactive, 1/21/2014,&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Finding min and max dates so we can create a calendar&lt;/P&gt;
&lt;P&gt;MinAndMax:&lt;/P&gt;
&lt;P&gt;LOAD RangeMin(min([Status StartDate]),min([Status EndDate])) as MinDate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeMax(max([Status StartDate]),max([Status EndDate])) as MaxDate&lt;/P&gt;
&lt;P&gt;RESIDENT Data;&lt;/P&gt;
&lt;P&gt;let MinDate = num(Peek('MinDate'));&lt;/P&gt;
&lt;P&gt;let MaxDate = num(Peek('MaxDate'));&lt;/P&gt;
&lt;P&gt;DROP TABLE MinAndMax;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Creating the calendar&lt;/P&gt;
&lt;P&gt;Calendar:&lt;/P&gt;
&lt;P&gt;Load Date($(MinDate)-1+iterno()) as Date autogenerate 1 While iterno() &amp;lt;= $(MaxDate)+1 - $(MinDate) ;&lt;/P&gt;
&lt;P&gt;let MinDate = null();&lt;/P&gt;
&lt;P&gt;let MaxDate = null();&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Joining the calendar dates using interval match to the start and end dates&lt;/P&gt;
&lt;P&gt;IntervalMatch(Date)&lt;/P&gt;
&lt;P&gt;LOAD [Status StartDate], [Status EndDate] RESIDENT Data;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/52418_pastedImage_2.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Type: Pivot Table&lt;/P&gt;&lt;P&gt;Dimension 1: Customer ID&lt;/P&gt;&lt;P&gt;Dimension 2: Status&lt;/P&gt;&lt;P&gt;Expression: avg([Status EndDate]-[Status StartDate])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/52419_pastedImage_3.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Type: Straight Table&lt;/P&gt;&lt;P&gt;Dimension: Customer ID&lt;/P&gt;&lt;P&gt;Expression 1: avg({&amp;lt;Status={'Active'}&amp;gt;}[Status EndDate]-[Status StartDate])&lt;/P&gt;&lt;P&gt;Expression 2: avg({&amp;lt;Status={'Inactive'}&amp;gt;}[Status EndDate]-[Status StartDate])&lt;/P&gt;&lt;P&gt;Expression 3: avg({&amp;lt;Status={'On Hold'}&amp;gt;}[Status EndDate]-[Status StartDate])&lt;/P&gt;&lt;P&gt;Expression 4: avg({&amp;lt;Status={'Pending'}&amp;gt;}[Status EndDate]-[Status StartDate])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/52420_pastedImage_4.png" style="width: 620px; height: 164px;" /&gt;&lt;/P&gt;&lt;P&gt;Type: Line Chart&lt;/P&gt;&lt;P&gt;Dimension 1: Date&lt;/P&gt;&lt;P&gt;Dimension 2: Status&lt;/P&gt;&lt;P&gt;Expression: count([Customer ID])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 13:56:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Status/m-p/574801#M479605</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-31T13:56:45Z</dc:date>
    </item>
  </channel>
</rss>

