<?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 to rearrange the columns of a cart command in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291289#M39184</link>
    <description>&lt;P&gt;Many Thanks, this worked for me..&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2017 11:58:45 GMT</pubDate>
    <dc:creator>Trishant</dc:creator>
    <dc:date>2017-07-07T11:58:45Z</dc:date>
    <item>
      <title>How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291285#M39180</link>
      <description>&lt;P&gt;I have used this query-&lt;/P&gt;

&lt;P&gt;sourcetype="sample data_ui performance" boxtype= "cisco*" build="RC24" | sort +iteration|  eval testId = testId + ": " + testcase | &lt;BR /&gt;
rename testId as Test_CaseID, build as Build, duration as Time_Taken | &lt;BR /&gt;
chart values(Time_Taken) over Test_CaseID by iteration limit=20 |&lt;/P&gt;

&lt;P&gt;and as a result I got &lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/207743-capture.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Now I want to rearrange the columns like 1, 2, 3, 4 and so on. How to do so?? I have tried sort but it didin't work.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291285#M39180</guid>
      <dc:creator>Trishant</dc:creator>
      <dc:date>2020-09-29T14:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291286#M39181</link>
      <description>&lt;P&gt;It is sorting the iterations as strings rather than numbers.  &lt;/P&gt;

&lt;P&gt;try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | sort + num(iteration)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 13:46:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291286#M39181</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-06T13:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291287#M39182</link>
      <description>&lt;P&gt;The chart/timechart/xyseries etc command automatically sorts the column names, treating them as string. There can be a workaround but it's based on assumption that the column names are known and fixed. You can basically add a table command at the end of your search with list of columns in the proper order.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search with chart command
| table Test_CaseID 1 2 3 4 5 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search with chart command
| table Test_CaseID [| gentimes start=-1 | eval search=mvrange(1,21) | stats list(search) as search delim="," | nomv search ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 15:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291287#M39182</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-06T15:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291288#M39183</link>
      <description>&lt;P&gt;@Trishant, you can pad zero to iterations to make them sort as numerical strings i.e. 01, 02, 03... 10, 11 ...&lt;/P&gt;

&lt;P&gt;Following example uses printf() function to pad 0 if length of String number is less than 2. &lt;CODE&gt;printf("%02d",iteration)&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="sample data_ui performance" boxtype= "cisco*" build="RC24" 
| eval iteration=printf("%02d",iteration)
| eval testId = testId + ": " + testcase 
| rename testId as Test_CaseID, build as Build, duration as Time_Taken 
| chart values(Time_Taken) over Test_CaseID by iteration limit=20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You do not need sort + iteration on second line as mentioned in your search. &lt;/P&gt;

&lt;P&gt;While this is just an option, the solution by @DalJeanis is best approach for your scenario. It does not require additional evaluation and it applies sort after dataset is narrowed down to specific results.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291288#M39183</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-06T19:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291289#M39184</link>
      <description>&lt;P&gt;Many Thanks, this worked for me..&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:58:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291289#M39184</guid>
      <dc:creator>Trishant</dc:creator>
      <dc:date>2017-07-07T11:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291290#M39185</link>
      <description>&lt;P&gt;@Trishant, glad it worked. Did you try @DalJeanis's answer?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 12:32:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291290#M39185</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-07T12:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange the columns of a cart command</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291291#M39186</link>
      <description>&lt;P&gt;Yeah I tried that as well but,I am not sure why sort command is not working for my query.. &lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 13:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-rearrange-the-columns-of-a-cart-command/m-p/291291#M39186</guid>
      <dc:creator>Trishant</dc:creator>
      <dc:date>2017-07-07T13:31:16Z</dc:date>
    </item>
  </channel>
</rss>

