<?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: Worst Category in dynamic text in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965219#M946356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solution provided by Stefan should usually work. If there are multiple categories with worst sales, you might want to try with Disrtinct like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue( &lt;STRONG&gt;Distinct&lt;/STRONG&gt; Category,aggr(sum(Sales),Category))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Dec 2015 06:39:37 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2015-12-22T06:39:37Z</dc:date>
    <item>
      <title>Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965214#M946351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi can someone please assist me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to find the worst selling category using the Rank function in a text object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already done the best selling category using the following :&lt;/P&gt;&lt;P&gt;='The best selling category is: ' &amp;amp; chr(13) &amp;amp; chr(13) &amp;amp; FirstSortedValue(Category,-aggr(sum(Sales),Category))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following are the categories ordered according to their sales totals &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/109531_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 11:08:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965214#M946351</guid>
      <dc:creator>desere_k</dc:creator>
      <dc:date>2015-12-21T11:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965215#M946352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just remove the minus before the aggr:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; FirstSortedValue(Category,aggr(sum(Sales),Category))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 13:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965215#M946352</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-21T13:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965216#M946353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl. It still doesn't return anything if I do that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 05:01:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965216#M946353</guid>
      <dc:creator>desere_k</dc:creator>
      <dc:date>2015-12-22T05:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965217#M946354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;PFA, it works with Firstsortedvalue,&lt;/P&gt;&lt;P&gt;thought i have tried out with aggr and concat combination. But the First sorted value solution is preferred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sundar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 06:33:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965217#M946354</guid>
      <dc:creator>sundarakumar</dc:creator>
      <dc:date>2015-12-22T06:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965218#M946355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try below for worst&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue(distinct Category,aggr(sum(Sales),Category))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 06:39:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965218#M946355</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-12-22T06:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965219#M946356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solution provided by Stefan should usually work. If there are multiple categories with worst sales, you might want to try with Disrtinct like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue( &lt;STRONG&gt;Distinct&lt;/STRONG&gt; Category,aggr(sum(Sales),Category))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 06:39:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965219#M946356</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-12-22T06:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965220#M946357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to do what you all have suggested and it still doesn't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached model. It seems that there is a linking issue because when I drop the DateStoreKey it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 07:25:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965220#M946357</guid>
      <dc:creator>desere_k</dc:creator>
      <dc:date>2015-12-22T07:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965221#M946358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aggr and concat works, PFA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 07:36:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965221#M946358</guid>
      <dc:creator>sundarakumar</dc:creator>
      <dc:date>2015-12-22T07:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965222#M946359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you it works perfectly. Could you explain your reasoning to it please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 07:42:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965222#M946359</guid>
      <dc:creator>desere_k</dc:creator>
      <dc:date>2015-12-22T07:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965223#M946360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The working formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='The worst selling category is: ' &amp;amp; chr(13) &amp;amp; chr(13)&lt;/P&gt;&lt;P&gt;&amp;amp;FirstSortedValue(&lt;STRONG&gt; {&amp;lt;Sales={'&amp;gt;0'}&amp;gt;}&lt;/STRONG&gt;Category,aggr(sum(Sales),Category))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was not working because of a Category(null) with 0 sales. And 0 sales was becoming the worst sales.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 08:44:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965223#M946360</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-12-22T08:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Worst Category in dynamic text</title>
      <link>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965224#M946361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The explanation is we are trying to sort the category in ascending order with the below expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),'|',+&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;pipe is the seperator used, so we are using an index to find the first part which is the first part of ascending&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),'|',+&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),'|')-1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;But pls use the First sorted value solution provided by tresesco, bec this might consume more ram than first sorted value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;-Sundar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 08:51:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Worst-Category-in-dynamic-text/m-p/965224#M946361</guid>
      <dc:creator>sundarakumar</dc:creator>
      <dc:date>2015-12-22T08:51:10Z</dc:date>
    </item>
  </channel>
</rss>

