It’s World Statistics Day! To honor the theme of the day, the JMP User Community is having conversations about the importance of trust in statistics and data. And we want to hear from you! Tell us the steps you take to ensure that your data is trustworthy.
Choose Language Hide Translation Bar
Highlighted
robinson
Level I

Interactively select a column to perform an operation (say Log of a column) and place results in a new column using JSL

I am trying use JSL to interactively choose a column from a DT perform an operation on that column and place in a new column. I cannot get the syntax correct to execute the operation.  Enclosed is my script and a sample DT.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
ms
Super User ms
Super User

Re: Interactively select a column to perform an operation (say Log of a column) and place results in a new column using JSL

It can be tricky to pull a column from a dialog and put into a column formula.

Here is one way to do it, based on your example:

Names Default To Here(1);

dt = Current Data Table();

cdlg = Column Dialog(sel = ColList("Select Col", MinCol(1), MaxCol(1)));

f = Eval Expr(Log(Expr(cdlg["sel"][1])));

szz = cdlg["sel"][1] << get name;

dt << New Column("Log of " || szz, numeric, continuous, formula(Name Expr(f)));


View solution in original post

2 REPLIES 2
Highlighted
ms
Super User ms
Super User

Re: Interactively select a column to perform an operation (say Log of a column) and place results in a new column using JSL

It can be tricky to pull a column from a dialog and put into a column formula.

Here is one way to do it, based on your example:

Names Default To Here(1);

dt = Current Data Table();

cdlg = Column Dialog(sel = ColList("Select Col", MinCol(1), MaxCol(1)));

f = Eval Expr(Log(Expr(cdlg["sel"][1])));

szz = cdlg["sel"][1] << get name;

dt << New Column("Log of " || szz, numeric, continuous, formula(Name Expr(f)));


View solution in original post

Highlighted
robinson
Level I

Re: Interactively select a column to perform an operation (say Log of a column) and place results in a new column using JSL

Works Great. Much Appreciated

Article Labels

    There are no labels assigned to this post.