<?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: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365987#M107945</link>
    <description>&lt;P&gt;Your sample data has 9 rows instead of 11 rows you mentioned. Should the sum of last 6 (or 4) include the cumulative sum or just sum of last 6(or 4)?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2017 14:48:00 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-11-10T14:48:00Z</dc:date>
    <item>
      <title>sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365985#M107943</link>
      <description>&lt;P&gt;i have 11 rows as output of my search query.Which looks like below&lt;BR /&gt;
Example&lt;BR /&gt;
field1     field2&lt;BR /&gt;
co                 10&lt;BR /&gt;
im                 10&lt;BR /&gt;
ae                 10&lt;BR /&gt;
be                  10&lt;BR /&gt;
iapp             10&lt;BR /&gt;
idec              10&lt;BR /&gt;
ienp              20&lt;BR /&gt;
imain            30&lt;BR /&gt;
inet               40&lt;/P&gt;

&lt;P&gt;How can i alphabetically sort first 5 rows then get the total in lext row and then next 6 lines sort alphabetically and get sum in the last row . &lt;BR /&gt;
I want the output like below&lt;/P&gt;

&lt;P&gt;Example output&lt;BR /&gt;
field1     field2&lt;BR /&gt;
iapp             10&lt;BR /&gt;
idec              10&lt;BR /&gt;
ienp              20&lt;BR /&gt;
imain            30&lt;BR /&gt;
inet               40&lt;BR /&gt;
Total             110&lt;BR /&gt;
co                 10&lt;BR /&gt;
im                 10&lt;BR /&gt;
ae                 10&lt;BR /&gt;
be                  10&lt;BR /&gt;
Total             150&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 13:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365985#M107943</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2017-11-10T13:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365986#M107944</link>
      <description>&lt;P&gt;Take a look at union.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Union"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Union&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 13:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365986#M107944</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2017-11-10T13:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365987#M107945</link>
      <description>&lt;P&gt;Your sample data has 9 rows instead of 11 rows you mentioned. Should the sum of last 6 (or 4) include the cumulative sum or just sum of last 6(or 4)?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 14:48:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365987#M107945</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-10T14:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365988#M107946</link>
      <description>&lt;P&gt;@surekhasplunk, I could not figure out a way to do this in single search because you need to many things to be done. I could not get what kind of sort you have applied. The data does not seem to be sorted ascending or descending. However, just to keep first five field1 starting with &lt;CODE&gt;i&lt;/CODE&gt; in the first table I have applied reverse sort. Please see If the following output will suffice the need.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3847i7F0BF07337AAB61D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
In order to get the above output following steps have been taken.&lt;BR /&gt;
&lt;STRONG&gt;Step 1&lt;/STRONG&gt; Create your query to get stats as &lt;CODE&gt;field2&lt;/CODE&gt; for field1 values. Save as &lt;CODE&gt;Base&lt;/CODE&gt; Search for post processing. Following is a run anywhere search for example, but you should replace with your own.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;search id="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;|  makeresults
  |  eval data="co 10;im 10;ae 10;be 10;iapp 10;idec 10;ienp 20;imain 30;inet 40"
  |  makemv data delim=";"
  |  mvexpand data
  |  eval data=split(data," ")
  |  eval field1=mvindex(data,0)
  |  eval field2=mvindex(data,1)
  |  table field1 field2
  |  sort - field1&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="tokTailCounter"&amp;gt;$job.resultCount$-5&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Step 2&lt;/STRONG&gt;: Add &lt;CODE&gt;&amp;lt;done&amp;gt;&lt;/CODE&gt; Search Event Handler to get the remaining row count or &lt;CODE&gt;total results - 5&lt;/CODE&gt; as above.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Step 3&lt;/STRONG&gt;: &lt;BR /&gt;
&lt;STRONG&gt;a)&lt;/STRONG&gt; Create first table for first five rows of base search using &lt;CODE&gt;| head 5&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;b)&lt;/STRONG&gt; Use &lt;CODE&gt;eventstats&lt;/CODE&gt; to get total of first five rows and attach to 5 rows as &lt;CODE&gt;cumuField2&lt;/CODE&gt;.&lt;BR /&gt;
&lt;STRONG&gt;c)&lt;/STRONG&gt; Use &lt;CODE&gt;addcoltotals&lt;/CODE&gt; command to get total of five rows and display as &lt;CODE&gt;Total&lt;/CODE&gt; in a new row.&lt;BR /&gt;
&lt;STRONG&gt;d)&lt;/STRONG&gt; Use &lt;CODE&gt;&amp;lt;done &amp;gt;&lt;/CODE&gt; Search Event Handler to set the token for total of first five rows set in &lt;CODE&gt;cumuField2&lt;/CODE&gt; as &lt;CODE&gt;tokFirst5RowsTotal&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;e)&lt;/STRONG&gt; Use the Table Simple XML configuration &lt;CODE&gt;&amp;lt;fields&amp;gt;&lt;/CODE&gt; to show only &lt;CODE&gt;field1&lt;/CODE&gt; and &lt;CODE&gt;field2&lt;/CODE&gt; and hide column &lt;CODE&gt;cumuField2&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;|  head 5
          | eventstats sum(field2) as cumuField2
          | addcoltotals field2 label="Total" labelfield="field1"&amp;lt;/query&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="tokFirst5RowsTotal"&amp;gt;$result.cumuField2$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;fields&amp;gt;field1,field2&amp;lt;/fields&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Step 4&lt;/STRONG&gt; : Prepare the second table with remaining rows and overall total of all the rows.&lt;BR /&gt;
&lt;STRONG&gt;a)&lt;/STRONG&gt; Create second table to display remaining rows from base search. Give it id="myTable2"&lt;BR /&gt;
&lt;STRONG&gt;b)&lt;/STRONG&gt; Use the tail command with &lt;CODE&gt;$tokTailCounter$&lt;/CODE&gt;set in the base search to show remaining results other than first 5.&lt;BR /&gt;
&lt;STRONG&gt;c)&lt;/STRONG&gt; Use &lt;CODE&gt;addcoltotals&lt;/CODE&gt; to get a total of remaining rows in the second table as new row Total.&lt;BR /&gt;
&lt;STRONG&gt;d)&lt;/STRONG&gt; Use eval to add the total of first five rows from first table (i.e. &lt;CODE&gt;$tokFirst5RowsTotal$&lt;/CODE&gt;) to the Total calculated in previous step.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;table id="myTable2"&amp;gt;
    &amp;lt;search base="baseSearch"&amp;gt;
      &amp;lt;query&amp;gt;| tail $tokTailCounter$
      | addcoltotals  field2 label="Total" labelfield="field1"
      | eval field2=if(field1=="Total",field2+$tokFirst5RowsTotal$,field2)&amp;lt;/query&amp;gt;
    &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Step 5&lt;/STRONG&gt;: Create an html panel with CSS to hide the table header of second table using selector based on table 2 id i.e. &lt;CODE&gt;myTable2&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html depends="$alwaysHideCSSStyle$"&amp;gt;
        &amp;lt;style&amp;gt;
          #myTable2 thead{
            visibility:hidden;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the complete run anywhere Dashboard code based on sample data provided and used in the screenshot above:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Sort and Add&amp;lt;/label&amp;gt;
  &amp;lt;search id="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;|  makeresults
  |  eval data="co 10;im 10;ae 10;be 10;iapp 10;idec 10;ienp 20;imain 30;inet 40"
  |  makemv data delim=";"
  |  mvexpand data
  |  eval data=split(data," ")
  |  eval field1=mvindex(data,0)
  |  eval field2=mvindex(data,1)
  |  table field1 field2
  |  sort - field1&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;eval token="tokTailCounter"&amp;gt;$job.resultCount$-5&amp;lt;/eval&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;|  head 5
          | eventstats sum(field2) as cumuField2
          | addcoltotals field2 label="Total" labelfield="field1"&amp;lt;/query&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="tokFirst5RowsTotal"&amp;gt;$result.cumuField2$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;fields&amp;gt;field1,field2&amp;lt;/fields&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html depends="$alwaysHideCSSStyle$"&amp;gt;
        &amp;lt;style&amp;gt;
          #myTable2 thead{
            visibility:hidden;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="myTable2"&amp;gt;
        &amp;lt;search base="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;| tail $tokTailCounter$
          | addcoltotals  field2 label="Total" labelfield="field1"
          | eval field2=if(field1=="Total",field2+$tokFirst5RowsTotal$,field2)&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: I hope experts might be able to give more direct approach to this using Single search as this is a bit roundabout method, however, I have used Post processing to ensure that results are fetched only once and the other two searches for two tables are on two separate subset from the base search using &lt;CODE&gt;head&lt;/CODE&gt; and &lt;CODE&gt;tail&lt;/CODE&gt; commands.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365988#M107946</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-10T15:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365989#M107947</link>
      <description>&lt;P&gt;@somesoni2, I have posted an answer with two separate searches for first five rows and remaining rows respectively. I am sure you have a single query in mind to do this. I will be waiting for your answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365989#M107947</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-10T15:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365990#M107948</link>
      <description>&lt;P&gt;Hi @somesoni2,&lt;BR /&gt;
I need sum of first 5 rows sum as total which is 110 . And then at the end sum of first 5 + last 4 values summing as total of 150. &lt;BR /&gt;
field1 field2&lt;BR /&gt;
iapp 10&lt;BR /&gt;
idec 10&lt;BR /&gt;
ienp 20&lt;BR /&gt;
imain 30&lt;BR /&gt;
inet 40&lt;BR /&gt;
Total 110&lt;BR /&gt;
co 10&lt;BR /&gt;
im 10&lt;BR /&gt;
ae 10&lt;BR /&gt;
be 10&lt;BR /&gt;
Total 150&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:13:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365990#M107948</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2017-11-10T15:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365991#M107949</link>
      <description>&lt;P&gt;Hi @somesoni2,&lt;BR /&gt;
I need sum of first 5 rows sum as total which is 110 . And then at the end sum of first 5 + last 4 values summing as total of 150. &lt;BR /&gt;
field1 field2&lt;BR /&gt;
iapp 10&lt;BR /&gt;
idec 10&lt;BR /&gt;
ienp 20&lt;BR /&gt;
imain 30&lt;BR /&gt;
inet 40&lt;BR /&gt;
Total 110&lt;BR /&gt;
co 10&lt;BR /&gt;
im 10&lt;BR /&gt;
ae 10&lt;BR /&gt;
be 10&lt;BR /&gt;
Total 150&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365991#M107949</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2017-11-10T15:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365992#M107950</link>
      <description>&lt;P&gt;Thanks @niketnilay for sample event generating search. Here is my attempt to do that in single search. Everything before &lt;CODE&gt;| sort -field1&lt;/CODE&gt; is to generate sample data, replace that with your search. To understand the logic better, add one command at a time and see the result.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1  |  eval data="co 10;im 10;ae 10;be 10;iapp 10;idec 10;ienp 20;imain 30;inet 40" |  makemv data delim=";" |  mvexpand data
 |  eval data=split(data," ")  |  eval field1=mvindex(data,0) |  eval field2=mvindex(data,1)  |  table field1 field2   
|  sort - field1
| addcoltotals label=Total labelfield=field1 | streamstats count as sno
| appendpipe [| head 5 | addcoltotals label=Total labelfield=field1 | eval keep="Y" ]
| appendpipe [| where NOT keep="Y" AND sno&amp;gt;5 | eval keep="Y" ] | where keep="Y" | table field1 field2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365992#M107950</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-10T15:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365993#M107951</link>
      <description>&lt;P&gt;@somesoni2, you are the boss &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 15:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365993#M107951</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-10T15:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365994#M107952</link>
      <description>&lt;P&gt;Thanks a lot @somesoni2 and @niketnilay for this single search it worked perfect for me. Thanks a lot ... cheers...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 12:02:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365994#M107952</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2017-11-13T12:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: sort first 5 rows alphabetically then get total count then next 6 rows alphabetically and get the total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365995#M107953</link>
      <description>&lt;P&gt;Hi @niketnilay &amp;amp; @somesoni2&lt;/P&gt;

&lt;P&gt;With your suggestion right now am using below code to sort first 7 rows then add IT Operations-overall in a row and then at the end CTO total row which sums all which works perfectly. &lt;BR /&gt;
| addcoltotals label="CTO TOTAL" labelfield="Business Area" | streamstats count as sno&lt;BR /&gt;
 | appendpipe [| head 7 | addcoltotals label="IT OPERATIONS - OVERALL" labelfield="Business Area" | eval keep="Y" ]&lt;BR /&gt;
 | appendpipe [| where NOT keep="Y" AND sno&amp;gt;7 | eval keep="Y" ] | where keep="Y"&lt;/P&gt;

&lt;P&gt;But problem is if am choosing a single value from dropdown then for a single row also am getting IT operations overall and CTO Total &lt;BR /&gt;
which is wrong . So if i select single value from dropdown then i should not show both the calculated values. &lt;BR /&gt;
Is it possible ?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 10:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-first-5-rows-alphabetically-then-get-total-count-then-next/m-p/365995#M107953</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2017-12-05T10:43:38Z</dc:date>
    </item>
  </channel>
</rss>

