<?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: Conditional Rank with Aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632695#M446569</link>
    <description>&lt;P&gt;This&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Concat(DISTINCT {&amp;lt;[Corporate Account] = {"=Rank(Sum({$&amp;lt;[Year]={[$(=vPY_Year)]}, [Corporate Account] = {""=Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0""}&amp;gt;}[Sales USD])-Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}, [Corporate Account] = {""=Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0""}&amp;gt;}[Sales USD])) = 1"}&amp;gt;} [Corporate Account])&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 08 Oct 2019 18:26:03 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-10-08T18:26:03Z</dc:date>
    <item>
      <title>Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1631604#M446497</link>
      <description>&lt;P&gt;I am trying to compare current year sales (vCY_Year) to prior year sales (vPY_Sales) and want to rank in descending order the Corporate Accounts with the largest difference between the years, but only rank the Corporate Accounts with &amp;lt;=0 total sales in the current year. &amp;nbsp; I can't figure out how rank only the ones with &amp;lt;=0 total sales with rank and aggr.&amp;nbsp; This expression includes the accounts with positive sales for the current year too.&lt;/P&gt;&lt;P&gt;s&lt;FONT&gt;um({1}aggr ( Rank(-&lt;BR /&gt;(sum({$&amp;lt;[Year]={"$(=vCY_Year)"}&amp;gt;}[Sales USD])&lt;BR /&gt;-sum({$&amp;lt;[Year]={"$(=vPY_Year)"}&amp;gt;}[Sales USD])))&lt;BR /&gt;,[Corporate Account]))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 18:43:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1631604#M446497</guid>
      <dc:creator>cmenszak1</dc:creator>
      <dc:date>2019-10-04T18:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1631633#M446499</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier" size="3" color="#000000"&gt;Try with this...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Rank(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Sum({&amp;lt; [Year] = {"$(=vPY_Year)"}, [Corporate Account] = {"=Sum({&amp;lt;[Year] = {'$(=vCY_Year)'}&amp;gt;} [Sales USD]) &amp;lt;= 0"}&amp;gt;} [Sales USD]),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;-Sum({&amp;lt;[Year] = {"$(=vCY_Year)"}, [Corporate Account] = {"=Sum({&amp;lt;[Year] = {'$(=vCY_Year)'}&amp;gt;} [Sales USD]) &amp;lt;= 0"}&amp;gt;} [Sales USD])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 20:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1631633#M446499</guid>
      <dc:creator>JGMDataAnalysis</dc:creator>
      <dc:date>2019-10-14T20:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632297#M446531</link>
      <description>sum({1}aggr ( Rank(-&lt;BR /&gt;(sum({$&amp;lt;[Year]={"$(=vCY_Year)"}&amp;gt;}[Sales USD])&lt;BR /&gt;-sum({$&amp;lt;[Year]={"$(=vPY_Year)"} , [Corporate Account]={"=sum({$&amp;lt;[Year]={"$(=vPY_Year)"}&amp;gt;}[Sales USD])&amp;lt;=0"} &amp;gt;}[Sales USD])))&lt;BR /&gt;,[Corporate Account]))</description>
      <pubDate>Tue, 08 Oct 2019 05:21:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632297#M446531</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2019-10-08T05:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632570#M446557</link>
      <description>&lt;P&gt;I tried the revised expression and it doesn't quite work, the rows with zero sales in the current year are not being ranked.&amp;nbsp; &amp;nbsp;I only want to rank the ones with zero (or less than zero) sales in the current year (vCY_Year).&amp;nbsp; I attached a very simple sample app.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:31:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632570#M446557</guid>
      <dc:creator>cmenszak1</dc:creator>
      <dc:date>2019-10-08T14:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632581#M446558</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0,
Rank(Sum({$&amp;lt;[Year]={"$(=vPY_Year)"}, [Corporate Account] = {"=Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0"}&amp;gt;}[Sales USD])-Sum({$&amp;lt;[Year]={"$(=vCY_Year)"}, [Corporate Account] = {"=Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0"}&amp;gt;}[Sales USD])),
0)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Oct 2019 14:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632581#M446558</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-08T14:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632675#M446568</link>
      <description>&lt;P&gt;Thanks for the help.&amp;nbsp; That expression does what I need when used in a table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ultimately what I need to accomplish is a text box with the customer ranked number one (based on largest YoY decline and with current year sales &amp;lt;=0).&amp;nbsp; I am assuming I need to use the AGGR function to achieve this.&amp;nbsp; I attached another sample app with two text boxes, one that identifies a the largest YoY difference for all customers that does this (text box 1), I still can't figure out how to do this for the customer with current year sales &amp;lt;= 0 (text box 2).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 17:58:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632675#M446568</guid>
      <dc:creator>cmenszak1</dc:creator>
      <dc:date>2019-10-08T17:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632695#M446569</link>
      <description>&lt;P&gt;This&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Concat(DISTINCT {&amp;lt;[Corporate Account] = {"=Rank(Sum({$&amp;lt;[Year]={[$(=vPY_Year)]}, [Corporate Account] = {""=Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0""}&amp;gt;}[Sales USD])-Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}, [Corporate Account] = {""=Sum({$&amp;lt;[Year]={[$(=vCY_Year)]}&amp;gt;}[Sales USD]) + Sum({1} 0) &amp;lt;= 0""}&amp;gt;}[Sales USD])) = 1"}&amp;gt;} [Corporate Account])&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Oct 2019 18:26:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1632695#M446569</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-08T18:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1634859#M446716</link>
      <description>&lt;P&gt;Chris, did Sunny's last post get you what you needed?&amp;nbsp; If so, be sure to use the Accept as Solution button on his post to mark it as the solution and give him credit for the help.&amp;nbsp; If you did something different, consider posting that and then mark it, and if you are still working on things, leave an update.&amp;nbsp; Here are a couple of Design Blog links that could be helpful on this one possibly for the future:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think that is the most useful one, there are others, you can use the following link to search the area yourself, lots of good example/explanation content in this area:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 12:46:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1634859#M446716</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-10-14T12:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rank with Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1635134#M446724</link>
      <description>&lt;P&gt;This one did what I was looking for.&amp;nbsp; Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 19:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Rank-with-Aggr/m-p/1635134#M446724</guid>
      <dc:creator>cmenszak1</dc:creator>
      <dc:date>2019-10-14T19:54:31Z</dc:date>
    </item>
  </channel>
</rss>

