<?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 automatically detect Index column by format? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554623#M76928</link>
    <description>&lt;P&gt;The Get Format() message returns an expression that can be used to format another column. If you want the format as a string you can get the first argument of that expression using the &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/expression-functions.shtml" target="_self"&gt;Arg() function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "My Table",
	Add Rows( 0 ),
	New Column( "Column 1",
		Numeric,
		"Continuous",
		Format( "mmddyyyy", 12 ),
		Input Format( "mmddyyyy" ),
		Set Selected
	)
);

foo = :column 1 &amp;lt;&amp;lt; get format;

//foo == Format( "mmddyyyy", 12 )

fmt = Arg( foo, 1 );

Show( fmt );

// fmt = "mmddyyyy";&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Oct 2022 20:18:34 GMT</pubDate>
    <dc:creator>Jeff_Perkinson</dc:creator>
    <dc:date>2022-10-10T20:18:34Z</dc:date>
    <item>
      <title>How to automatically detect Index column by format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554616#M76927</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating an app using JMP Application Builder where a user opens a datafile into JMP and can perform some analyses. The program requires some kind of an index column (either date/time or a simple row index will suffice). Often, the type of data loaded into this application will have a date/time index, but this is not always the case and sometimes the first column is actual data (continuous, numeric, often decimal values).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a way to automatically detect if the first column of a data table in JMP has date/time format (date/time index) or is a column of [1, 2, ..., N Cols] values (row index). If both of these checks for an index column are negative (meaning the first column is actual data values), then I can just insert a column with Row() formula to handle the index requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to use &amp;lt;&amp;lt; Get Format and then use that result to investigate what I described? I have been unable to successfully do so, but I may not be looking in the right place. If I could get the output of &amp;lt;&amp;lt; Get Format as a string, I could do some rudimentary search to see if it contains some mix of YYYY, M, or D, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is entirely possible to ask the user to simply add an index column before continuing to use the program, and for now that is what I am doing, but ideally the program would be able to automatically handle this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any advice,&lt;/P&gt;&lt;P&gt;Estelle&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:00:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554616#M76927</guid>
      <dc:creator>EstelleS</dc:creator>
      <dc:date>2023-06-09T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically detect Index column by format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554623#M76928</link>
      <description>&lt;P&gt;The Get Format() message returns an expression that can be used to format another column. If you want the format as a string you can get the first argument of that expression using the &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/expression-functions.shtml" target="_self"&gt;Arg() function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "My Table",
	Add Rows( 0 ),
	New Column( "Column 1",
		Numeric,
		"Continuous",
		Format( "mmddyyyy", 12 ),
		Input Format( "mmddyyyy" ),
		Set Selected
	)
);

foo = :column 1 &amp;lt;&amp;lt; get format;

//foo == Format( "mmddyyyy", 12 )

fmt = Arg( foo, 1 );

Show( fmt );

// fmt = "mmddyyyy";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 20:18:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554623#M76928</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2022-10-10T20:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically detect Index column by format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554649#M76930</link>
      <description>&lt;P&gt;Ah, great! Thank you, Jeff, this is the step I was missing.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 20:38:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-automatically-detect-Index-column-by-format/m-p/554649#M76930</guid>
      <dc:creator>EstelleS</dc:creator>
      <dc:date>2022-10-10T20:38:24Z</dc:date>
    </item>
  </channel>
</rss>

