<?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: Client with third largest sales in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185082#M22062</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I have and it worked fine. Thanks! I'm really impressed by such a colaborative community &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2016 14:57:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-09-16T14:57:05Z</dc:date>
    <item>
      <title>Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185073#M22053</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;&lt;SPAN style="font-size: 10pt;"&gt;I'm trying to create a KPI for each one of the top3 clients by margin. I've so far managed to create a bar chart with the clients with the top 3 margins. But the (slightly) same code won't work for a KPI.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Here's the (working) code for the measure in the bar chart: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;EM&gt;if(rank((sum(Valor) - sum([Custo]*Horas))/sum(Valor))&amp;lt;=3,(sum(Valor) - sum([Custo]*Horas))/sum(Valor))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;And here's the one I've been trying to make work on a KPI:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;if(rank((sum(Valor) - sum([Custo]*Horas))/sum(Valor))=3,(sum(Valor) - sum([Custo]*Horas))/sum(Valor))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;The problem is the KPI is always "-" no matter what value or expression I put in the code above. I assume there's a misunderstanding in how the aggr function works on my part, but couldn't tell where the error is coming from. Can someone help me?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 21:02:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185073#M22053</guid>
      <dc:creator />
      <dc:date>2016-09-14T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185074#M22054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't spot the aggr() function in your code, have you posted the correct code snippet?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 21:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185074#M22054</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-14T21:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185075#M22055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( Aggr( &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;if(rank((sum(Valor) - sum([Custo]*Horas))/sum(Valor))&amp;lt;=3,(sum(Valor) - sum([Custo]*Horas))/sum(Valor))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;, ClientField&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;))&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 21:31:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185075#M22055</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-14T21:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185076#M22056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(Aggr((Sum(Valor) - Sum([Custo]*Horas))/Sum(Valor), Client), 3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and may be this to get the name of the 3rd larget client&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(Client, -Aggr(&lt;/STRONG&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;(Sum(Valor) - Sum([Custo]*Horas))/Sum(Valor), Client), 3)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 23:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185076#M22056</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-14T23:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185077#M22057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I'm sorry. I was testing two or three formulas and ended up posting the wrong ones.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185077#M22057</guid>
      <dc:creator />
      <dc:date>2016-09-15T14:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185078#M22058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both formulas worked fine. Thank you a lot! I didn't knew I could pass another parameter to the max function. Can you please explain the use of a minus sign in the aggr function? From what I've tested, removing the sign inverts the "temporary table" create by the aggr function. Is this correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:39:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185078#M22058</guid>
      <dc:creator />
      <dc:date>2016-09-15T14:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185079#M22059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are right. negative sign in front of Aggr() sort the table in descending order picking the third largest client. If you remove the negative sign, the FirstSortedValue will pick the 3rd smallest client&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 18:19:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185079#M22059</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-15T18:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185080#M22060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm also trying to compare this margin over time using an line chart, but the value simply doesn't displays. From what I understand including the "Date.month" in dimensions and this expression in measure would accomplish that, but it's not working.&lt;/P&gt;&lt;P&gt;For testing I've set up a filter based up on month and a KPI displaying the third largest margin. It changes as I filter the months, so it's working alright. But the graphic besides the kpi is always blank.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="margem ao longo do tempo.png" class="jive-image image-1" src="/legacyfs/online/137635_margem ao longo do tempo.png" style="height: 176px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 21:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185080#M22060</guid>
      <dc:creator />
      <dc:date>2016-09-15T21:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185081#M22061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you added your time dimension field used in the charts also to the Aggr() function dimension list?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 21:56:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185081#M22061</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-15T21:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Client with third largest sales</title>
      <link>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185082#M22062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I have and it worked fine. Thanks! I'm really impressed by such a colaborative community &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 14:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Client-with-third-largest-sales/m-p/1185082#M22062</guid>
      <dc:creator />
      <dc:date>2016-09-16T14:57:05Z</dc:date>
    </item>
  </channel>
</rss>

