<?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 aggr function in set analysis not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793264#M1018523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. As you said, now all the QuarterYear are showing up in the table but unfortunately the Median numbers are not right. Also when I do it for median of 50% count I see the same numbers as 25% repeating for that expression as well. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Mar 2015 20:53:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-25T20:53:15Z</dc:date>
    <item>
      <title>Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793262#M1018521</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 a requirement to find the median of 25% of total count, 50% of total count and so on for every quarter. I cannot implement the ranking function in script because the count will differ based on filter selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the data in the attached file, I would like to have the result of the Straight table as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/81910_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Table named F&lt;STRONG&gt;inal&lt;/STRONG&gt; shows the correct value if one QuarterYear is selected but not when no filters are selected (Also the table shows only one QuarterYear always).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need more information&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Malai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 18:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793262#M1018521</guid>
      <dc:creator />
      <dc:date>2015-03-25T18:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793263#M1018522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Played around with it for a bit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are missing more than one quarteryear because the Set Modifier is not evaluating Rank at the QuarterYear number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i disabled all expressions except one and put in the following and it now seems to bring back all quarterYears&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Median({&amp;lt;Site = {"=&amp;nbsp; aggr( Rank( sum(-Days)),YearQuarterNo,Site) &amp;lt;= round( Count ( total &amp;lt;QuarterYear&amp;gt; Days)*0.25)"}&amp;gt;} Days)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i did NOT check the median values for accuracy.... please see attached and verify numbers to see if they are still wrong. Hopefully we are down to 1 issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 20:31:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793263#M1018522</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-25T20:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793264#M1018523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help. As you said, now all the QuarterYear are showing up in the table but unfortunately the Median numbers are not right. Also when I do it for median of 50% count I see the same numbers as 25% repeating for that expression as well. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 20:53:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793264#M1018523</guid>
      <dc:creator />
      <dc:date>2015-03-25T20:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793265#M1018524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;K. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Working on the numbers , i went with a search mask where both sides use aggr() &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=median(&amp;nbsp; {&amp;lt;Site = {"=&amp;nbsp; aggr( Rank( sum(-Days)),YearQuarterNo,Site)-1 &amp;lt;= round( aggr( NODISTINCT Count ( DISTINCT Site),QuarterYear)*0.25)"}&amp;gt;} Days )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;=median(&amp;nbsp; {&amp;lt;Site = {"=&amp;nbsp; aggr( Rank( sum(-Days)),YearQuarterNo,Site)-1 &amp;lt;= round( aggr( NODISTINCT Count ( DISTINCT Site),QuarterYear)*0.5)"}&amp;gt;} Days )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to pay off except for 1 or 2 issues:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A) I'm getting a different value than you for Q1-15 ( 365 vs 370) ... can you break down the exact values that fall into this bucket that would lead to a value of '370'&lt;/P&gt;&lt;P&gt;B) For reasons not yet known, my ranking expression starts at '2' (so i'm subtracting '1')&amp;nbsp; . Strange and may be tied to A.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways please let me know the answer to A) ..&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/81944_Untitled.png" style="height: 441px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 23:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793265#M1018524</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-25T23:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793266#M1018525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found issue B, I think Rank 1 was considered for Site with null values. So I changed the expression as below and removed the -1 from the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=median(&amp;nbsp; {&amp;lt;Site = {"=&amp;nbsp; aggr( Rank( If(isnull(Site)=0,sum(-Days))),YearQuarterNo,Site) &amp;lt;= round( aggr( NODISTINCT Count ( DISTINCT Site),QuarterYear)*0.25)"}&amp;gt;} Days )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for issue 1 I still see a problem (Though not with Median 50 but with Median 25):.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expected answer should be:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/81951_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;The data for Q1 - 15 is:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/81952_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;Since Count of 25% is 2, Rank 1 and 2 should be considered. In this case Rank 1 = 360 days and Rank 2 = 365 days and the median should be (360+365)/2 = 362.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the result from our 25% expression is 365. Is this because rank 2 and rank 3 have same values and it is considering the whole result set for the median?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 00:26:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793266#M1018525</guid>
      <dc:creator />
      <dc:date>2015-03-26T00:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793267#M1018526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think so.. trying to tweak the 2nd/3rd parameters to rank the 2nd 365 as a higher rank (rather than equivalent rank to first 365).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Works a little different in the Set Modifier search mask...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;stay tuned&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 00:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793267#M1018526</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-26T00:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793268#M1018527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will blank out the duplicate rank (blank the 2nd 365)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=median(&amp;nbsp; {&amp;lt;Site = {"=&amp;nbsp; aggr( Rank( If(isnull(Site)=0,sum(-Days)),4,2),YearQuarterNo,Site) &amp;lt;= round( aggr( NODISTINCT Count ( DISTINCT Site),QuarterYear)*0.25)"}&amp;gt;} Days )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=median(&amp;nbsp; {&amp;lt;Site = {"=&amp;nbsp; aggr( Rank( If(isnull(Site)=0,sum(-Days)),4,2),YearQuarterNo,Site) &amp;lt;= round( aggr( NODISTINCT Count ( DISTINCT Site),QuarterYear)*0.5)"}&amp;gt;} Days )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/81953_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 00:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793268#M1018527</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-26T00:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and aggr function in set analysis not working</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793269#M1018528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I implemented the expression in my main application, it was again not showing all the dimensions. Tried different things and finally got it working with the below expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Median(IF(aggr(Num(Rank(if(isnull(Days)=0,-Days),4,1)),QuarterYear,Site)&amp;lt;=Aggr(Round(Count(Total&amp;lt;QuarterYear&amp;gt; Days)*.25),QuarterYear,Site), Days))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Malai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 06:40:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-and-aggr-function-in-set-analysis-not-working/m-p/793269#M1018528</guid>
      <dc:creator />
      <dc:date>2015-03-26T06:40:10Z</dc:date>
    </item>
  </channel>
</rss>

