Subscribe Bookmark RSS Feed

<< Select Where (for Fast Execution)

robot

Community Trekker

Joined:

Feb 27, 2012

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
Solution

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
Solution

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."));


robot

Community Trekker

Joined:

Feb 27, 2012

Thanks again, MS!