<?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 Regarding Top 1st Customer in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191521#M53578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try that one ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;only({&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} CUSTOMER ) &amp;amp;' '&amp;amp; sum({&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} Sales )&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Mar 2010 08:53:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-03-24T08:53:40Z</dc:date>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191519#M53576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal;"&gt;Hai,&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal;"&gt;Is there any way to display the Top 1&lt;SUP&gt;st&lt;/SUP&gt; customer and his sales value in Text box? Could anyone help me on this?&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal;"&gt;I'm using the following expression.&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;=if(Aggr(rank(sum(SALES)), CUSTOMER) =1 , CUSTOMER)&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt; line-height: normal;"&gt;Thanks in Advance..&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="margin: 0in 0in 10pt;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 08:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191519#M53576</guid>
      <dc:creator />
      <dc:date>2010-03-24T08:00:25Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191520#M53577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what been written to retrieve to load the top 10 customer. I am sure with little modification you will get the required result. Let me know the out come after applying this logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=IF(&lt;BR /&gt;aggr(&lt;BR /&gt;rank(total&lt;BR /&gt;aggr( sum( {$&amp;lt;Year={$(=Max(Year)-1)}&amp;gt;} SalValue),itemname)&lt;BR /&gt;,0,1)&lt;BR /&gt;,itemname)&lt;BR /&gt;&amp;lt;=10,&lt;BR /&gt;&lt;BR /&gt;aggr(&lt;BR /&gt;rank(total&lt;BR /&gt;aggr( sum( {$&amp;lt;Year={$(=Max(Year)-1)}&amp;gt;} SalValue),itemname)&lt;BR /&gt;,0,1)&lt;BR /&gt;,&lt;BR /&gt;itemname))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Rikab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 08:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191520#M53577</guid>
      <dc:creator />
      <dc:date>2010-03-24T08:21:10Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191521#M53578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try that one ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;only({&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} CUSTOMER ) &amp;amp;' '&amp;amp; sum({&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} Sales )&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 08:53:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191521#M53578</guid>
      <dc:creator />
      <dc:date>2010-03-24T08:53:40Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191522#M53579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow..Its working fine..Thank you so much..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 09:09:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191522#M53579</guid>
      <dc:creator />
      <dc:date>2010-03-24T09:09:50Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191523#M53580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Onder!&lt;/P&gt;&lt;P&gt;Awesome Nice and useful one. I will be much thankful to you if you can explain how it works in such away that even beginners like me also can understand. Waiting for your reply!&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Rikab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 10:05:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191523#M53580</guid>
      <dc:creator />
      <dc:date>2010-03-24T10:05:21Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191524#M53581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;only({&amp;lt;CUSTOMER= {&lt;STRONG&gt;"=rank(sum(Sales), CUSTOMER) =1"&lt;/STRONG&gt;}&amp;gt;} CUSTOMER ) &amp;amp; ' '&lt;BR /&gt;&amp;amp; sum({&amp;lt;CUSTOMER= {&lt;STRONG&gt;"=rank(sum(Sales), CUSTOMER) =1"&lt;/STRONG&gt;}&amp;gt;} Sales )&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;The double quotes indicate that this is a search expression instead of a literal. QlikView will search for the Customer that is ranked #1 by sum(Sales).&lt;/P&gt;&lt;P&gt;only(&lt;STRONG&gt;{&amp;lt;CUSTOMER= {&lt;/STRONG&gt;"=rank(sum(Sales), CUSTOMER) =1"&lt;STRONG&gt;}&amp;gt;}&lt;/STRONG&gt; CUSTOMER ) &amp;amp; ' '&lt;BR /&gt;&amp;amp; sum(&lt;STRONG&gt;{&amp;lt;CUSTOMER= {&lt;/STRONG&gt;"=rank(sum(Sales), CUSTOMER) =1"&lt;STRONG&gt;}&amp;gt;}&lt;/STRONG&gt; Sales )&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;This is set analysis. It tells QlikView that we ONLY want to see the customer given inside of the brackets. What is inside of the brackets is the Customer that QlikView determined is ranked #1 by sum(Sales). So our set "selects" this specific customer.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;only(&lt;/STRONG&gt;{&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} &lt;STRONG&gt;CUSTOMER )&lt;/STRONG&gt; &amp;amp; ' '&lt;BR /&gt;&amp;amp; sum({&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} Sales )&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;We have "selected" only one customer using set analysis, so only(... CUSTOMER) will return that customer.&lt;/P&gt;&lt;P&gt;only({&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} CUSTOMER ) &amp;amp; ' '&lt;BR /&gt;&amp;amp; &lt;STRONG&gt;sum(&lt;/STRONG&gt;{&amp;lt;CUSTOMER= {"=rank(sum(Sales), CUSTOMER) =1"}&amp;gt;} &lt;STRONG&gt;Sales )&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;We have "selected" only one customer using set analysis, so sum(... Sales) will return the total sales for that customer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 23:11:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191524#M53581</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-03-24T23:11:48Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191525#M53582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;let me offer an alternative, without Set Analysis, but with Advanced Aggregation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=firstsortedvalue(Customer, -1* aggr(sum(Sales), Customer)) &amp;amp; ' ' &amp;amp;&lt;BR /&gt;firstsortedvalue( aggr(sum(Sales), Customer), -1 * aggr(sum(Sales), Customer))&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Brief explanation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Function "FirstSortedValue" accepts 2 mandatory parameters (and some optional ones) and returns the Top value of the first parameter, sorted by the values of the second parameter. Multiplying by -1 is used to sort Sales in descending order.&lt;/LI&gt;&lt;LI&gt;Function Aggr() aggregates sum(Sales) to the Customer level&lt;/LI&gt;&lt;LI&gt;We have to use the same aggr() twice for the second "FirstSortedValue", because both parameters are mandatory.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Not sure which one of the two formulas performs better (I suspect that Set Analysis might win the competition) but I was just curious if the could be done with FirstSortedValue. It can, indeed!&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 02:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191525#M53582</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-03-25T02:47:17Z</dc:date>
    </item>
    <item>
      <title>Regarding Top 1st Customer</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191526#M53583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Helo John!&lt;/P&gt;&lt;P&gt;Thanks for very very neat explanation! Will be useful for everyone to understand.&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Rikab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 05:29:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-Top-1st-Customer/m-p/191526#M53583</guid>
      <dc:creator />
      <dc:date>2010-03-25T05:29:39Z</dc:date>
    </item>
  </channel>
</rss>

