cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
UserID16644
Level V

How to evaluate each column?

Hi all,

I have Amplitude 21 as an example data table, and for example, I want to determine if the amplitude passes or fail. How can I evaluate each columns if they are pass/fail?

 

For example: 

Amplitude limit is 4. Every amplitude value with > 4 and < 4 will be marked as failed using a new column.

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Amplitude 21.jmp");
New Column ("Pass/Fail", Character)

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to evaluate each column?

To make sure that we are fully understanding each other, in regards to columns and rows.  In the Amplitude 21 data table, there are 4 columns(Labels, Amplitude, x, y)  and 21 rows.  Therefore your question

     "How can I apply these in multiple columns? with different set of limits"?

You would just create an additional column.  If you wanted to apply limits to both Column Amplitude and Column X it would look like this

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Amplitude 21.jmp" );
New Column( "Pass/Fail",
	Character,
	formula( If( 4 < :amplitude < 6, "Pass", "Fail" ) )
);
New Column( "Pass/Fail X",
	Character,
	formula( If( 0.5 < :x < 2, "Pass", "Fail" ) )
);

 

 

Jim

View solution in original post

4 REPLIES 4
jemg
Level III

Re: How to evaluate each rows?

You can use For Each Row() !

 

Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
For Each Row( :height = -:height );
MGO
txnelson
Super User

Re: How to evaluate each column?

I don't understand how Amplitude can be > 4 and < 4 unless you are looking for Amplitude values that has the exact value of 4.Below are 3 different ways to do value checking.  I hope they make sense to you.  BTW, formulas automatically loop through all rows in a data table and run the JSL on each row.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Amplitude 21.jmp" );
New Column( "Pass/Fail",
	Character,
	formula( If( 4 < :amplitude < 6, "Pass", "Fail" ) )
);
//or
New Column( "Pass/Fail 2",
	Character,
	formula(
		If( :amplitude < 4 | :amplitude > 6,
			"Fail",
			"Pass"
		)
	)
);
//or if you are looking for values that are exactly 4
New Column( "Pass/Fail 3",
	Character,
	formula(
		If( :amplitude == 4 ,
			"Fail",
			"Pass"
		)
	)
);

Please take the time to read the Discovering JMP documentation, found under the Help pull down menu.

Jim
UserID16644
Level V

Re: How to evaluate each column?

Hi txnelson,

Thank you for explaining it clearly. Just an additional question,

How can I apply these in multiple columns? with different set of limits

txnelson
Super User

Re: How to evaluate each column?

To make sure that we are fully understanding each other, in regards to columns and rows.  In the Amplitude 21 data table, there are 4 columns(Labels, Amplitude, x, y)  and 21 rows.  Therefore your question

     "How can I apply these in multiple columns? with different set of limits"?

You would just create an additional column.  If you wanted to apply limits to both Column Amplitude and Column X it would look like this

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Amplitude 21.jmp" );
New Column( "Pass/Fail",
	Character,
	formula( If( 4 < :amplitude < 6, "Pass", "Fail" ) )
);
New Column( "Pass/Fail X",
	Character,
	formula( If( 0.5 < :x < 2, "Pass", "Fail" ) )
);

 

 

Jim