<?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: Determining if first item in set is selected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426677#M558872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;{&amp;lt;EVENT_NUMBER= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is set analysis syntax. It says 'ignore selection in EVENT_NUMBER when calculating the aggregation I am embedded in' (i.e. the sum(EVENT_COUNT) ).&lt;/P&gt;&lt;P&gt;You need to ignore the selection, otherwise the rank will always be determined on the selected subset of EVENT_NUMBER (while you need the global rank, not affected by selection, right?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The max( aggr( rank(...), EVENT_NUMBER)) is then just calculating the max rank out of your selected EVENT_NUMBER (here, it is important to only look at the selected items, so no set analysis part required here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 May 2013 16:11:40 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-05-31T16:11:40Z</dc:date>
    <item>
      <title>Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426672#M558866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Title Expression that changes based on selection of field EVENT_NUMBER.&amp;nbsp; If no selections, then title includes 'ALL' in text displayed, otherwise it displays 'TOP' with a selected count.&amp;nbsp; This is fine as long as the first through n EVENTS are selected.&amp;nbsp; Below is the expression to accomplish this.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IsNull&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EVENT_NUMBER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), ' ' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetSelectedCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EVENT_NUMBER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&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; ,'ALL'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&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; , 'TOP ' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetSelectedCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EVENT_NUMBER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &amp;amp; ' EVENTS LAST 30 DAYS', ' ' &amp;amp; 'EVENT: ' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EVENT_NUMBER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&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;I would like to display 'VARIOUS EVENTS LAST 30 DAYS' if a non-sequential set of Events are selected or if a sequential set not starting from the top.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 22:41:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426672#M558866</guid>
      <dc:creator />
      <dc:date>2013-05-30T22:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426673#M558867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your EVENT_NUMBER field shows integer numbers from 1 to X, and top means 1, you can try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(EVENT_NUMBER)=Max(EVENT_NUMBER),'Sequential from Top','Non sequential or not starting from Top')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 23:59:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426673#M558867</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-05-30T23:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426674#M558868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EVENT_NUMBERS are not sequential but are sorted by rank in my straight table, i.e.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; num&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;rank&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;EVENT_COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),4,1)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 00:10:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426674#M558868</guid>
      <dc:creator />
      <dc:date>2013-05-31T00:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426675#M558870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should be possible to use the rank instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(GetSelectedCount(EVENT_NUMBER) = Max(aggr(rank(sum({&amp;lt;EVENT_NUMBER=&amp;gt;} EVENT_COUNT),4,1), EVENT_NUMBER)), 'Sequential from Top','Non sequential from Top')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 10:07:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426675#M558870</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-05-31T10:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426676#M558871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for this Expression, it works perfectly!&amp;nbsp; That being said, not so sure I understand the syntax and how it actually works &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;...not sure what the curly backets functionality is?&amp;nbsp;&amp;nbsp; I greatly appreciate you help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Lew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 14:05:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426676#M558871</guid>
      <dc:creator />
      <dc:date>2013-05-31T14:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426677#M558872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;{&amp;lt;EVENT_NUMBER= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is set analysis syntax. It says 'ignore selection in EVENT_NUMBER when calculating the aggregation I am embedded in' (i.e. the sum(EVENT_COUNT) ).&lt;/P&gt;&lt;P&gt;You need to ignore the selection, otherwise the rank will always be determined on the selected subset of EVENT_NUMBER (while you need the global rank, not affected by selection, right?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The max( aggr( rank(...), EVENT_NUMBER)) is then just calculating the max rank out of your selected EVENT_NUMBER (here, it is important to only look at the selected items, so no set analysis part required here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 16:11:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426677#M558872</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-05-31T16:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Determining if first item in set is selected</title>
      <link>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426678#M558873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very much appreciated!&amp;nbsp; As I've not had any formal set analysis training I have had to pick this stuff up as I go. Your explanation helps tremendously. Glad there are so many folks such as yourself who have been quick to answer questions as they arise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've learned more about QV from the QV Community than any other source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Lew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 16:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determining-if-first-item-in-set-is-selected/m-p/426678#M558873</guid>
      <dc:creator />
      <dc:date>2013-05-31T16:16:15Z</dc:date>
    </item>
  </channel>
</rss>

