- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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 || /*###*/" " /*###*/
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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) || " ",
),
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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) || " ",
),
)
)
);