cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

using eval expr() with a column name

can some one help me in using eval expr() function with column name;

example:

column1="names";

eval expr(":"||column1);

is the above evel expr() refers to names column? if so please help me with the syntax..(for referring column names)

3 REPLIES 3
pmroz
Super User

Re: using eval expr() with a column name

You might have better luck with :name("names"), or better yet :name(column1)

jmp_jr
Level III

Re: using eval expr() with a column name

This will get you what you want. . .

column1="names";

var = parse(":"||temp);

However, a better general implementation that will work no matter how the column is named is to use:

var = Parse(":Name(\!"" || (col << Get Name()) || "\!")");

where col is a column reference (if you already have it).  If you don't you can replace the middle part of the concatenation with column1 from above (or the string "names" itself).

jmp_jr
Level III

Re: using eval expr() with a column name

If this question is not answered, I guess I do not understand the question.  Here is another answer . . .

In this case, eval expr() is not working as I would expect.  However, I almost never use eval expr() instead I would write

column1 = "names";

val = Eval(Expr(":" || column1));

If you run this, val = ":names"

Alternatively, you could simply write

val = Eval(":" || column1);

or

val = ":" || column1;

However, if you want to actually refer to the column whose name is "names" then you will have to parse val. . .

val2 = parse(val);

Now you can, for example, get the value in row one of this column by running val2[1].

If your question is not answered at this point, please restate your question.

Recommended Articles