<?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: Help needed-Year to Year comparisons (Retention) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700783#M474246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert,&lt;/P&gt;&lt;P&gt;Hello, thanks so much.&amp;nbsp; The way you organized this is helpful.&amp;nbsp;&amp;nbsp; These help with item 1-6.&amp;nbsp; Any ideas for #7-10? &lt;/P&gt;&lt;P&gt;I tried the intersection of two sets:&amp;nbsp;&amp;nbsp; Count(DISTINCT {&amp;lt;Type={'Current'}&amp;gt;*&amp;lt;Type={'Previous'}&amp;gt;}&amp;nbsp; [Id])&lt;/P&gt;&lt;P&gt;But this merely returns zeros...&amp;nbsp; &lt;/P&gt;&lt;P&gt; Jarrell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Sep 2014 12:15:23 GMT</pubDate>
    <dc:creator>jrdunson</dc:creator>
    <dc:date>2014-09-26T12:15:23Z</dc:date>
    <item>
      <title>Help needed-Year to Year comparisons (Retention)</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700781#M474244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Hello, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I need to create a retention chart (for the past 10 fiscal years) to compare this fiscal year, with last fiscal year, and calculate differences between the two.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL style="list-style-type: upper-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;My dimension is Fiscal Year [FY].&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;My expressions include the following [calculation is on the right]&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;1) [FY IDs] - Fiscal year distinct Id count:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = count(distinct[Id]) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;2) [PFY IDs] - Previous fiscal year distinct Id count:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = below(count(distinct[Id]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;3) [FY Total] - Fiscal year amount total:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = sum([Amount])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;4) [PFY Total] - Previous fiscal year amount total:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = below(sum([Amount]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;5) [Overall Retention] - % ratio comparison in Id counts (#1/#2):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = (count(distinct[Id]) / below(count(distinct[Id])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;6) [Overall Revenue Retention] - % ratio comparison in total amount (#3/#4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;= (sum([Amount]) / below(sum([Amount])) )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;All this works fine... but I need to calculate these...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;7) [Retained IDs]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;= count of distinct ids in this Fiscal Year, who were also in last Fiscal Year (intersection, not union)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; [Retention Rate] &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;= [Retained IDs] / [PFY IDs] or (#7/#2) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;9) [Revenue Variance]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (i.e. compare revenue for retained donors, only), expressed as a ratio&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;= [FY Total] / [PFY Total] * for [Retained IDs] only &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt;"&gt;10) [Retained IDs] per user selections.&amp;nbsp; That is, include same user-selections for both Fiscal Years (for #7, #8, and #9).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt;"&gt;For example, suppose a user selects several dimensions (e.g., division, account, and gift-type).&amp;nbsp; Then, the comparison to the previous year summations should be for the same dimension (division, account, and gift-type). Again, a retained Id would only be distinct IDs that gave in both years (intersection, not union)… so, same Id list, same dimensions. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Consider the following, however:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;a. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;If an Id gave in year 1, and then in year 2 [and no other dimensions were selected], then the Id is considered 'retained.’&amp;nbsp; So, the same Id gave in both Fiscal Years.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;b. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;If, however, an Id gave to one division in year 1, but to a different division for year 2, then that Id is not considered 'retained' &lt;EM&gt;from the viewpoint of that division&lt;/EM&gt;….[’retained’ from a stand-point of the whole organization for the Fiscal Year, yes, but &lt;EM&gt;not&lt;/EM&gt; from the stand-point of the specific division].&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt;"&gt;In other words, the status of ‘retained’ needs to match the user selections… same dimensions and same Id list.&amp;nbsp; That is, count the Ids who in both Fiscal Years,&lt;EM&gt; for the specific set of dimension selections.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I have a sample qvw, called “retention example.qvw.” When it compares years, it only counts unique IDs, for a given year. Moreover, it can filter Ids for a dimension, by association.&amp;nbsp; But these are only Fiscal Year + Dimension counts – not a count of distinct Ids that gave both years. The actual Id lists are different. The below() and above() functions don’t consider Ids that in gave both years (i.e., actual Is that were retained)… &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Questions: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt;"&gt;1) What is the best approach to this?&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Set Analysis? &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Alternate State? Is it possible to do an alternate state? [Perhaps get current selections from Group A and set them in Group B (but have Group B as the previous year) …if setting dynamic selections is possible?]&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Pre-calculate this all via SQL or script… prior to loading the data? &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Using an inline-table [i.e. list of Fiscal Years, Previous Fiscal Years…and perhaps associating these years with the gift data?] &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Functions (though I’ve tried many: previous(), peek(), fieldvalue(), etc.)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Self-Join?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt;"&gt;2) For #7, how do I select Ids from this Fiscal Year, who were also in last Fiscal Year? Something like this [though none of these work]:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(DISTINCT {1&amp;lt;[FiscalYear] = {$(=FiscalYear)} &amp;gt;} [Gifts Id])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(DISTINCT {1&amp;lt;[FiscalYear] = {$(=FiscalYear)-1} &amp;gt;} [Gifts Id])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(DISTINCT {1&amp;lt;[FiscalYear] = {$(=year(only(FiscalYear)-1))} &amp;gt;} [Gifts Id])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;3) Then I need to determine the intersection &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(DISTINCT {$&amp;lt;FiscalYear=($(='FiscalYear'))&amp;gt;}*{$&amp;lt;FiscalYear=($(='FiscalYear')-1)&amp;gt;}&amp;nbsp; [Gifts Id])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Note…I’ve had difficulty showing set analysis expression results…for every row of a straight table.&amp;nbsp; The expressions I’ve tried don’t evaluate in a row … &lt;SPAN style="text-decoration: underline;"&gt;unless a Fiscal Year is selected &lt;/SPAN&gt;by a user, &lt;EM&gt;and&lt;/EM&gt; then the calculation works only for one row (and only displays for one row).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Even if I use a '1' instead of '$' the table doesn't populate for each row: &lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(DISTINCT {1&amp;lt;FiscalYear={ $(=year(only(FiscalYear)-1)) } &amp;gt;} [Gifts Id])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; I need to have the counts for all rows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;4) Do you have suggestion on how to I handle #9, #10?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Thanks in advance, for any suggestions,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; Jarrell&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 20:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700781#M474244</guid>
      <dc:creator>jrdunson</dc:creator>
      <dc:date>2014-09-25T20:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed-Year to Year comparisons (Retention)</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700782#M474245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 10:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700782#M474245</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-09-26T10:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed-Year to Year comparisons (Retention)</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700783#M474246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert,&lt;/P&gt;&lt;P&gt;Hello, thanks so much.&amp;nbsp; The way you organized this is helpful.&amp;nbsp;&amp;nbsp; These help with item 1-6.&amp;nbsp; Any ideas for #7-10? &lt;/P&gt;&lt;P&gt;I tried the intersection of two sets:&amp;nbsp;&amp;nbsp; Count(DISTINCT {&amp;lt;Type={'Current'}&amp;gt;*&amp;lt;Type={'Previous'}&amp;gt;}&amp;nbsp; [Id])&lt;/P&gt;&lt;P&gt;But this merely returns zeros...&amp;nbsp; &lt;/P&gt;&lt;P&gt; Jarrell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2014 12:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700783#M474246</guid>
      <dc:creator>jrdunson</dc:creator>
      <dc:date>2014-09-26T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed-Year to Year comparisons (Retention)</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700784#M474247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jarrell, did you ever get #6 through #10 figured out? I have a similar challenge and am looking for help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 15:02:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700784#M474247</guid>
      <dc:creator>lhebner1</dc:creator>
      <dc:date>2016-09-26T15:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed-Year to Year comparisons (Retention)</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700785#M474248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Leah, no, not yet... I need to beg back to this... if I can get to it, solve it, will let you know&lt;/P&gt;&lt;P&gt;Jarrell&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 14:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-Year-to-Year-comparisons-Retention/m-p/700785#M474248</guid>
      <dc:creator>jrdunson</dc:creator>
      <dc:date>2016-09-28T14:21:18Z</dc:date>
    </item>
  </channel>
</rss>

