<?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: How can I change the order of the fields in my piechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308944#M92663</link>
    <description>&lt;P&gt;If your problem is resolved, please accept an answer (even if it's your own).&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2017 19:41:03 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2017-08-29T19:41:03Z</dc:date>
    <item>
      <title>How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308937#M92656</link>
      <description>&lt;P&gt;I have the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....| eval "cs"=case(CallRate&amp;lt;=250,"Under 250 kps", CallRate&amp;lt;=500,"Under 500 kps", CallRate&amp;lt;=750,"Under 750 kps", CallRate&amp;lt;=1000,"Under 1000 kps", CallRate&amp;lt;=1250,"Under 1250 kps",  CallRate&amp;gt;1250, "Above 1250 kps") | stats count by cs | eval cs=cs+" -- "+count + "calls"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to make the piechart easy for my client to understand but the fields in the piechart organize themselves alphabetically. Is there a way I could sort them by the original way like above? The following is the result piechart:&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/3426i8F4EC494BDB072B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want it to be in this order:&lt;BR /&gt;
Under 250 kps, Under 500 kps, Under 750 kps, Under 1000 kps, Under1250 kps, Above 1250 kps&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 15:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308937#M92656</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-08-29T15:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308938#M92657</link>
      <description>&lt;P&gt;You can force an order by adding a numeric field to sort against.  See this example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval "cs"=case(CallRate&amp;lt;=250,"Under 250 kps", CallRate&amp;lt;=500,"Under 500 kps", CallRate&amp;lt;=750,"Under 750 kps", CallRate&amp;lt;=1000,"Under 1000 kps", CallRate&amp;lt;=1250,"Under 1250 kps", CallRate&amp;gt;1250, "Above 1250 kps") | eval sortOrder=case(CallRate&amp;lt;=250,1, CallRate&amp;lt;=500,2, CallRate&amp;lt;=750,3, CallRate&amp;lt;=1000,4, CallRate&amp;lt;=1250,5, CallRate&amp;gt;1250, 6) | stats count values(sortOrder) as sortOrder by cs | eval cs=cs+" -- "+count + "calls" | sort sortOrder
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 16:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308938#M92657</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-29T16:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308939#M92658</link>
      <description>&lt;P&gt;this doesn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
The fields in the piechart don't get sort and in addition it make everything harder to read. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308939#M92658</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-08-29T17:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308940#M92659</link>
      <description>&lt;P&gt;@tamduong16, sequence them in your &lt;CODE&gt;case()&lt;/CODE&gt; function so that they get automatically sorted. Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval "cs"=case(CallRate&amp;lt;=250,"1. Under 250 kps", CallRate&amp;lt;=500,"2. Under 500 kps", CallRate&amp;lt;=750,"3. Under 750 kps", CallRate&amp;lt;=1000,"4. Under 1000 kps", CallRate&amp;lt;=1250,"5. Under 1250 kps",  CallRate&amp;gt;1250, "6. Above 1250 kps") 
| stats count by cs 
| eval cs=cs+" -- "+count + "calls"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:18:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308940#M92659</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-29T17:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308941#M92660</link>
      <description>&lt;P&gt;Hmm...  It works on my laptop under Splunk 6.6.2.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308941#M92660</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-29T17:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308942#M92661</link>
      <description>&lt;P&gt;Thanks for the idea. It works but give me unwanted numeric at the beginning which I could write another eval expression to resolve that and work perfect. Here is the eval expression I added in.&lt;/P&gt;

&lt;P&gt;| eval "cs"=case(CallRate&amp;lt;=250,"1.Under 250kps", CallRate&amp;lt;=500,"2.Under 500kps", CallRate&amp;lt;=750,"3.Under 750kps", CallRate&amp;lt;=1000,"4.Under 1000kps", CallRate&amp;lt;=1250,"5.Under 1250kps",  CallRate&amp;gt;1250, "6.Above 1250kps")  |  stats count by cs| eval "cs"=replace('cs',"^(\d{1}).","") &lt;BR /&gt;
| eval cs=cs+" -- "+count + "calls"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 19:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308942#M92661</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-08-29T19:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308943#M92662</link>
      <description>&lt;P&gt;| eval "cs"=case(CallRate&amp;lt;=250,"1.Under 250kps", CallRate&amp;lt;=500,"2.Under 500kps", CallRate&amp;lt;=750,"3.Under 750kps", CallRate&amp;lt;=1000,"4.Under 1000kps", CallRate&amp;lt;=1250,"5.Under 1250kps", CallRate&amp;gt;1250, "6.Above 1250kps") | stats count by cs| eval "cs"=replace('cs',"^(\d{1}).","") &lt;BR /&gt;
| eval cs=cs+" -- "+count + "calls"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 19:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308943#M92662</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2017-08-29T19:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the order of the fields in my piechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308944#M92663</link>
      <description>&lt;P&gt;If your problem is resolved, please accept an answer (even if it's your own).&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 19:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-change-the-order-of-the-fields-in-my-piechart/m-p/308944#M92663</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-29T19:41:03Z</dc:date>
    </item>
  </channel>
</rss>

