turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- How to apply a formula to an existing column with ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 28, 2016 7:37 AM
(639 views)

Hi all,

I would like to apply the same formula to multiple existing columns in my data table using JSL.

I have one column that says 0V and the other that says RP_0V. I would like to apply a formula to column RP_0V using the 0V column. I have to do this many times (for column RP_10V using the column 10V, etc.)

I am having a lot of trouble figuring out the syntax for it, and I bet it is pretty simple...

for(i=0, i<=65, i++,

colName =Column(char(i*10)||"V");

dtSummary:("RP_"||char(i*10)||"V") = Formula(100*Col Rank(:colName)/1006);

);

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Solution

I got it to work! My main problem was that I wasn't using *AsColumn*.

for(i=0, i<=0, i++,

colName =Column(char(i*10)||"V");

colRP=("RP_"||char(i*10)||"V");

Column(colRP) <<Formula((100*Col Rank(:AsColumn(colName))/(1006)));

);

1 REPLY

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I got it to work! My main problem was that I wasn't using *AsColumn*.

for(i=0, i<=0, i++,

colName =Column(char(i*10)||"V");

colRP=("RP_"||char(i*10)||"V");

Column(colRP) <<Formula((100*Col Rank(:AsColumn(colName))/(1006)));

);