<?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: Summarize function Date in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344824#M59481</link>
    <description>&lt;P&gt;This is the alert I am getting...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhurw_0-1609262604205.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29132i0C31CCED1A2563F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhurw_0-1609262604205.png" alt="dhurw_0-1609262604205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Not sure how it could be an expression or a row state...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Dec 2020 17:24:19 GMT</pubDate>
    <dc:creator>dhurw</dc:creator>
    <dc:date>2020-12-29T17:24:19Z</dc:date>
    <item>
      <title>Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344667#M59447</link>
      <description>&lt;P&gt;I pretty new to jmp and have been trying to gain as much knowledge as possible on the the scripting language.&amp;nbsp; I have been referencing both the scripting guide and the index if I run into any issues.&amp;nbsp; As far as the Summarize function is concerned,&amp;nbsp; is there somethin I am missing.... I am attempting to pull the min and max date and I am getting a rather large numerical value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhurw_0-1609190078538.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29120iDDEB3807FBB1D6F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhurw_0-1609190078538.png" alt="dhurw_0-1609190078538.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As far as the formatting is concerned this is what I have..&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhurw_1-1609190132540.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29121iE40258EE2FF7B653/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhurw_1-1609190132540.png" alt="dhurw_1-1609190132540.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(
	pNum = By( :Part Number ), 

	minL = Min( :Start Length ),
	maxL = Max( :Start Length ),
	massM = Mean( :Name( "Mass (g/m2)" ) ),
	sDevM = Std Dev( :Name( "Mass (g/m2)" ) ),
	minT = Min( :Time ) ,
	maxT = Max( :Time ) 
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:24:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344667#M59447</guid>
      <dc:creator>dhurw</dc:creator>
      <dc:date>2023-06-10T23:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344687#M59448</link>
      <description>&lt;P&gt;JMP DateTime variables are numeric values based upon the number of seconds since January 1, 1904.&amp;nbsp; Therefore the actual numeric value is a very large number.&amp;nbsp; To display the value as a time value, the easiest way, is to specify a format() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(
	pNum = By( :Part Number ), 

	minL = Min( :Start Length ),
	maxL = Max( :Start Length ),
	massM = Mean( :Name( "Mass (g/m2)" ) ),
	sDevM = Std Dev( :Name( "Mass (g/m2)" ) ),
	minT = Min( :Time ) ,
	maxT = Max( :Time ) 
);

show( format(minT, "m/d/y h:m:s"),format(maxT, "m/d/y h:m:s"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 21:41:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344687#M59448</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-28T21:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344805#M59468</link>
      <description>&lt;P&gt;Unfortunately, that is not working for this script. The original script was not made by me, although I assume this is the culprit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( SqlQry1, "DateTime" ) &amp;lt;&amp;lt; data type( "Numeric" );
SqlQry1 &amp;lt;&amp;lt; New Column( "Time", formula( Round( :DateTime, 0 ) ) );

Column( SqlQry1, "Time" ) &amp;lt;&amp;lt; Format( "m/d/y h:m:s" ) &amp;lt;&amp;lt; delete formula;
//Column( SqlQry1, "Time")  &amp;lt;&amp;lt; Modeling Type( "Nominal");
SqlQry1 &amp;lt;&amp;lt; delete column( "DateTime" );
dt0 = SqlQry1 &amp;lt;&amp;lt; split( split by( :TagName ), Split( :vValue ), group( :Time ) );
Close( SqlQry1, no save );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Dec 2020 13:49:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344805#M59468</guid>
      <dc:creator>dhurw</dc:creator>
      <dc:date>2020-12-29T13:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344815#M59476</link>
      <description>what do you mean when you say it isn't working?  Without having an actual sample of your data table, I am not seeing anything of issue.</description>
      <pubDate>Tue, 29 Dec 2020 15:31:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344815#M59476</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-29T15:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344819#M59479</link>
      <description>&lt;P&gt;I am getting this error...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhurw_0-1609261335391.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29131i81C4BBB2DC9FF828/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhurw_0-1609261335391.png" alt="dhurw_0-1609261335391.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which to me doesn't make sense, in that the column was created utilizing the previous script as a numeric time column.&lt;/P&gt;&lt;P&gt;The data is being pulled from an SQL server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 17:07:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344819#M59479</guid>
      <dc:creator>dhurw</dc:creator>
      <dc:date>2020-12-29T17:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344822#M59480</link>
      <description>&lt;P&gt;place a Num() function around the minT and see what happens. I agree, minT should be numeric&lt;/P&gt;
&lt;P&gt;When you move your cursor over&amp;nbsp; minT what value is displayed?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 17:20:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344822#M59480</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-29T17:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344824#M59481</link>
      <description>&lt;P&gt;This is the alert I am getting...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dhurw_0-1609262604205.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/29132i0C31CCED1A2563F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dhurw_0-1609262604205.png" alt="dhurw_0-1609262604205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Not sure how it could be an expression or a row state...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 17:24:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344824#M59481</guid>
      <dc:creator>dhurw</dc:creator>
      <dc:date>2020-12-29T17:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344837#M59488</link>
      <description>&lt;P&gt;Can you please supply more of your script. Preferably from the Summarize to the point where you are doing the&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Show( Format( Num( minT ), "m/d/y h:m:s" ) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jan 2021 16:19:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344837#M59488</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-04T16:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344856#M59493</link>
      <description>&lt;P&gt;Here is from when the time column was created in a data table to the calling of show()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( SqlQry1, "DateTime" ) &amp;lt;&amp;lt; data type( "Numeric" );
SqlQry1 &amp;lt;&amp;lt; New Column( "Time", formula( Round( :DateTime, 0 ) ) );

Column( SqlQry1, "Time" ) &amp;lt;&amp;lt; Format( "m/d/y h:m:s" ) &amp;lt;&amp;lt; delete formula;
//Column( SqlQry1, "Time")  &amp;lt;&amp;lt; Modeling Type( "Nominal");
SqlQry1 &amp;lt;&amp;lt; delete column( "DateTime" );
dt0 = SqlQry1 &amp;lt;&amp;lt; split( split by( :TagName ), Split( :vValue ), group( :Time ) );
Close( SqlQry1, no save );

//move everything that's not a mass/position to the beginning such that we can stack all the other columns at the end.
dt0 &amp;lt;&amp;lt; Move Selected Columns(
	{"Data", "Data", "Data",
	"Data", "Data", "Data",
	"Data", "Data"},
	after( "Time" )
);



//duplicate columns so we can downfill some without modifying the originals. since we dont have roll begin/end markers we may need the originals
dt0 &amp;lt;&amp;lt; New Column( "Part Number",
	after( :Time ),
	"character",
	"nominal",
	formula( :Data )
) &amp;lt;&amp;lt; MoveSelectedColumns( {:Part Number}, After( :Data ) );
dt0:Part Number &amp;lt;&amp;lt; delete formula;

dt0 &amp;lt;&amp;lt; New Column( "Lot Number", "character", "nominal", formula( :Data ) ) &amp;lt;&amp;lt;
MoveSelectedColumns( {:Lot Number}, After( :Data ) );
dt0:Lot Number &amp;lt;&amp;lt; delete formula;
	
dt0 &amp;lt;&amp;lt; New Column( "Split",
	after( :Data ),
	"Numeric",
	"nominal",
	formula( :Data )
) &amp;lt;&amp;lt; MoveSelectedColumns( {:Split}, After( :Data ) );
dt0:Split &amp;lt;&amp;lt; delete formula;

//This down fills the part number tag so that it can be associated with each roll	
For( i = 1, i &amp;lt;= N Rows( dt0 ), i++, 
	/*If( Is Missing( :Part Number[i] ),
		:Part Number[i] = Part Number[i - 1]);*/
		
	Try(
		If( Is Missing( :Lot Number[i] ),
			:Lot Number[i] = Lot Number[i - 1]
		);
	
		If( Is Missing( :Part Number[i] ),
			:Part Number[i] = Part Number[i - 1]
		);
	
		If( Is Missing( :Split[i] ),
			:Split[i] = Split[i - 1]
		);
	)
);

//This makes all the mass, position columns numeric but not the part/lot # ones
For( i = 9, i &amp;lt;= N Col(), i++,
	Column( i ) &amp;lt;&amp;lt; data type( numeric ) &amp;lt;&amp;lt; modeling type( "Continuous" )
);

//assign each mass point a CW position	
For( i = 0, i &amp;lt; 512, i++,
	x = "Position Lane " || Char( i );
	dt0 &amp;lt;&amp;lt; New Column( x,
		formula( :Data+ (:Data) * (i + 1) )
	);
	Column( dt0, x ) &amp;lt;&amp;lt; delete formula;
); 

//form a list of all the mass and position columns without having to use 1000 lines of code
col_list = dt0 &amp;lt;&amp;lt; get column names( string );
For( i = N Items( col_list ), i &amp;gt; 0, i--,
	If(
		(!Contains( col_list[i], "Data" )) &amp;amp; (!
		Contains( col_list[i], "Position Lane" )),
		Remove From( col_list, i )
	)
);


//Stack the mass and position columns	
dt1 = dt0 &amp;lt;&amp;lt; Stack(
	columns( col_list ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" ),
	Number of Series( 2 ),
	Contiguous
);

Close( dt0, no save );

//renames the appropriate columns as mass / positions
:Data &amp;lt;&amp;lt; Set Name( "Mass (g/m2)" );
:Data 2 &amp;lt;&amp;lt; Set Name( "Position (cm)" );

dt1 &amp;lt;&amp;lt; delete column( "Label" );
dt1 &amp;lt;&amp;lt; delete column( "Label 2" );

dt1 &amp;lt;&amp;lt; New Script(
	"CW Graph",
	Graph Builder(
		Size( 522, 571 ),
		Show Control Panel( 0 ),
		Variables( X( :Name( "Position (cm)" ) ), Y( :Name( "Data" ) ) ),
		Elements( Smoother( X, Y, Legend( 6 ) ) ),
		Local Data Filter(
			Add Filter(
				columns( :Lot Number ),
				Display( :Lot Number, Size( 178, 276 ), Height( 276 ) )
			)
		)
	)
);

dt1 &amp;lt;&amp;lt; set name( "Data" );

dt1 &amp;lt;&amp;lt; Delete Table Property( "Source" );
dt1 &amp;lt;&amp;lt; Delete Table Property( "Update from DB" );
dt1 &amp;lt;&amp;lt; Delete Table Property( "Save To DB" ); 

dt1 &amp;lt;&amp;lt; New Column( "Lanes",
	numeric,
	continuous,
	formula( 10 + 10 * Floor( (:Name( "Position (cm)" ) - 10) / 10 ) )
);
Column( dt1, "Mach.StartLength" ) &amp;lt;&amp;lt; set name( "Start Length" );
//Deleting empty Lane rows
dt1 &amp;lt;&amp;lt; Select Where( Is Missing( :Name( "Lanes" ) ) ) &amp;lt;&amp;lt; Delete Rows;
//Variables for the Summary Stats
pNumLot = {:Part Number, :Lot Number};
Summarize(
	pNum = By( :Part Number ), 
	//lNum = By( :Lot Number ), //this needs to be added
	//pLNum = By( Eval( pNumLot ) ),
	minL = Min( :Start Length ),
	maxL = Max( :Start Length ),
	massM = Mean( :Name( "Mass (g/m2)" ) ),
	sDevM = Std Dev( :Name( "Mass (g/m2)" ) ),
	minT = Min( :Time ),
	maxT = Max( :Time )
);
Show( Format( minT, "m/d/y h:m:s" ), Format( maxT, "m/d/y h:m:s" ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 19:13:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344856#M59493</guid>
      <dc:creator>dhurw</dc:creator>
      <dc:date>2020-12-29T19:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize function Date</title>
      <link>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344857#M59494</link>
      <description>&lt;P&gt;I should have realized this earlier.&amp;nbsp; Because the Summarize() has a by group, the values of minT and maxT are matrices.&amp;nbsp; If you change the Show() line to&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Show( Format( minT[1], "m/d/y h:m:s" ), Format( maxT[1], "m/d/y h:m:s" ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you should see the min and max times for the first Part Number&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 22:23:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Summarize-function-Date/m-p/344857#M59494</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-29T22:23:51Z</dc:date>
    </item>
  </channel>
</rss>

