:Name("COLUMN_NAME+WITH-CHARACTERS")
OK
str = "COLUMN_NAME+WITH-CHARACTERS"
:Name(str)
Error: Name arg must be quoted string
The only way I've gotten this to work is:
eval(parse(":Name(\!""||str||"\!")"))
which is absurd
I use the column function instead:
column(str)
For clarity I include the dataset name as well:
column(dt, str)
Sometimes I've needed to use the as column function. Not sure if it applies here.
Regards,
Peter
Hi,
Can you also add some info on the usage of "As Column"? I am trying to pass a column name as a variable to the Split Table function, and I think the "As Column" function will help me do this. What I am trying looks something like this:
columnname = "data1"; // assume there are multiple columns of data like this, data2, data3, etc.
Current Data Table () << Split ( Split By (:DAY) ), Split (columnname) .... );
I think I need something like an As Column (columnname); statement in there...
Suggestions?
Thanks,
Charles
I'm not sure why you need COLUMN vs AS COLUMN. It seems to clarify things for JMP. I mostly use the COLUMN function, but I needed to use the AS COLUMN function in a where clause:
one_dme = "Electrolysis";
tmp_matrix = dmt << get rows where(:Time Period == "Current"
& as column(dmt, eval(one_dme)) == 1);
@PMroz
Thanks for your help. I could not get As Column to do anything for me, but your use of "eval" got me thinking, and I was able to get this syntax to work:
columnname = "data1";
Current Data Table () << Split ( Split By (:DAY) ), Split (eval(columnname)) .... );
FYI, Name() isn't a real function (despite the way it looks); it's a quoting mechanism handled by the parser. If you really want to create a name at run-time, use the As Name() function.