Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level VI

## << Select Where (for Fast Execution)

I would like to select missing rows of a data table using the << Select Where function (so that they can be deleted).  My problem is that this seems to take a very long time for large data tables.  Is there a faster way to execute this?  I am using JMP11.  Thanks!

// Selecting Missing Columns.

Names Default To Here( 1 );

t1 = Tick Seconds();

dt = New Table( "1000000 Rows", Add Rows( 1000000 ),

New Column( "Hello!", Character, Nominal, Values( {"Hi!"} ) ),

New Column( "Good Bye!", Character, Nominal, Values( {"", "Bye!"} ) )

);

dt << Select Where( Is Missing( As Column( "Hello!" ) ) & Is Missing( As Column( "Good Bye!" ) ) );

t2 = Tick Seconds();

Print( Concat( Char( t2 - t1 ), " seconds." ) );

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: << Select Where (for Fast Execution)

For large tables it can be faster to select rows via a summary table.

Try this:

t1 = Tick Seconds();

dt = New Table( "1000000 Rows", Add Rows( 1000000 ),

New Column( "Hello!", Character, Nominal, Values( {"Hi!"} ) ),

New Column( "Good Bye!", Character, Nominal, Values( {"", "Bye!"} ) )

);

dtsum = dt << Summary(Group(:Name("Hello!"), :Name("Good Bye!")), invisible);

dtsum << select rows(1);

Close(dtsum, no save);

t2 = Tick Seconds();

Print(Concat(Char(t2 - t1), " seconds."));

2 REPLIES 2
Highlighted
Super User

## Re: << Select Where (for Fast Execution)

For large tables it can be faster to select rows via a summary table.

Try this:

t1 = Tick Seconds();

dt = New Table( "1000000 Rows", Add Rows( 1000000 ),

New Column( "Hello!", Character, Nominal, Values( {"Hi!"} ) ),

New Column( "Good Bye!", Character, Nominal, Values( {"", "Bye!"} ) )

);

dtsum = dt << Summary(Group(:Name("Hello!"), :Name("Good Bye!")), invisible);

dtsum << select rows(1);

Close(dtsum, no save);

t2 = Tick Seconds();

Print(Concat(Char(t2 - t1), " seconds."));

Highlighted
Level VI

## Re: << Select Where (for Fast Execution)

Thanks again, MS!

Article Labels

There are no labels assigned to this post.