cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • Use JMP Clinical with CDISC-compliant data. Review studies, ID safety and efficacy signals & communicate findings with interactive graphics. Register to see how. Aug. 27, 2 pm US ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
jamiesupica0
Level II

Labeling rows as greater/less than a date with JSL

I have a dataset with a date column formatted dd/mm/yyyy hh:mm.  In my script I want to be able to set a variable equal to some date and then have the script create a new column labelling all rows as being “before” of “after” the specified date.

The workaround I’m using is to format the variable and the column in seconds but it’s not easy to read.

Is there a way to keep the dd/mm/yyyy formatting when setting the variable in the script and also have it work in a formula?

This is the script that doesn’t work:

varProcessChange = 03/20/2016 00:01

 

colCondition = New Column (“Condition”)

                <<data type (character)

                <<Modeling Type (“Nominal”)

                <<Set Formula (If(:Event Date < varProcessChange, “Before”, “After”)

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Labeling rows as greater/less than a date with JSL

Here is a script that is very similar to what you want to do

Names Default To Here( 1 );
dt = open("$SAMPLE_DATA\Time Series\Raleigh Temps.jmp");
varProcessChange = Date MDY( 6, 1, 1980 );
Eval(
	Eval Expr(
		colCondition = dt << New Column( “Condition”,
			character,
			numinal,
			formula( If( :name( "month/Year" ) < Expr( varProcessChange ), "Before", "After" ) )
		)
	)
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Labeling rows as greater/less than a date with JSL

Here is a script that is very similar to what you want to do

Names Default To Here( 1 );
dt = open("$SAMPLE_DATA\Time Series\Raleigh Temps.jmp");
varProcessChange = Date MDY( 6, 1, 1980 );
Eval(
	Eval Expr(
		colCondition = dt << New Column( “Condition”,
			character,
			numinal,
			formula( If( :name( "month/Year" ) < Expr( varProcessChange ), "Before", "After" ) )
		)
	)
);
Jim
jamiesupica0
Level II

Re: Labeling rows as greater/less than a date with JSL

Thanks so much, that did the trick!

Recommended Articles