cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

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

string and variable concatenation

Hello,

i would like to create a new column based on result of another column, 

but i'm not able to write into column the results in case of third option, probably due to concatenate error...(see log below) 

 

note"

low and high are numeric variables previousy declared.

 

   

 

Summary_Stat << New Column( "SUMMARY_CPK_SPEC_Limit",
    Formula(
        If(
            :Name( "CPK(SPEC_Limit)" ) < low, "too Low CPK",
            If(
                :Name( "CPK(SPEC_Limit)" ) > high, 

                    "too high CPK", 

                "good CPK between " || Low || " and " || high || " ",
            ),
        )
    )
);

 

 

Column SUMMARY_CPK_SPEC_Limit Formula Interrupted

argument should be character 1 times At rows: 2 Operation: Concat, Bad Argument( Low ), "good CPK between " || /*###*/Low || /*###*/" and " || /*###*/high || /*###*/" " /*###*/

 

Gianpaolo Polsinelli
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: string and variable concatenation

You need to declare the column as being of a Data Type, Character and in order to concatenate numeric variables, they need to be converted to character references, char()

Summary_Stat << New Column( "SUMMARY_CPK_SPEC_Limit",
	Character,
	Formula(
		If(
			:Name( "CPK(SPEC_Limit)" ) < low, "too Low CPK",
			If(
				:Name( "CPK(SPEC_Limit)" ) > high, "too high CPK",
				"good CPK between " || char(Low) || " and " || Char(high) || " ",
			),
		)
	)
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: string and variable concatenation

You need to declare the column as being of a Data Type, Character and in order to concatenate numeric variables, they need to be converted to character references, char()

Summary_Stat << New Column( "SUMMARY_CPK_SPEC_Limit",
	Character,
	Formula(
		If(
			:Name( "CPK(SPEC_Limit)" ) < low, "too Low CPK",
			If(
				:Name( "CPK(SPEC_Limit)" ) > high, "too high CPK",
				"good CPK between " || char(Low) || " and " || Char(high) || " ",
			),
		)
	)
);
Jim

Recommended Articles