<?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 below numeric columns based on order in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631928#M219492</link>
    <description>&lt;P&gt;There are a number of techniques to solve this.&lt;/P&gt;&lt;P&gt;First one is to make your dashboard create a token that represents. the fields that are to be included in the table and simply use that token in the table statement - i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table $field_order_token$&lt;/LI-CODE&gt;&lt;P&gt;that token is calculated in the same place that determines which fields are included.&lt;/P&gt;&lt;P&gt;Second one is the use of a prefix to force the column ordering in the xyseries, followed by a double transpose, which does not change field order when flipping, so this example shows how&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Aging=mvindex(split("31-60 Days,61-90 Days,91-120 Days,151-180 Days,Over 180 Days", ","), random() % 5)
| eval ACRONYM=mvindex(split("RTFM,WYSIWIG,OK", ","), random() % 3)
``` Simulated data setup above ```
| stats count by ACRONYM Aging
``` Prefix the value with a sort order ```
| eval Aging=case(Aging="31-60 Days", 1, Aging="61-90 Days", 2, Aging="91-120 Days", 3, Aging="151-180 Days", 4, Aging="Over 180 Days", 5).":".Aging
| xyseries ACRONYM Aging count
``` Now flip the table and remove the sort element and flip back - no field re-order occurs ```
| transpose 0 header_field=ACRONYM
| eval column=replace(column, "^\d:", "")
| transpose 0 header_field=column&lt;/LI-CODE&gt;&lt;P&gt;Note that you can replace your stats + xyseries with a single operation&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart count over ACRONYM by Aging&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2023 22:31:49 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-02-22T22:31:49Z</dc:date>
    <item>
      <title>How to rearrange below numeric columns based on order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631790#M219461</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have to rearrange below columns in below order&lt;BR /&gt;&lt;BR /&gt;i.e. 31-60 Days, 61-90 Days, 91-120 Days,151-180 Days,Over 180 Days, Total&lt;BR /&gt;&lt;BR /&gt;Query:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| inputlookup ACRONYM_Updated.csv&lt;BR /&gt;|stats count by ACRONYM Aging&lt;BR /&gt;|xyseries ACRONYM Aging count&lt;BR /&gt;|addtotals&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwini008_0-1677047440146.png" style="width: 522px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23977i5A019648EA15797F/image-dimensions/522x107?v=v2" width="522" height="107" role="button" title="Ashwini008_0-1677047440146.png" alt="Ashwini008_0-1677047440146.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 15:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631790#M219461</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2023-02-22T15:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange below numeric columns based on order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631792#M219462</link>
      <description>&lt;P&gt;Just table the columns as you need them&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table ACRONYM "31-60 Days" "61-90 Days" "91-120 Days" "151-180 Days" "Over 180 Days" Total&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Feb 2023 06:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631792#M219462</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-22T06:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange below numeric columns based on order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631832#M219469</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;Based on user selection from the dashboard the data keeps changing as below. So i cannot table it since depending on user selection data will be displayed in dashboard. Irrespective of any selection the days should sorted in order. Can we do that in query&lt;BR /&gt;&lt;BR /&gt;Example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwini008_0-1677066264463.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23978i792CE326679B64D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ashwini008_0-1677066264463.png" alt="Ashwini008_0-1677066264463.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwini008_1-1677066300741.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23979i786FC776F036D9B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ashwini008_1-1677066300741.png" alt="Ashwini008_1-1677066300741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 11:46:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631832#M219469</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2023-02-22T11:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange below numeric columns based on order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631928#M219492</link>
      <description>&lt;P&gt;There are a number of techniques to solve this.&lt;/P&gt;&lt;P&gt;First one is to make your dashboard create a token that represents. the fields that are to be included in the table and simply use that token in the table statement - i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table $field_order_token$&lt;/LI-CODE&gt;&lt;P&gt;that token is calculated in the same place that determines which fields are included.&lt;/P&gt;&lt;P&gt;Second one is the use of a prefix to force the column ordering in the xyseries, followed by a double transpose, which does not change field order when flipping, so this example shows how&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Aging=mvindex(split("31-60 Days,61-90 Days,91-120 Days,151-180 Days,Over 180 Days", ","), random() % 5)
| eval ACRONYM=mvindex(split("RTFM,WYSIWIG,OK", ","), random() % 3)
``` Simulated data setup above ```
| stats count by ACRONYM Aging
``` Prefix the value with a sort order ```
| eval Aging=case(Aging="31-60 Days", 1, Aging="61-90 Days", 2, Aging="91-120 Days", 3, Aging="151-180 Days", 4, Aging="Over 180 Days", 5).":".Aging
| xyseries ACRONYM Aging count
``` Now flip the table and remove the sort element and flip back - no field re-order occurs ```
| transpose 0 header_field=ACRONYM
| eval column=replace(column, "^\d:", "")
| transpose 0 header_field=column&lt;/LI-CODE&gt;&lt;P&gt;Note that you can replace your stats + xyseries with a single operation&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart count over ACRONYM by Aging&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 22:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631928#M219492</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-22T22:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to rearrange below numeric columns based on order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631952#M219501</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp; Thank You. Works perfect&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 06:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rearrange-below-numeric-columns-based-on-order/m-p/631952#M219501</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2023-02-23T06:49:30Z</dc:date>
    </item>
  </channel>
</rss>

