<?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 Retention Rates - Sorting within AGGR() (or any other solution appreciated) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641272#M476322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lucian, thanks a mil for that. No wonder I could not get to the answer on my own &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result looks good, although I am still not understanding that expression and calculated dimension entirely yet. But I'll figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2014 18:18:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-06T18:18:13Z</dc:date>
    <item>
      <title>Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641263#M476313</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;I have what seems to be a not-so-simple request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data Model:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the purposes of this discussion, let us assume I have 3 dimensions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIM_DATE where the key is %txn_date_sk&amp;nbsp;&amp;nbsp;&amp;nbsp; (for transaction date key). This is a full master calendar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIM_CUSTOMER where the key is %customer_sk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIM_ABC where the key is %abc (the value of this is not important, but I want to show that i can have 2 rows for the same day and same customer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have a Fact table which contains a number of measures:&lt;/P&gt;&lt;P&gt;FACT_REVENUE which is linked to the above 3 dimensions (and a number of others). Let us say that FACT_REVENUE has two main measures:&lt;/P&gt;&lt;P&gt;Money_Put_In&lt;/P&gt;&lt;P&gt;Money_Taken_Out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There cannot be a row where both Money_Put_In and Money_Taken_Out are &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the question I am trying to answer is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of the customers who have sum(Money_Put_In) &amp;gt; 0 in Month X - 1, how many have sum(Money_Put_In) &amp;gt; 0 in Month X. The result I'm looking for looks something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan 2013 - 70%&lt;/P&gt;&lt;P&gt;Feb 2013 - 75%&lt;/P&gt;&lt;P&gt;Mar 2013 - 60 %&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I cannot use set analysis, as that only gives me for the previous month "hardcoded" in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get the data in the form of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;customer_sk | Dim_Date.MonthYear | IsActiveInNextMonth&lt;/P&gt;&lt;P&gt;1 | Jan-2013 | Yes&lt;/P&gt;&lt;P&gt;1 | Feb-2013 | No&lt;/P&gt;&lt;P&gt;2 | Jan-2013 | Yes&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I achieve this by putting in the SUM(Money_Put_In) in a straight table with customer_sk and Dim_Date.MonthYear, sorted by customer_sk and Dim_Date.MonthYear. Then I use the ABOVE function to make row-wise comparisons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My plan was to use this method in an AGGR(), but I cannot figure out how to explicitly state what the sorting needs to be within the Aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this? Is there a better method which does not involve pre-calculating in a script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 15:26:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641263#M476313</guid>
      <dc:creator />
      <dc:date>2014-06-05T15:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641264#M476314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So I cannot use set analysis, as that only gives me for the previous month "hardcoded" in the selection.&lt;/SPAN&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;You can do it using set analysis. Read this: &lt;A href="https://community.qlik.com/docs/DOC-4252"&gt;Calculating rolling n-period totals, averages or other aggregations&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would go with AsOf table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 15:59:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641264#M476314</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2014-06-05T15:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641265#M476315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply. I'm not sure I'm figuring out how to use the AsOf table in this case however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try to express the solution in SQL maybe it is easier to understand the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select MonthXData.player_sk, MonthXData.month_name, &lt;/P&gt;&lt;P&gt;case when NextMonthData.month_name is not null then 'ACTIVE NEXT MONTH'&lt;/P&gt;&lt;P&gt;when NextMonthData.month_name is null then 'NOT ACTIVE NEXT MONTH'&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Select distinct month_name, month_number,&amp;nbsp; player_sk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from fact_revenue join dim_date using (txn_date_sk)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where money_put_in &amp;gt; 0)&lt;/P&gt;&lt;P&gt;as MonthXData&lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Select distinct month_name, month_number,&amp;nbsp; player_sk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from fact_revenue join dim_date using (txn_date_sk)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where money_put_in &amp;gt; 0) &lt;/P&gt;&lt;P&gt;as NextMonthData&lt;/P&gt;&lt;P&gt;on &lt;/P&gt;&lt;P&gt;MonthXData.player_sk = NextMonthData.player_sk&lt;/P&gt;&lt;P&gt;AND MonthXData.month_number = NextMonthData.month_number -1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you think I need to set up my AsOf table to achieve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 21:39:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641265#M476315</guid>
      <dc:creator />
      <dc:date>2014-06-05T21:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641266#M476316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's say you have your master calendar table "Time" and we want to link to "YearMonth" field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;AsOf:&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT &lt;/P&gt;
&lt;P&gt;&amp;nbsp; YearMonth as AsOfYearMonth&lt;/P&gt;
&lt;P&gt;RESIDENT Time&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;JOIN (AsOf)&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(MonthsBack=0,'Current', 'Previous') as MonthType&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; AsOfYearMonth,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; AddMonths(AsOfYearMonth, 1-iterno()) as YearMonth,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; iterno()-1 as MonthsBack&lt;/P&gt;
&lt;P&gt;RESIDENT AsOf&lt;/P&gt;
&lt;P&gt;WHILE iterno() &amp;lt;=2&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 22:32:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641266#M476316</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2014-06-05T22:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641267#M476317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not figuring it out completely but working on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will let you know how this works out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 12:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641267#M476317</guid>
      <dc:creator />
      <dc:date>2014-06-06T12:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641268#M476318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add a qvw example with demo data and expected result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 14:38:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641268#M476318</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2014-06-06T14:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641269#M476319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I managed to get the ASOF date sorted and correctly (I think) linked to my Calendar table. However I'm not able to get the correct expression to do the count I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use P() set analysis to get those players who were active in the PREVIOUS month and in the CURRENT month. Results don't look good though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to create a little QVW that will illustrate the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:16:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641269#M476319</guid>
      <dc:creator />
      <dc:date>2014-06-06T15:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641270#M476320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the QVW.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:42:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641270#M476320</guid>
      <dc:creator />
      <dc:date>2014-06-06T15:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641271#M476321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See file:&lt;/P&gt;&lt;P&gt;- Added AsOf table&lt;/P&gt;&lt;P&gt;- Added dimension and expression in "Retention Rate" chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Added some more records to illustrate the fact that even if we have the same number of partners each month, we calculate correctly the retention rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lucian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 16:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641271#M476321</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2014-06-06T16:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641272#M476322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lucian, thanks a mil for that. No wonder I could not get to the answer on my own &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result looks good, although I am still not understanding that expression and calculated dimension entirely yet. But I'll figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 18:18:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641272#M476322</guid>
      <dc:creator />
      <dc:date>2014-06-06T18:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641273#M476323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) you group DISTINCT Customer&amp;amp;Month, by current and previous months&lt;/P&gt;&lt;P&gt;2) if only() is null, then you have the customer in both months. Obs:&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; isnull(only()) returns true (-1) , therefore we have a - (minus) in front of sum().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;3) divide it by customers in previous month&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 18:55:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641273#M476323</guid>
      <dc:creator>luciancotea</dc:creator>
      <dc:date>2014-06-06T18:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Retention Rates - Sorting within AGGR() (or any other solution appreciated)</title>
      <link>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641274#M476324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the explanation. I have a fun weekend implementing this on my model now &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 19:37:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Customer-Retention-Rates-Sorting-within-AGGR-or-any-other/m-p/641274#M476324</guid>
      <dc:creator />
      <dc:date>2014-06-06T19:37:34Z</dc:date>
    </item>
  </channel>
</rss>

