cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-783695%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENew%20Character%20Column%20Based%20on%20Date%20Range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783695%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENew%20to%20JMP%20here.%26nbsp%3B%20I%20have%20a%20Date%2FTime%20table%20where%20I%20would%20like%20to%20establish%20a%20conditional%20new%20column%20that%20if%20the%20date%20is%20%26gt%3B%201%2F1%2F2024%2C%20then%20return%20a%20character%20of%20%22After.%22%26nbsp%3B%20If%20this%20is%20not%20met%2C%20return%20%22Before.%22%26nbsp%3B%20I%20have%20tried%20the%20formula%20editor%20but%20still%20having%20issues.....just%20blanks%20in%20the%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-783695%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EBasic%20Data%20Analysis%20and%20Modeling%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20New%20Character%20Column%20Based%20on%20Date%20Range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAssuming%20your%20DateTime%20column%20is%20a%20numeric%20JMP%20DateTime%20column%20the%20below%20formula%20will%20work%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20%3AEvent%20Date%20%26lt%3B%20Informat(%20%2201%2F01%2F2024%22%2C%20%22m%2Fd%2Fy%22%20)%2C%0A%09%22Before%22%2C%0A%09%22After%22%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783747%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20New%20Character%20Column%20Based%20on%20Date%20Range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783747%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EVia%20the%20GUI%2C%20you%20can%20use%20%3CSTRONG%3ECustom%20Binning%3C%2FSTRONG%3E%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_0-1724504187864.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1724504187864.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1724504187864.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1724504187864.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67487i0B6BCC89BBC2A85E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_0-1724504187864.png%22%20alt%3D%22hogi_0-1724504187864.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3Eand%20use%20custom%20labels%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_2-1724504339366.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_2-1724504339366.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_2-1724504339366.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_2-1724504339366.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67489i6786E5AC032E1A38%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_2-1724504339366.png%22%20alt%3D%22hogi_2-1724504339366.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_1-1724504271574.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_1-1724504271574.png%22%20style%3D%22width%3A%20342px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_1-1724504271574.png%22%20style%3D%22width%3A%20342px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_1-1724504271574.png%22%20style%3D%22width%3A%20342px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67488iC0D79F98E07EF82E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_1-1724504271574.png%22%20alt%3D%22hogi_1-1724504271574.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20adjust%20the%20settings%2C%20use%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_3-1724504440360.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_3-1724504440360.png%22%20style%3D%22width%3A%20385px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_3-1724504440360.png%22%20style%3D%22width%3A%20385px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_3-1724504440360.png%22%20style%3D%22width%3A%20385px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F67490iA7B77C49A4474F33%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_3-1724504440360.png%22%20alt%3D%22hogi_3-1724504440360.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783766%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20New%20Character%20Column%20Based%20on%20Date%20Range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783766%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20very%20much%20both!%26nbsp%3B%20There%20is%20so%20much%20power%20in%20JMP.....I%20am%20really%20looking%20forward%20to%20learning%20more!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECesar%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783981%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20New%20Character%20Column%20Based%20on%20Date%20Range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783981%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2687%22%20target%3D%22_blank%22%3E%40txnelson%3C%2FA%3E%26nbsp%3Bprovided%20the%20formula.%20In%20this%20case%2C%20you%20do%20not%20need%20to%20call%20the%20In%20Format()%20function.%20You%20can%20use%20a%20convenient%20literal%20date%20value.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EIf(%20%3AEvent%20Date%20%26lt%3B%2001Jan2024%2C%0A%09%22Before%22%2C%0A%09%22After%22%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
LEARNING
Level I

New Character Column Based on Date Range

Hi Everyone,

 

New to JMP here.  I have a Date/Time table where I would like to establish a conditional new column that if the date is > 1/1/2024, then return a character of "After."  If this is not met, return "Before."  I have tried the formula editor but still having issues.....just blanks in the rows.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: New Character Column Based on Date Range

Assuming your DateTime column is a numeric JMP DateTime column the below formula will work

If( :Event Date < Informat( "01/01/2024", "m/d/y" ),
	"Before",
	"After"
)
Jim

View solution in original post

hogi
Level XII

Re: New Character Column Based on Date Range

Via the GUI, you can use Custom Binning:

hogi_0-1724504187864.png
and use custom labels:

hogi_2-1724504339366.png

 

hogi_1-1724504271574.png



To adjust the settings, use

hogi_3-1724504440360.png

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: New Character Column Based on Date Range

Assuming your DateTime column is a numeric JMP DateTime column the below formula will work

If( :Event Date < Informat( "01/01/2024", "m/d/y" ),
	"Before",
	"After"
)
Jim
hogi
Level XII

Re: New Character Column Based on Date Range

Via the GUI, you can use Custom Binning:

hogi_0-1724504187864.png
and use custom labels:

hogi_2-1724504339366.png

 

hogi_1-1724504271574.png



To adjust the settings, use

hogi_3-1724504440360.png

Re: New Character Column Based on Date Range

@txnelson provided the formula. In this case, you do not need to call the In Format() function. You can use a convenient literal date value.

If( :Event Date < 01Jan2024,
	"Before",
	"After"
);
LEARNING
Level I

Re: New Character Column Based on Date Range

Thank you very much both!  There is so much power in JMP.....I am really looking forward to learning more!

 

Cesar