cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
john_madden
Level VI

Left function behavior

I'm having an odd behavior with Left(). Consider the following:

Left( "A", 2, " ") 

I anticipate the result will be "A " (i.e. padded on the right with a space). And indeed this is what I get.

However, When I use the same expression in a column formula like this:

Left( :Input, 2, " ")

and I have "A" as the value in Input, I am just getting "A" in the result column (i.e. no right space).

Am I missing something?

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Left function behavior

Removing trailing spaces can't be turned off. JMP removes the trailing spaces so other code that does grouping can run faster and not make two groups that seem to have the same identifier.

Craige

View solution in original post

4 REPLIES 4
Craige_Hales
Super User

Re: Left function behavior

I think you are hitting a rule that trims trailing spaces from character data in data tables. This works:

 

Append a non-space after the left function's resultAppend a non-space after the left function's result

Craige
john_madden
Level VI

Re: Left function behavior

Is that a built-in JMP rule that is always on? It’s fine if so, I just didn’t know it existed.
john_madden
Level VI

Re: Left function behavior

 
Craige_Hales
Super User

Re: Left function behavior

Removing trailing spaces can't be turned off. JMP removes the trailing spaces so other code that does grouping can run faster and not make two groups that seem to have the same identifier.

Craige