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

How to add a row with count of rows matching a certain criteria

Hello,

I am trying to add a row in the end of a data table with a fixed text in first column "Bucket" and in subsequent columns count the number of rows that have value more than 95 in that column. is this doable with a jsl script?

 

newbie_4_0-1688516986955.png

 

1 REPLY 1
txnelson
Super User

Re: How to add a row with count of rows matching a certain criteria

While it is a simple task to add your suggested summary row to the data table, typically, it is not a good idea to mix summary data in with raw data in JMP.  A JMP data table is not a Spreadsheet.  The preferred form would be to create a separate data table with the statistical summaries, and to leave the raw data in the original format, to allow for easy processing with other JMP platforms.  JMP platforms assume that all rows in a data table are of the same summary level.  .

Here is the JSL that would do what you want

Names Default To Here( 1 );
dt = Current Data Table();

dt << Add Rows( 1 );
:Platform[N Rows( dt )] = "Bucket";
:Week 1[N Rows( dt )] = Col Number( If( :Week 1 > 95, :Week 1, . ) );
:Week 2[N Rows( dt )] = Col Number( If( :Week 2 > 95, :Week 2, . ) );

Most of the time, the structure of your data table would be different, making it easier to analyze in JMP.

txnelson_0-1688526892169.png

 

Jim