<?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: Text Box: Show 1 out of Multiple Options in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564329#M210627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was quick! But unfortunately you can't use DISTINCT() with FirstSortedValue().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2014 09:41:44 GMT</pubDate>
    <dc:creator>ciaran_mcgowan</dc:creator>
    <dc:date>2014-04-11T09:41:44Z</dc:date>
    <item>
      <title>Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564327#M210625</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 text box that displays a sentence about a top Sales Person, which works fine until dates are drilled into to display a smaller date range; I know what the problem is, just not the solution. The problem is that occasionally, more than one Sales Person will have the exact same data with absolutely nothing to distinguish them (ie. Sales Amount, Sales Quantity, Hours Worked, Profit Margin, etc). How can I sent the text box to display either (1) the first Sales person alphabetically or (2) all Sales people?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first attempt looked like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= 'Top Sales person for ' &amp;amp; &lt;SPAN style="color: #808080;"&gt;&lt;EM&gt;&lt;STRONG&gt;vTimePeriod&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt; &amp;amp; ' goes to ' &amp;amp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesPerson&lt;/SPAN&gt;, -(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;), &lt;SPAN style="color: #800000;"&gt;SalesPersonID&lt;/SPAN&gt;)))&lt;/P&gt;&lt;P&gt;&amp;amp; ' with '&amp;amp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;, -(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;), &lt;SPAN style="color: #800000;"&gt;SalesPersonID&lt;/SPAN&gt;)))&lt;/P&gt;&lt;P&gt;&amp;amp; '!'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there were too many Sales people being returned so I altered it to display the Sales Person who (1) Made the most money, (2) Sold the most items IN (3) The shorted time. This cut down on duplication caused by the above calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= 'Top Sales person for ' &amp;amp; &lt;SPAN style="color: #808080;"&gt;&lt;EM&gt;&lt;STRONG&gt;vTimePeriod&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt; &amp;amp; ' goes to ' &amp;amp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesPerson&lt;/SPAN&gt;, -(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;)+(&lt;SPAN style="color: #800000;"&gt;Quantity&lt;/SPAN&gt;/1000)+(&lt;SPAN style="color: #800000;"&gt;Hours&lt;/SPAN&gt;/1000), &lt;SPAN style="color: #800000;"&gt;SalesPersonID&lt;/SPAN&gt;)))&lt;/P&gt;&lt;P&gt;&amp;amp; ' selling '&amp;amp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Quantity&lt;/SPAN&gt;, -(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;)+(&lt;SPAN style="color: #800000;"&gt;Quantity&lt;/SPAN&gt;/1000)+(&lt;SPAN style="color: #800000;"&gt;Hours&lt;/SPAN&gt;/1000), &lt;SPAN style="color: #800000;"&gt;SalesPersonID&lt;/SPAN&gt;)))&lt;/P&gt;&lt;P&gt;&amp;amp; ' valued at '&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;, -(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;)+(&lt;SPAN style="color: #800000;"&gt;Quantity&lt;/SPAN&gt;/1000)+(&lt;SPAN style="color: #800000;"&gt;Hours&lt;/SPAN&gt;/1000), &lt;SPAN style="color: #800000;"&gt;SalesPersonID&lt;/SPAN&gt;)))&lt;/P&gt;&lt;P&gt;&amp;amp; 'in a ' &amp;amp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FirstSortedValue&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Hours&lt;/SPAN&gt;, -(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Max&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;SalesAmount&lt;/SPAN&gt;)+(&lt;SPAN style="color: #800000;"&gt;Quantity&lt;/SPAN&gt;/1000)+(&lt;SPAN style="color: #800000;"&gt;Hours&lt;/SPAN&gt;/1000), &lt;SPAN style="color: #800000;"&gt;SalesPersonID&lt;/SPAN&gt;)))&lt;/P&gt;&lt;P&gt;&amp;amp; 'period!'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's crude but it works for the most part. If anyone has any thoughts on how I can get this over the line, I'd greatly appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:28:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564327#M210625</guid>
      <dc:creator>ciaran_mcgowan</dc:creator>
      <dc:date>2014-04-11T09:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564328#M210626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using &lt;/P&gt;&lt;P&gt;FirstSortedValue(&lt;EM style="color: black; font-size: 14.0pt; font-family: 'Calibri','sans-serif';"&gt;DISTINCT&lt;/EM&gt;......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564328#M210626</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-11T09:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564329#M210627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was quick! But unfortunately you can't use DISTINCT() with FirstSortedValue().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564329#M210627</guid>
      <dc:creator>ciaran_mcgowan</dc:creator>
      <dc:date>2014-04-11T09:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564330#M210628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use Distinct..... It will give you syntax error but believe me, you can use....!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:42:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564330#M210628</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-11T09:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564331#M210629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the same question few months ago...&lt;/P&gt;&lt;P&gt;Rob Wunderlich has replied me as below...&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: 12.800000190734863px;"&gt;&lt;STRONG&gt;DISTINCT appeared in the doc some time back (I think an early QV10 SR) but the syntax checker was never updated. (or may have worked for a while -- can't recall). The red squiggle is probably why most people don't know about DISTINCT in FirstSortedValue &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="emoticon-inline emoticon_wink" style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;&lt;STRONG&gt;. &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:48:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564331#M210629</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-11T09:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564332#M210630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thank you so much for this! This will actually help a lot with some of my older applications too! DISTINCT was the first thing I tried using in cases like these but I never saved it because of the syntax errors!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Now I know that syntax errors don't always mean bad equations!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564332#M210630</guid>
      <dc:creator>ciaran_mcgowan</dc:creator>
      <dc:date>2014-04-11T09:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564333#M210631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;U can Try This One also u will also get the desired result&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=FirstSortedValue(SalesPerson,-Aggr(sum(Salesamount),SalesPersonID))&amp;nbsp; &amp;amp; ' - ' &amp;amp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max( Aggr(sum(Salesamount),SalesPersonID))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 10:08:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564333#M210631</guid>
      <dc:creator>nizamsha</dc:creator>
      <dc:date>2014-04-11T10:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Text Box: Show 1 out of Multiple Options</title>
      <link>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564334#M210632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this one to it will also bring the top sales person and salesamount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue(SalesPerson,-Aggr(sum(Salesamount),SalesPersonID))&amp;nbsp; &amp;amp; ' - ' &amp;amp; &lt;/P&gt;&lt;P&gt;Only( if( Aggr(rank(sum(Salesamount)),SalesPersonID)=1,Aggr( sum(Salesamount),SalesPersonID)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 10:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-Box-Show-1-out-of-Multiple-Options/m-p/564334#M210632</guid>
      <dc:creator>nizamsha</dc:creator>
      <dc:date>2014-04-11T10:17:03Z</dc:date>
    </item>
  </channel>
</rss>

