<?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: Column Header Ordering in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806813#M98539</link>
    <description>&lt;P&gt;Works great! Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2024 11:53:00 GMT</pubDate>
    <dc:creator>Azim</dc:creator>
    <dc:date>2024-10-18T11:53:00Z</dc:date>
    <item>
      <title>Column Header Ordering</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806710#M98522</link>
      <description>&lt;P&gt;After transposing data table,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Overall" ) &amp;lt;&amp;lt; Transpose(
	columns( :Value),
	By( :Department, :Resource, :Chart ),
	Label( :Date),
	Output Table( "report overall" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My headers which is presented by date is no longer in order. Which I then have to mannually drag and drop to have it fixed. Luckily it only involves 7-8 columns. Nontheless, doing so eats up my time which I do not initially have to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Azim_1-1729242963544.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69283i62012F0BFBAB8F21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Azim_1-1729242963544.png" alt="Azim_1-1729242963544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to make it in order as shown in picture?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Azim_0-1729242726856.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/69282iDB4068FF779BF933/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Azim_0-1729242726856.png" alt="Azim_0-1729242726856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Those dates will change daily as my fixed date range is 7 days.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;set_date = Today();

date_min = (set_date - In Days(7));

Data Table("Overall") &amp;lt;&amp;lt; Select where (:date &amp;lt; date_min) &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 09:18:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806710#M98522</guid>
      <dc:creator>Azim</dc:creator>
      <dc:date>2024-10-18T09:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Column Header Ordering</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806774#M98533</link>
      <description>&lt;P&gt;Here is a script that will reorder the columns as you requested&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Example table to use for illustration
New Table( "Example",
	Add Rows( 0 ),
	New Column( "Department", Character, "Nominal" ),
	New Column( "Resource", Character, "Nominal" ),
	New Column( "Chart", Character, "Nominal", Set Selected ),
	New Column( "17/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "16/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "15/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "11/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "14/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "18/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "13/10/2024", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "12/10/2024", Numeric, "Continuous", Format( "Best", 12 ) )
);
Wait( 5 );

// This JSL with properly reorder the data table
dt = Current Data Table();

colNames = dt &amp;lt;&amp;lt; get column names( string );

For Each( {col}, colNames,
	If( Is Missing( Try( Num( Informat( col, "d/m/y" ) ) ) ) == 0,
		Column( dt, col ) &amp;lt;&amp;lt; set name( Char( Num( Informat( col, "d/m/y" ) ) ) ),
		Column( dt, col ) &amp;lt;&amp;lt; set name( "0" || col )
	)
);
// Reorder columns by name
dt &amp;lt;&amp;lt; Reorder by Name;

colNames = dt &amp;lt;&amp;lt; get column names( string );

For Each( {col}, colNames,
	If( Is Missing( Num( col ) ) == 0,
		Column( dt, col ) &amp;lt;&amp;lt; set name( Format( Num( col ), "d/m/y" ) ),
		Column( dt, col ) &amp;lt;&amp;lt; set name( Substr( col, 2 ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Oct 2024 11:02:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806774#M98533</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-10-18T11:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Column Header Ordering</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806813#M98539</link>
      <description>&lt;P&gt;Works great! Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 11:53:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Header-Ordering/m-p/806813#M98539</guid>
      <dc:creator>Azim</dc:creator>
      <dc:date>2024-10-18T11:53:00Z</dc:date>
    </item>
  </channel>
</rss>

