<?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: Ranking rows in a Table based on count using Transpose &amp; Timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134470#M36743</link>
    <description>&lt;P&gt;What version of Splunk are you using?&lt;/P&gt;

&lt;P&gt;Sorry i don't have a Splunk instance to test with at the moment, but the pivot command gives you more levels of control on a visualisation than the chart command.  Previously, I've used had to the use the pivot command instead of the chart command to add extra levels of visualisations that the chart command doesn't support.&lt;/P&gt;

&lt;P&gt;Hopefully researching the pivot command gives you some ideas. If it doesn't can you post the search you're using, and the results you're seeing? &lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2015 20:52:42 GMT</pubDate>
    <dc:creator>davebrooking</dc:creator>
    <dc:date>2015-06-04T20:52:42Z</dc:date>
    <item>
      <title>Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134467#M36740</link>
      <description>&lt;P&gt;I want something like below in the table.           &lt;/P&gt;

&lt;P&gt;Channel Name    25-Mar-15   26-Mar-15   27-Mar-15   28-Mar-15   29-Mar-15   30-Mar-15   31-Mar-15&lt;/P&gt;

&lt;P&gt;BT Sports1  3   1   4   8   1   5   8&lt;BR /&gt;
BT Sports2  2   2   2   9   10  7   9&lt;BR /&gt;
Channel3    4   59  44  1   13  3   1&lt;BR /&gt;
BT TV Preview   20  53  47  3   32  6   3&lt;BR /&gt;
Animal Planet   9   28  21  2   12  8   2&lt;BR /&gt;
Universal    5  23  22  4   11  4   4&lt;BR /&gt;
Nat Geo Wild    10  28  23  16  3   2   16&lt;BR /&gt;
Discovery   8   19  12  15  9   15  13  9&lt;BR /&gt;
Nat Geo     39  40  35  34  36  33  34&lt;BR /&gt;
History 3   9   5   6   2   15  6&lt;BR /&gt;
GOLD    26  8   13  7   10  12  7&lt;BR /&gt;
FOX 34  7   14  5   5   39  5&lt;BR /&gt;
MTV 35  55  12  22  16  40  22&lt;BR /&gt;
SyFy    14      11  12  4   19  12&lt;BR /&gt;
Comedy Central  18  52  53  55  17  9   55&lt;BR /&gt;
E!  43  6   6   10  47  10  10&lt;BR /&gt;
Watch   19  5   7   9   8   1   9&lt;BR /&gt;
Alibi   18  16  57  57  8   7   11  8&lt;BR /&gt;
Boomerang   19  52  13  9   11  6   44  11&lt;BR /&gt;
CI  20  19  4   8   59  9   13  59&lt;/P&gt;

&lt;P&gt;The Numbers mentioned in the table are nothing but ranking based on the view count of each channel on the specified date. E.g. BT Sports1 is at 3rd postion on 25-Mar-15 and 1st position on 26-Mar-15 and these ranks are calculated based on number of views of BT Sports1 on 25-Mar-15 &amp;amp; 26-Mar-15. &lt;/P&gt;

&lt;P&gt;My Query :&lt;BR /&gt;
sourcetype=retsessions Severity="INFO" NOT source=/var/log/ret_channel_stats/RetStats_18-9-2014_19-43.txt | bin _time span=1d | convert ctime(_time) timeformat="%d-%b-%y" | chart sum(Viewers) as Total over Channel by _time &lt;/P&gt;

&lt;P&gt;Result from my query :&lt;BR /&gt;
Channel 01-Jun-15   31-May-15&lt;BR /&gt;
Alibi   17796   44990&lt;BR /&gt;
Animal Planet   13782   31488&lt;BR /&gt;
Animal Planet HD    1684    3731&lt;BR /&gt;
BBC 2 HD    11317   45169&lt;/P&gt;

&lt;P&gt;Here the numbers are the number of views but not the ranks. I want to show the ranks in place view count. Maximum count for a day will be ranked 1st and minimum will be ranked last. Can Streamstats be used here? Please reply.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:07:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134467#M36740</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2020-09-28T20:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134468#M36741</link>
      <description>&lt;P&gt;sourcetype=retsessions Severity="INFO" NOT source=/var/log/ret_channel_stats/RetStats_18-9-2014_19-43.txt | bin _time span=1d | convert ctime(_time) timeformat="%d-%b-%y" | chart sum(Viewers) as Total over Channel by _time&lt;/P&gt;

&lt;P&gt;I can't see how to do more than 1 day at the same time, but here is how to do a single day (or I should say how to do all days, unless your &lt;CODE&gt;timepicker&lt;/CODE&gt; is set to do just 1 day):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=retsessions Severity="INFO" NOT source=/var/log/ret_channel_stats/RetStats_18-9-2014_19-43.txt |  chart count as Total by Channel| sort -Total | streamstats count as rank
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134468#M36741</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-09-28T20:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134469#M36742</link>
      <description>&lt;P&gt;Hi woodcock. Appreciate your answer but i have already tried this. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/241901/ranking-rows-in-a-table-based-on-the-count.html"&gt;http://answers.splunk.com/answers/241901/ranking-rows-in-a-table-based-on-the-count.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;My client specifically told to filter the ranks for each day so i can't show him for all days. Any other ideas will be highly entertained.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 06:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134469#M36742</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2015-06-04T06:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134470#M36743</link>
      <description>&lt;P&gt;What version of Splunk are you using?&lt;/P&gt;

&lt;P&gt;Sorry i don't have a Splunk instance to test with at the moment, but the pivot command gives you more levels of control on a visualisation than the chart command.  Previously, I've used had to the use the pivot command instead of the chart command to add extra levels of visualisations that the chart command doesn't support.&lt;/P&gt;

&lt;P&gt;Hopefully researching the pivot command gives you some ideas. If it doesn't can you post the search you're using, and the results you're seeing? &lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 20:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134470#M36743</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2015-06-04T20:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134471#M36744</link>
      <description>&lt;P&gt;I have already used pivot command but unfortunately pivot doesn't solve my issue. I have posted the search and the results. Please have a look&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 06:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134471#M36744</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2015-06-05T06:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134472#M36745</link>
      <description>&lt;P&gt;OK, this works, but it is &lt;EM&gt;not&lt;/EM&gt; dynamic; it is an iterative approach that has to be hand-crafted (hard-coded and iterated out) for every date grouping.  But it works.  For your exact search (including &lt;CODE&gt;timepicker&lt;/CODE&gt; value):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=retsessions Severity="INFO" NOT source=/var/log/ret_channel_stats/RetStats_18-9-2014_19-43.txt | bin _time span=1d | convert ctime(_time) timeformat="%d-%b-%y" | chart sum(Viewers) as Total over Channel by _time
| sort 0 - "01-Jun-15" | transpose | rename row* AS * | rename column AS rank | transpose | where column!="rank" | rename column AS "01-Jun-15" "row 1" AS Channel "row 3" AS "31-May-15" | fields Channel "01-Jun-15" "31-May-15"
| sort 0 - "31-May-15" | transpose | rename row* AS * | rename column AS rank | transpose | where column!="rank" | rename column AS "31-May-15" "row 1" AS Channel "row 2" AS "01-Jun-15" | fields Channel "01-Jun-15" "31-May-15"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jun 2015 16:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134472#M36745</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-05T16:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134473#M36746</link>
      <description>&lt;P&gt;Did you try this?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2015 23:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134473#M36746</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-08T23:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134474#M36747</link>
      <description>&lt;P&gt;No, actually all the above are hardcoded values which i cannot use. I figured out another way to do this.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 06:28:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134474#M36747</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2015-07-09T06:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134475#M36748</link>
      <description>&lt;P&gt;Do post your solution as an answer and then Accept it; I am curious how you solved it!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 14:05:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134475#M36748</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-09T14:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134476#M36749</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I figured out below way to do this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=shmapplogs "getMS3SAS ended for - deviceId" | bucket span=1d _time | stats count by _time channelId | sort count desc | lookup youview_channels.csv service_id_truncated AS channelId OUTPUT channel_name_letter | streamstats count AS position by _time | fields channel_name_letter position _time | convert timeformat="%d-%b-%Y" ctime(_time) As Time | chart max(position) over channel_name_letter by Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query is giving me a priority view per day&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 17:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134476#M36749</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2015-07-09T17:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134477#M36750</link>
      <description>&lt;P&gt;Very well done!  It does not handle ties but other than that, it is great!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 17:52:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134477#M36750</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-09T17:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134478#M36751</link>
      <description>&lt;P&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 05:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134478#M36751</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2015-07-10T05:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134479#M36752</link>
      <description>&lt;P&gt;If you insert this, you will fix ties, too:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats max(position) AS position by count _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2015 13:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134479#M36752</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-10T13:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking rows in a Table based on count using Transpose &amp; Timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134480#M36753</link>
      <description>&lt;P&gt;Hi woodcock! Do you know any way to sort the above column names based on the dates mentioned in the column names e.g 30-May-2015 should come first followed by 31-May-2015 &amp;amp; 01-Jun-2015 and so on. Currently it's showing 01-Jun-2015 30-May-2015 31-May-2015 for my query. Its sorting automatically based on the day of the date mentioned in the column. I want it to sort based on the entire date and not just the day. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 10:04:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ranking-rows-in-a-Table-based-on-count-using-Transpose-Timechart/m-p/134480#M36753</guid>
      <dc:creator>kabiraj</dc:creator>
      <dc:date>2015-07-23T10:04:56Z</dc:date>
    </item>
  </channel>
</rss>

