Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
john_madden
Level V

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
Highlighted
Craige_Hales
Staff (Retired)

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
Highlighted
Craige_Hales
Staff (Retired)

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
Highlighted
john_madden
Level V

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.
Highlighted
john_madden
Level V

Re: Left function behavior

 
Highlighted
Craige_Hales
Staff (Retired)

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

Article Labels

    There are no labels assigned to this post.