- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Can an IF formula use boolean character filtering?
Hello all,
I'm trying to run a column creation formula in JMP and I can't figure out how to get the system to perform the function I'm wanting.
Specifically, there is a column of Serial Numbers of six characters. The first character is always an "S" (for serial number). The next 5 characters will always be a sequence of five numbers that begins either with a 7, a 5, or a 0 (representing three different product generations).
What I'd like to do is make a formula that does an "IF" function that says "IF (VAR) = S7* THEN "3"" ... which would look at the serial number column and see if it started with an S7 then it would set the new column's value to 3 (3rd generation) and so on with generation 2 and generation 1.
Is this possible with the JMP formula logic? There's a ton of options but its a bit complicated figuring them all out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can an IF formula use boolean character filtering?
Many options for this, if-elseif most simple one
If(
Starts With(:col, "S7"), "3"
, Starts With(:col, "S3"), "1"
// and so on
);
you can also chain the if-statements if necessary or use IsMissing(Regex()) for more complicated pattern comparisons. If you can provide example data we can provide better examples (add wanted result column if possible).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can an IF formula use boolean character filtering?
another option: Match
New Column( "generation",
Formula( Match( Word( 2, :Column 1, "" ),
"3", 1,
"5", 2,
"7", 3 ) )
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can an IF formula use boolean character filtering?
Thank you.