<?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 Month by month customer retention in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290299#M403554</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'm trying to make a table to show month by month customer retention. After reading lost of posts, I have achieved to create expressions that work for a selected year-month, using p() and e() and a continuous Month Count but can't get to make it work using year-month as dimension, even &lt;SPAN style="font-size: 13.3333px;"&gt;with an as of &lt;SPAN style="font-size: 13.3333px;"&gt;Month Count&lt;/SPAN&gt; table that flags current and previous month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The source data contains &lt;SPAN style="font-size: 13.3333px;"&gt;user, &lt;/SPAN&gt;date and product for each of the customer transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to get the following counts, and these are the expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt; Customers that bought a product the &lt;STRONG&gt;current OR the previous month&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)+&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;- &lt;SPAN style="font-size: 13.3333px;"&gt;Customers &lt;/SPAN&gt;that bought a product the&lt;STRONG&gt; current AND the previous month&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)*&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;- &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Customers &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; text-decoration: underline;"&gt;that bought a product the &lt;STRONG&gt;current AND NOT the previous month.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; *&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;- Customers that bought a product the &lt;STRONG&gt;previous AND NOT the current month&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)*&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the asof table i have &lt;SPAN style="font-size: 13.3333px;"&gt;asofmonthcount , monthcount, and monthsago, where &lt;/SPAN&gt;asofmonthcount is linked to each monthcount and the previous, which are flagged as&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; monthsago=1 &lt;/SPAN&gt;or&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;monthsago&lt;/SPAN&gt;=0.&lt;/SPAN&gt;I have tried using asofmonthcount as dimension and changing&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;for &lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;monthsago&lt;/SPAN&gt;={0}, &lt;/SPAN&gt;and &lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;for&lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;monthsago&lt;/SPAN&gt;={1}, &lt;/SPAN&gt;&lt;/SPAN&gt;but not getting the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be much appreciated, I have been a long time stucked with this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thans in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jorge&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Nov 2016 10:41:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-11-22T10:41:41Z</dc:date>
    <item>
      <title>Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290299#M403554</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'm trying to make a table to show month by month customer retention. After reading lost of posts, I have achieved to create expressions that work for a selected year-month, using p() and e() and a continuous Month Count but can't get to make it work using year-month as dimension, even &lt;SPAN style="font-size: 13.3333px;"&gt;with an as of &lt;SPAN style="font-size: 13.3333px;"&gt;Month Count&lt;/SPAN&gt; table that flags current and previous month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The source data contains &lt;SPAN style="font-size: 13.3333px;"&gt;user, &lt;/SPAN&gt;date and product for each of the customer transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to get the following counts, and these are the expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt; Customers that bought a product the &lt;STRONG&gt;current OR the previous month&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)+&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;- &lt;SPAN style="font-size: 13.3333px;"&gt;Customers &lt;/SPAN&gt;that bought a product the&lt;STRONG&gt; current AND the previous month&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)*&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={'apples'},&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;- &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Customers &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; text-decoration: underline;"&gt;that bought a product the &lt;STRONG&gt;current AND NOT the previous month.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; *&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;- Customers that bought a product the &lt;STRONG&gt;previous AND NOT the current month&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;{1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;e&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)*&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt; product={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;'apples'&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;username&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In the asof table i have &lt;SPAN style="font-size: 13.3333px;"&gt;asofmonthcount , monthcount, and monthsago, where &lt;/SPAN&gt;asofmonthcount is linked to each monthcount and the previous, which are flagged as&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; monthsago=1 &lt;/SPAN&gt;or&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;monthsago&lt;/SPAN&gt;=0.&lt;/SPAN&gt;I have tried using asofmonthcount as dimension and changing&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;for &lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;monthsago&lt;/SPAN&gt;={0}, &lt;/SPAN&gt;and &lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;MonthCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ={&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=max(MonthCount)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;for&lt;SPAN style="color: black; font-size: 9.0pt; font-family: 'Courier New';"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt; &lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;monthsago&lt;/SPAN&gt;={1}, &lt;/SPAN&gt;&lt;/SPAN&gt;but not getting the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be much appreciated, I have been a long time stucked with this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thans in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jorge&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 10:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290299#M403554</guid>
      <dc:creator />
      <dc:date>2016-11-22T10:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290300#M403555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if my post here can be helpful &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/223795"&gt;How can I reference the values from Dimensions in set analysis?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 11:28:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290300#M403555</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-11-22T11:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290301#M403556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer Vineeth. It seems a similar problem, but as I'm using personal edition and can't open your posted qvw I don't know if your solution applies&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 13:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290301#M403556</guid>
      <dc:creator />
      <dc:date>2016-11-22T13:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290302#M403557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you post a sample app?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 13:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290302#M403557</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-11-22T13:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290303#M403558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vineeth, find attached a simplified app that represents the same problem.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 14:21:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290303#M403558</guid>
      <dc:creator />
      <dc:date>2016-11-22T14:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290304#M403559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the problem might the asof table (and the model), as I'm relating all facts to both current and previous months, therefore addition and intersection give the same results, and both substractions equal 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still can't think of how to avoid this and get a solution...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 15:43:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290304#M403559</guid>
      <dc:creator />
      <dc:date>2016-11-22T15:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290305#M403560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt; Your expertise are needed here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:01:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290305#M403560</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-11-23T08:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290306#M403561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Vineeth. I attach the latest version of the test app. I guess that with the asofmonth dimension and the correct expressions this cuold work, but still haven't figured out how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 08:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290306#M403561</guid>
      <dc:creator />
      <dc:date>2016-11-23T08:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290307#M403562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/people/vinieme12"&gt;vinieme12&lt;/A&gt;‌ I will def. take a look at this, but from what I read it seems that we would need to somehow use Aggr() function instead of set analysis to do this. I may be wrong, but I will try to play around with this to see if I can get it to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:34:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290307#M403562</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-23T10:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290308#M403563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/233375"&gt;jorgeplanas&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also trying to work out a solution &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:36:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290308#M403563</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-11-23T10:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290309#M403564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌ and &lt;A href="https://community.qlik.com/qlik-users/216189"&gt;vinieme12&lt;/A&gt;‌!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm also working on it, tried something with aggr(min(month),username) and &lt;SPAN style="font-size: 13.3333px;"&gt;aggr(max(month),username) inside of the asofmonth dimension but still couldn't make it work. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward for your insight&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:50:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290309#M403564</guid>
      <dc:creator />
      <dc:date>2016-11-23T10:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290310#M403565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first things first, do you have QV12 or not? If not then you will need to fix the sort order for your month field in the script. I did that by adding a simple inline load which was later dropped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At start of the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Temp:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD RecNo() as month&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AutoGenerate 12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At end of the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Temp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have this done, the aggregate function should start working for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;month&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expressions&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;=RangeSum(Column(2), Column(3), Column(4))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;=Sum(Aggr(If(username = Above(Only({1}username)) and month = Above(Only({1}month)) + 1, 1, 0) , username, month))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3) =RangeSum(Count(DISTINCT username),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-Sum(Aggr(If(username = Above(Only({1}username)) and month = Above(Only({1}month)) + 1, 1, 0) , username, month)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4) =RangeSum(Above(Count({1}DISTINCT username)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-Sum(Aggr(If(username = Above(Only({1}username)) and month = Above(Only({1}month)) + 1, 1, 0) , username, month)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="144632" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/144632_Capture.PNG" style="height: 344px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 12:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290310#M403565</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-23T12:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290311#M403566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's working perfectly! I would have never come to this approach, I'll have to explore a bit more the aggr() and above() functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try now to implement it in the real app, I guess it will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thank you very much &lt;/SPAN&gt;&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;‌ and &lt;A href="https://community.qlik.com/qlik-users/216189"&gt;vinieme12&lt;/A&gt;‌‌‌!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 15:18:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290311#M403566</guid>
      <dc:creator />
      <dc:date>2016-11-23T15:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290312#M403567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If in case you have QV12, this will be a good place to read -&amp;gt; &lt;A href="https://community.qlik.com/qlik-blogpost/4673"&gt;The sortable Aggr function is finally here!&lt;/A&gt;‌‌. Actually even if you don't have QV12, I would suggest you to read this &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 15:20:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290312#M403567</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-23T15:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Month by month customer retention</title>
      <link>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290313#M403568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the info, I'm using QV11, but I'll check it anyway!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2016 15:33:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-by-month-customer-retention/m-p/1290313#M403568</guid>
      <dc:creator />
      <dc:date>2016-11-23T15:33:56Z</dc:date>
    </item>
  </channel>
</rss>

