Last column,Col Value(NCol()-1)I have data tables where the number of columns vary, but the last column in each table holds information such as "PASS" and "FAIL" where I want to create a new column in each table where if it is PASS then replace with numeric 1, and Fail numeric 0 with an IF statement.
I tried
New column with formula Col Value(NCol()-1) and it does not work. If I replace with a hard coded column value e.g., Col Value(9) it returns the pass/fail and I can use an IF statement to change to the numeric values, but I really need the NCol()-1 to paste into all the tables as the last column.
How do I make the formula work?
IF (Col Value(NCol()-1) = "PASS", 1, 0);
Automation and ScriptingRe: Last column,Col Value(NCol()-1)I don't really suggest doing something like this, but the formula would most likely look something like this
If(Column(N Col() - 1)[Row()] == "PASS",
1,
0
)
or
If(As Column(N Col() - 1) == "PASS",
1,
0
)
Re: Last column,Col Value(NCol()-1)Hi,
You have to specify a
If( Col Value( Column( N Col() - 1 ) )== "PASS"),
1,
0
)
column in your formula as shown below:
Re: Last column,Col Value(NCol()-1)I found the solution using EVAL()
If( Col Value( Eval( N Col() - 1 ) ) == "PASS", 1, 0)
Re: Last column,Col Value(NCol()-1)@jthi 's approach is better documented.
Can someone explain what col value() does, or share a link to the documentation?
Wow, Eval() works?
Col Value in Formula Editor:

Hover Tip in Formula Editor: nothing
Re: Last column,Col Value(NCol()-1)
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
:height << Set Property( "Missing Value Codes", {59} );
row()=1;
Show(col value("height")); //.<BR />as column("height"); //.
Show(col stored value("height")); // 59
// accepts strings, columns, names ... as argument<BR />//row=40
Show(col value("height",40));
Show(col value(:height,40));
Show(col value(5,40));
Show(col value(Column("height"),40));<BR />Show(col value(As Column("height"),40));
As Column("height")[40];
// doesn't accept Expressions -> fix via Eval
Show(col value(2+2)); // ␀