cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

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

I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

Hi @Huw_Nanomarket 

You can use the Make Binning Formula to achieve that without the need to create a formula yourself

  1. Select the Date Column Go Cols > Utilities > Make Binning Formula

  2. Define the Bins Add a cutpoint for your specific date (e.g. 09-2009) Label the bins as "Before" and "After" to represent the two groups.

    spyros_megalou_0-1761563908891.png

    Click on the Make Formula Column and you are done. 

    Let me know if that answers your question.

    Spyros

View solution in original post

txnelson
Super User

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

In addition to the Make Binning Formula, in JSL you can use a simple If() comparison with dates.  Here is a column formula that illustrates the how to do it

If( :Date >= Informat( "10/14/2025", "MDY" ),
	1,
	0
)

txnelson_0-1761570928773.png

 

Jim

View solution in original post

7 REPLIES 7

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

Hi @Huw_Nanomarket 

You can use the Make Binning Formula to achieve that without the need to create a formula yourself

  1. Select the Date Column Go Cols > Utilities > Make Binning Formula

  2. Define the Bins Add a cutpoint for your specific date (e.g. 09-2009) Label the bins as "Before" and "After" to represent the two groups.

    spyros_megalou_0-1761563908891.png

    Click on the Make Formula Column and you are done. 

    Let me know if that answers your question.

    Spyros

hogi
Level XIII

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

The functionality is also available via the right click - new Formula column menu.

The advantage of using the functionality via the Cols menu:
The new column is generated with the same same format settings as the input column. When the users clicks on  "Edit Binning Formula":

hogi_0-1761567536146.png

they can easily edit the binning:

hogi_2-1761568004951.png

 

For comparison: Edit Binning formula for a column that is generated via the new formula column menu:

hogi_4-1761568061553.png

[cutpoints in seconds]


hogi
Level XIII

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

this issue got fixed in JMP19:

hogi_5-1761568130972.png

hogi
Level XIII

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

still missing: Edit Binning Formula for Transform columns:

hogi_6-1761568225353.png

 

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

Thanks for this. Very simple solution.

 

KasperSchlosser
Level III

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

In addition to Spyros answer there is also the possibility of using the "Parse Date"/"In Format" function

Date and Time Functions

or directly Writing writing the datetime.

Using dates, times, datetimes and durations in JMP

 

Names Default To Here( 1 );
way1 = Parse Date( "2025-10-30", "YYYY-MM-DD" );
way2 = 1Nov2025:12:30:25;

Show( way1, way2, way1 < way2 );

 

way1 = 30Oct2025;
way2 = 01Nov2025:12:30:25;
way1 < way2 = 1;

Kasper

txnelson
Super User

Re: I want to create a column that split dates into "Before" and "After" a specific date. How is the date represented in a conditional statement?

In addition to the Make Binning Formula, in JSL you can use a simple If() comparison with dates.  Here is a column formula that illustrates the how to do it

If( :Date >= Informat( "10/14/2025", "MDY" ),
	1,
	0
)

txnelson_0-1761570928773.png

 

Jim

Recommended Articles