<?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: Sorting with Currency Symbol Appended to value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173654#M49803</link>
    <description>&lt;P&gt;Okay this works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| bucket _time span=1d 
| stats sum(kbps) as mySum by series 
| chart first(mySum) as TotalPrice by series 
| eval TotalPrice=TotalPrice +" $"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the main problem is the &lt;CODE&gt;tostring((TotalPrice/1000),"commas")&lt;/CODE&gt; this will &lt;I&gt;break&lt;/I&gt; the sorting not because it is a string, but because you add the comma as thousands delimiter....&lt;/P&gt;</description>
    <pubDate>Thu, 22 May 2014 12:54:02 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-05-22T12:54:02Z</dc:date>
    <item>
      <title>Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173648#M49797</link>
      <description>&lt;P&gt;I have a query like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(Price) as TotalPrice by SellerId,Category | fieldformat TotalPrice  = "$"+ tostring((TotalPrice/1000),"commas") | chart first(TotalPrice) as TotalPrice over SellerId by Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the '$' sign is not appended in the results.&lt;/P&gt;

&lt;P&gt;Then I tried &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(Price) as TotalPrice by SellerId,Category | eval TotalPrice  = "$".tostring((TotalPrice/1000),"commas") | chart first(TotalPrice) as TotalPrice over SellerId by Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now i get the $ sign but the columns cannot be sorted according to price as TotalPrice gets converted to string once i use eval.&lt;/P&gt;

&lt;P&gt;Is there a way i can append $ sign and still sort according to numerical value?&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 08:38:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173648#M49797</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2014-05-21T08:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173649#M49798</link>
      <description>&lt;P&gt;Hi adityapavan18,&lt;/P&gt;

&lt;P&gt;regarding the sorting take this run everywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=-15m@m 
| bucket _time span=1m 
| stats sum(kbps) as mySum by series 
| eval mySum=tostring((mySum/1000),"commas") 
| eval  TotalPrice  = "$ "+ mySum 
| sort -TotalPrice
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will sort the results by descending &lt;CODE&gt;TotalPrice&lt;/CODE&gt; or you are able to &lt;CODE&gt;click&lt;/CODE&gt; on the &lt;CODE&gt;TotalPrice&lt;/CODE&gt; column to re-sort it.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 09:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173649#M49798</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-21T09:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173650#M49799</link>
      <description>&lt;P&gt;Thanks Mus for Response.&lt;BR /&gt;
In Dashboard I have I want the user to click on column name and sort ascending or descending order&lt;BR /&gt;
SO cannot use the 1st query u provided.&lt;/P&gt;

&lt;P&gt;On second search query in your answer, I just get a blank column called TotalPrice but no other column has $ appended to value.&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 09:23:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173650#M49799</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2014-05-21T09:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173651#M49800</link>
      <description>&lt;P&gt;Yeah it works if query ends there... but I have a chart after that and as soon as I add a chart command after that i lose the $ symbol&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 13:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173651#M49800</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2014-05-21T13:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173652#M49801</link>
      <description>&lt;P&gt;coming back to the run everywhere command, append &lt;CODE&gt;chart&lt;/CODE&gt; and still I'm able to either sort and/or click in the UI to sort the $ value column:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal earliest=-15m@m 
| bucket _time span=1m 
| stats sum(kbps) as mySum by series 
| eval mySum=tostring((mySum/1000),"commas") 
| eval  TotalPrice  = "$ "+ mySum 
| chart first(TotalPrice) as myFirst by series
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 May 2014 13:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173652#M49801</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-21T13:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173653#M49802</link>
      <description>&lt;P&gt;yeah clicking the column sorts considering the values as strings so in ascending order values will look like&lt;/P&gt;

&lt;P&gt;$ 346575&lt;BR /&gt;
$ 44&lt;BR /&gt;
$ 738&lt;BR /&gt;
$74&lt;/P&gt;

&lt;P&gt;which is not correct&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 12:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173653#M49802</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2014-05-22T12:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173654#M49803</link>
      <description>&lt;P&gt;Okay this works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
| bucket _time span=1d 
| stats sum(kbps) as mySum by series 
| chart first(mySum) as TotalPrice by series 
| eval TotalPrice=TotalPrice +" $"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the main problem is the &lt;CODE&gt;tostring((TotalPrice/1000),"commas")&lt;/CODE&gt; this will &lt;I&gt;break&lt;/I&gt; the sorting not because it is a string, but because you add the comma as thousands delimiter....&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 12:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173654#M49803</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-22T12:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173655#M49804</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; This is a long comments section, very much appreciate all the help you are providing.&lt;/P&gt;

&lt;P&gt;I guess to achieve what i want i have to put currency symbol at end than start.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 13:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173655#M49804</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2014-05-22T13:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting with Currency Symbol Appended to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173656#M49805</link>
      <description>&lt;P&gt;you're welcome - you can show your support by donating some karma or sending some beers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2014 13:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-with-Currency-Symbol-Appended-to-value/m-p/173656#M49805</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-22T13:23:34Z</dc:date>
    </item>
  </channel>
</rss>

