<?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: Rank and P() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769034#M273137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, probably. The first expression you posted is incomplete. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Nov 2014 14:01:43 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-11-05T14:01:43Z</dc:date>
    <item>
      <title>Rank and P()</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769031#M273134</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 want to calculate the retention rate of the top 30% spending customer. As the 30% is base on a dynamic selection of the date period so I have to use the rank function and can't calculate it during the data load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I can calculate the retention rate, a customer is retained if he purchase in 13 to 24 period and repurchase in 0 to 12 period. This is what I can do,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count(DISTINCT &lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt;[Month ID]={'&amp;gt;=$(vRetentionXEnd)&amp;lt;=$(vRetentionXStart)'}, &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Invoice VIP Main No]=p({&amp;lt;[Month ID]={'&amp;gt;=$(vRetentionYEnd)&amp;lt;=$(vRetentionYStart)'}&amp;gt;}[Invoice VIP Main No]) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get the top 30% VIP customer base on this Rank function,&lt;/P&gt;&lt;P&gt;=Count(DISTINCT [Invoice VIP Main No]={=rank(sum([Invoice Net Amount in HKD]),[Invoice VIP Main No])&amp;lt;=$(vFormularDistinctVIP)*0.3'}&amp;gt;}[Invoice VIP Main No]&amp;gt;}[Invoice VIP Main No]) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The point is how can I put these two conditions together?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2014 07:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769031#M273134</guid>
      <dc:creator />
      <dc:date>2014-11-05T07:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and P()</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769032#M273135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try using the * intersect operator for set analysis expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count(DISTINCT&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt; [Month ID]={'&amp;gt;=$(vRetentionXEnd)&amp;lt;=$(vRetentionXStart)'},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice VIP Main No]=p({&amp;lt;[Month ID]={'&amp;gt;=$(vRetentionYEnd)&amp;lt;=$(vRetentionYStart)'} &amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Invoice VIP Main No])&lt;/SPAN&gt; &amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt; [Invoice VIP Main No]={=rank(sum([Invoice Net Amount in HKD]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice VIP Main No])&amp;lt;=$(vFormularDistinctVIP)*0.3'}&amp;gt;}[Invoice VIP Main No] &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Invoice VIP Main No])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2014 10:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769032#M273135</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-05T10:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and P()</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769033#M273136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your tips, I think it is close as there is a syntax error. Will it be possible that p() function is missing parameter to return the result set of VIP no.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=count(DISTINCT&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; {&amp;lt; [Month ID]={'&amp;gt;=$(vRetentionXEnd)&amp;lt;=$(vRetentionXStart)'},&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice VIP Main No]=p({&amp;lt;[Month ID]={'&amp;gt;=$(vRetentionYEnd)&amp;lt;=$(vRetentionYStart)'} &amp;gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; &amp;lt; [Invoice VIP Main No]={=rank(sum([Invoice Net Amount in HKD]),&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Invoice VIP Main No])&amp;lt;=$(vFormularDistinctVIP)*0.3'}&amp;gt;}[Invoice VIP Main No] &amp;gt;}&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; [Invoice VIP Main No])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2014 13:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769033#M273136</guid>
      <dc:creator />
      <dc:date>2014-11-05T13:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and P()</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769034#M273137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, probably. The first expression you posted is incomplete. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2014 14:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-P/m-p/769034#M273137</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-05T14:01:43Z</dc:date>
    </item>
  </channel>
</rss>

