Column referencing: What is the difference between Column("Example") and :Name("Example")?Dear all,
By googling examples, I kinda get the hang of when to use Column("Example") and :Name("Example"). When used in summary table and equality conditions, I use :Name("Example"). Meanwhile, I use Column("Example") when changing column properties.
However, I still fail to understand the difference between the two, concept-wise. Can anyone give insights to help me understand the difference between the two?
Thank you,
Shaira
Re: Column referencing: What is the difference between Column("Example") and :Name("EThank you all for the input.
@pmrozNow, I am curious why some column references work, while others don't. But I'll keep this in mind. Thanks for sharing this.
Regards,
Shaira
Re: Column referencing: What is the difference between Column("Example") and :Name("EOne other wrinkle to keep in mind. Sometimes column("Column Name") doesn't work. Instead you have to say AS Column("Column Name"). I've had to use this reference method for get rows where and with new column formulas. For example:
match_rows = rts_signal_detail_report_dt << get rows where(as column(rts_signal_detail_report_dt, one_col) == "Y");
xl_dt << new column("TMP_AER#VER", character, nominal,
formula(as column(xl_col1) || "#" || char(as column(xl_col2))));
I found this out by trial and error. I.e. it didn't work using the regular column() reference, so I tried AS Column and it worked.
Re: Column referencing: What is the difference between Column("Example") and :Name("EI believe, too, that Name() is not a JSL function but a directive to the JSL interpreter. It is meant to help the interpreter handle improper names when a user saves a script. (For example, click the red triangle at the top of a platform and select Save script > To Data Table.) On the other hand, the Column() function is intended for us to obtain a valid column reference given a column index or proper name and optionally a data table reference.
I don't use the Name() directive in my scripts. That practice is a matter of personal choice and scripting style.
Re: Column referencing: What is the difference between Column("Example") and :Name("EThere are lots of ways to reference a column. For Example:
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
a = Column( 4 )[1] + Column( 4 )[2];
b = Column( 4 )[1] + :name( "height" )[2];
c = Column( 4 )[1] + Column( "height" )[2];
d = Column( 4 )[1] + :height[2];
Show( a, b, c, d );
:Age << Color Cells( "Red" );
Column( 4 ) << Color Cells( "blue" );
:name( "weight" ) << Color Cells( "green" );
:height << Set Property( "Units", inches );
column(5)<< set property( "Units", lbs);
:name("weight")<<GET property=""></GET>
how you reference a column depends on what you are trying to do, and what's convenient.
Re: Column referencing: What is the difference between Column("Example") and :Name("EHello Mark,
In example below, I am matching Age, Height, and Blood columns for a data table (dt) to a lookup table (dtLUT).
The Column(out) == Column(out) is accepted in some machines running this script, but not for others.
May I know if calling the Column function with a variable is only supported in specific JMP versions ?
list = { "Age_Group", "Height_Group", "Blood_Group" };
n = N Items (list);
for (v=1, v<N></N>Re: Column referencing: What is the difference between Column("Example") and :Name("EThe problem might be the syntax for the << Update(... ) message. Try this syntax for Match Columns() argument:
Match Columns (Column(out) = Column(out))
You are not testing equality. You are specifying a match. See the syntax for this message in the Scripting Index:

Re: Column referencing: What is the difference between Column("Example") and :Name("EI figured out the problem was not related to scripting / environment. Please ignore my question above, my apologies for the confusion.