- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: using eval expr() with a column name
You might have better luck with :name("names"), or better yet :name(column1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.