<?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 show data as in the order defined in query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312906#M93657</link>
    <description>&lt;P&gt;I have a chart shows counts of Policies under different Policy Amount ranges (eg: 10000-50000). &lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
index|rename Amount as a |eval range = case (a&amp;gt;=10000 and a &amp;lt;= 20000, "10 - 20k" , a&amp;gt;20000 and a &amp;lt;= 50000, "20 - 50k" ,a&amp;gt;50000 and a &amp;lt;= 100000, "50 - 100k" ,a&amp;gt;100000 and a &amp;lt;= 500000, "100 - 500k" ,a&amp;gt;=500000 , "&amp;gt;500k" )| stats count(Policies) by range&lt;/P&gt;

&lt;P&gt;It shows y axis data in chart in order as:&lt;/P&gt;

&lt;P&gt;10-20k&lt;BR /&gt;&lt;BR /&gt;
100-500k&lt;BR /&gt;&lt;BR /&gt;
20-50k&lt;BR /&gt;
50-100k&lt;BR /&gt;
500k&lt;/P&gt;

&lt;P&gt;It is taking ascending order and re ordering.&lt;BR /&gt;
But I want in the order I defined the ranges, otherwise chart will become irrelevent. &lt;/P&gt;

&lt;P&gt;I want it as :&lt;BR /&gt;
10-20k&lt;BR /&gt;
20-50k&lt;BR /&gt;
50-100k&lt;BR /&gt;
100-500k&lt;BR /&gt;
500k&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 17:17:11 GMT</pubDate>
    <dc:creator>dsiob</dc:creator>
    <dc:date>2017-07-13T17:17:11Z</dc:date>
    <item>
      <title>show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312906#M93657</link>
      <description>&lt;P&gt;I have a chart shows counts of Policies under different Policy Amount ranges (eg: 10000-50000). &lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
index|rename Amount as a |eval range = case (a&amp;gt;=10000 and a &amp;lt;= 20000, "10 - 20k" , a&amp;gt;20000 and a &amp;lt;= 50000, "20 - 50k" ,a&amp;gt;50000 and a &amp;lt;= 100000, "50 - 100k" ,a&amp;gt;100000 and a &amp;lt;= 500000, "100 - 500k" ,a&amp;gt;=500000 , "&amp;gt;500k" )| stats count(Policies) by range&lt;/P&gt;

&lt;P&gt;It shows y axis data in chart in order as:&lt;/P&gt;

&lt;P&gt;10-20k&lt;BR /&gt;&lt;BR /&gt;
100-500k&lt;BR /&gt;&lt;BR /&gt;
20-50k&lt;BR /&gt;
50-100k&lt;BR /&gt;
500k&lt;/P&gt;

&lt;P&gt;It is taking ascending order and re ordering.&lt;BR /&gt;
But I want in the order I defined the ranges, otherwise chart will become irrelevent. &lt;/P&gt;

&lt;P&gt;I want it as :&lt;BR /&gt;
10-20k&lt;BR /&gt;
20-50k&lt;BR /&gt;
50-100k&lt;BR /&gt;
100-500k&lt;BR /&gt;
500k&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 17:17:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312906#M93657</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-13T17:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312907#M93658</link>
      <description>&lt;P&gt;try this,&lt;/P&gt;

&lt;P&gt;your base query | table "10-20k", "20-50k","50-100k","100-500k","500k"&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 17:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312907#M93658</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-07-13T17:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312908#M93659</link>
      <description>&lt;P&gt;"10-20k", "20-50k","50-100k","100-500k","500k" are not colums, they are column values&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 10:26:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312908#M93659</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-19T10:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312909#M93660</link>
      <description>&lt;P&gt;Post the sample table.  Did you try with the query. Because your are group by range.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:26:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312909#M93660</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-07-19T14:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312910#M93661</link>
      <description>&lt;P&gt;Try like this (appending serial number will ensure properly sorted output after stats, last eval is to remove those prefix sno)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index|rename Amount as a |eval range = case (a&amp;gt;=10000 and a &amp;lt;= 20000, "1. 10 - 20k" , a&amp;gt;20000 and a &amp;lt;= 50000, "2. 20 - 50k" ,a&amp;gt;50000 and a &amp;lt;= 100000, "3. 50 - 100k" ,a&amp;gt;100000 and a &amp;lt;= 500000, "4. 100 - 500k" ,a&amp;gt;=500000 , "5. &amp;gt;500k" )| stats count(Policies) by range
| eval range=substr(range,4)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:52:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312910#M93661</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-19T14:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312911#M93662</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;source="Agent_Details_4.csv" host="397AD-1A210036" sourcetype="csv" | rename "FACE AMOUNT" as p | eval range=case(p&amp;gt;=0 AND p&amp;lt;=100000, "0-100 K", p&amp;gt;100000 AND p&amp;lt;=200000, "100-200 K",
  p&amp;gt;20000 AND p&amp;lt;=50000, "200-500 K",p&amp;gt;500000 AND p&amp;lt;=1000000, "500-1 M",p&amp;gt;1000000 ,  "&amp;gt;1M")|stats count as "Policy count" by range
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312911#M93662</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-19T15:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: show data as in the order defined in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312912#M93663</link>
      <description>&lt;P&gt;its working! thanks somesoni2&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 06:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-data-as-in-the-order-defined-in-query/m-p/312912#M93663</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-20T06:19:08Z</dc:date>
    </item>
  </channel>
</rss>

