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
- :
- Discussions
- :
- Running a quick calculation on a subset of data

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

Highlighted
##
##### Running a quick calculation on a subset of data

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

Nov 24, 2010 5:46 AM
(994 views)

Please see comments below. The part of the code I need some assistance on is on how to compute a condition on the subset of rows and return to variable result2.

dt << clear row states;

dt << select where( !(:PartNo == "81817" & :Month == "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );

dt << invert row selection;

result = dt << Get selected rows;

result = N Row (result);

// Code works fine up to this point

//Would like to run additional analysis only on selected rows,

// however, the following code carries out the calculation on the entire col

// instead of just the selected rows

result2 = dt << Select Where (:Name("Margin Col")<=5);

result2 = N Row (result2);

FailRate = result2/result;

dt << clear row states;

dt << select where( !(:PartNo == "81817" & :Month == "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );

dt << invert row selection;

result = dt << Get selected rows;

result = N Row (result);

// Code works fine up to this point

//Would like to run additional analysis only on selected rows,

// however, the following code carries out the calculation on the entire col

// instead of just the selected rows

result2 = dt << Select Where (:Name("Margin Col")<=5);

result2 = N Row (result2);

FailRate = result2/result;

1 REPLY

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

> Please see comments below. The part of the code I

> need some assistance on is on how to compute a

> condition on the subset of rows and return to

> variable result2.

>

> dt << clear row states;

> dt << select where( !(:PartNo == "81817" & :Month ==

> "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) <<

> Hide( 1 );

> dt << invert row selection;

> result = dt << Get selected rows;

> result = N Row (result);

> // Code works fine up to this point

>

>

> //Would like to run additional analysis only on

> selected rows,

> // however, the following code carries out the

> calculation on the entire col

> // instead of just the selected rows

> result2 = dt << Select Where (:Name("Margin

> Col")<=5);

> result2 = N Row (result2);

>

> FailRate = result2/result;

dt << clear row states;

dt << select where( !(:PartNo == "81817" & :Month == "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );

dt << invert row selection;

result = dt << Get selected rows;

result = N Row (result);

// Code works fine up to this point

//Would like to run additional analysis only on selected rows,

// however, the following code carries our the calculation on the entire col

// instead of just the selected rows

result2 = dt << Select Where (:Name("Margin Col")<=5);

result2 = N Row (result2);

> need some assistance on is on how to compute a

> condition on the subset of rows and return to

> variable result2.

>

> dt << clear row states;

> dt << select where( !(:PartNo == "81817" & :Month ==

> "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) <<

> Hide( 1 );

> dt << invert row selection;

> result = dt << Get selected rows;

> result = N Row (result);

> // Code works fine up to this point

>

>

> //Would like to run additional analysis only on

> selected rows,

> // however, the following code carries out the

> calculation on the entire col

> // instead of just the selected rows

> result2 = dt << Select Where (:Name("Margin

> Col")<=5);

> result2 = N Row (result2);

>

> FailRate = result2/result;

dt << clear row states;

dt << select where( !(:PartNo == "81817" & :Month == "1/2010" & :JobID == "PROD" )) << Exclude( 1 ) << Hide( 1 );

dt << invert row selection;

result = dt << Get selected rows;

result = N Row (result);

// Code works fine up to this point

//Would like to run additional analysis only on selected rows,

// however, the following code carries our the calculation on the entire col

// instead of just the selected rows

result2 = dt << Select Where (:Name("Margin Col")<=5);

result2 = N Row (result2);