<?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 Names With A Numeric Initial in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874102#M103799</link>
    <description>&lt;P&gt;You can use the Column() function to reference column names in your "cnmes" list of column names.&amp;nbsp; Or if you are hard coding the column names, using the following&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Report snapshot: Big Class - Graph Builder
Data Table( "Big Class" ) &amp;lt;&amp;lt; Graph Builder(
	Variables( X( :"1height"n ), Y( :"1height"n ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1747412759528.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75914i556B5E4F17DB3CED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1747412759528.png" alt="txnelson_0-1747412759528.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );


// Change column name: height → 1height
try(Data Table( "Big Class" ):height &amp;lt;&amp;lt; Set Name( "1height" ));


// Change column name: weight → 3weight
try(Data Table( "Big Class" ):weight &amp;lt;&amp;lt; Set Name( "3weight" ));

cnmes = dt &amp;lt;&amp;lt; get column names( "string" );

Graph Builder(
	Variables( X( column(cnmes[5])), Y(  column(cnmes[4]) ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 May 2025 16:26:28 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2025-05-16T16:26:28Z</dc:date>
    <item>
      <title>Column Names With A Numeric Initial</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874091#M103798</link>
      <description>&lt;P&gt;I have a code that stumbles with column names having a numeric initial, whereby the code thinks the name represents a date.&amp;nbsp; I did a column rename to overcome the problem but it's ugly.&amp;nbsp; I also found that wrapping the object that represents the names in a Char(obj) statement didn't work either.&amp;nbsp; Any suggestions on how to better deal with this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
cnmes = dt &amp;lt;&amp;lt; get column names( "string" );
For( j = 1, j &amp;lt;= N Items( cnmes ), j++, 

        if (Starts With( cnmes[j], "1" ) == 1 | Starts With( cnmes[j], "2" ) == 1 | Starts With( cnmes[j], "3" ) == 1| Starts With( cnmes[j], "4" ) == 1 | Starts With( cnmes[j], "5" ) == 1 | Starts With( cnmes[j], "6" ) == 1 | Starts With( cnmes[j], "7" ) == 1 | Starts With( cnmes[j], "8" ) ==1 | Starts With( cnmes[j], "9" ) == 1 | Starts With( cnmes[j], "0") == 1 , 
        
        Column(cnmes[j]) &amp;lt;&amp;lt; set name("_"||cnmes[j])   

   ) );    &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 May 2025 15:52:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874091#M103798</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-05-16T15:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Column Names With A Numeric Initial</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874102#M103799</link>
      <description>&lt;P&gt;You can use the Column() function to reference column names in your "cnmes" list of column names.&amp;nbsp; Or if you are hard coding the column names, using the following&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Report snapshot: Big Class - Graph Builder
Data Table( "Big Class" ) &amp;lt;&amp;lt; Graph Builder(
	Variables( X( :"1height"n ), Y( :"1height"n ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1747412759528.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75914i556B5E4F17DB3CED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1747412759528.png" alt="txnelson_0-1747412759528.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );


// Change column name: height → 1height
try(Data Table( "Big Class" ):height &amp;lt;&amp;lt; Set Name( "1height" ));


// Change column name: weight → 3weight
try(Data Table( "Big Class" ):weight &amp;lt;&amp;lt; Set Name( "3weight" ));

cnmes = dt &amp;lt;&amp;lt; get column names( "string" );

Graph Builder(
	Variables( X( column(cnmes[5])), Y(  column(cnmes[4]) ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 May 2025 16:26:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874102#M103799</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-05-16T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Column Names With A Numeric Initial</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874103#M103800</link>
      <description>&lt;P&gt;You are seeing those issues as Names have to start with either alphabetic character or with underscore &lt;A href="https://www.jmp.com/support/help/en/16.2/index.shtml#page/jmp/names.shtml" target="_blank" rel="noopener"&gt; Scripting Guide &amp;gt; JSL Building Blocks &amp;gt; JSL Syntax Rules &amp;gt; Names&lt;/A&gt; . Depending on what you are doing, you might want to rename them or not (see txnelson's options), for renaming you could for example utilize regex with something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(0),
	Compress File When Saved(1),
	New Column("1col", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("13col", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("0col", Numeric, "Continuous", Format("Best", 12), Set Values([])),
	New Column("Column 4",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([])
	)
);

colnames = dt &amp;lt;&amp;lt; Get Column Names("String");
For Each({colname}, colnames,
	newname = Regex(colname, "^\d+.+", "_\0");
	If(!IsMissing(newname),
		Column(dt, colname) &amp;lt;&amp;lt; Set Name(newname);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 May 2025 16:37:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Names-With-A-Numeric-Initial/m-p/874103#M103800</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-16T16:37:43Z</dc:date>
    </item>
  </channel>
</rss>

