cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
terapin
Level VI

How do you remove missing data from lists (JSL)?

I'm trying to figure out how to remove data from a series of two lists that are generated by a Summarize JSL command.  I have been playing with the Remove From() command, but can't seem to remove the missing growth and corresponding date data from their respective lists.  Any suggestions would be appreciated.

Specifically, I want to remove from the max_growth_list that data that is missing and to remove the date data from the growth_date_list that corresponds to the missing growth data.

dt1 = New Table( "Growth",

  Add Rows( 20 ),

  New Column( "Date",

  Numeric,

  Continuous,

  Format( "m/d/y h:m", 10 ),

  Input Format( "m/d/y h:m" ),

  Set Values(

  [1767245800, 1771173900, 1805155800, 1809197400, 1843086800, 1838161000, 1889049900, 1893293200,

  1896320800, 1900281600, 1950766400, 1955499200, 1957751200, 1964247600, 1990396800, 1995976400,

  2023788000, 2029549600, 2051488600, 2056959000]

  )

  ),

  New Column( "Growth",

  Numeric,

  Continuous,

  Format( "Best", 12 ),

  Set Values( [34, 45, ., 56, 99, 67, 12, 78, 53, 89, 77, 90, ., 12, 73, 23, 12, 34, 6, 45] )

  ),

  New Column( "Year", Numeric, Continuous, Format( "Best", 12 ), Formula( Year( :Date ) ), Lock( 1 ) ),

  New Column( "Hour", Numeric, Continuous, Format( "Best", 12 ), Formula( Hour( :Date ) ), Lock( 1 ) )

);

 

Wait( 2 );

// Get the highest growth for each day

Summarize( growth_date_list = by( :Date ), max_growth_list = Max( :Growth ) );

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: How do you remove missing data from lists (JSL)?

Hi Terapin,

Use loc(!is missing(max_growth_list)) to as an index into your list or matrix.

Like this:

Summarize( growth_date_list = by( :Date ), max_growth_list = Max( :Growth ) );

Show( growth_date_list, max_growth_list );

growth_date_list = growth_date_list[Loc( !Is Missing( max_growth_list ) )];

max_growth_list = max_growth_list[Loc( !Is Missing( max_growth_list ) )];

Show( growth_date_list, max_growth_list );


-Jeff

-Jeff

View solution in original post

3 REPLIES 3
Jeff_Perkinson
Community Manager Community Manager

Re: How do you remove missing data from lists (JSL)?

Hi Terapin,

Use loc(!is missing(max_growth_list)) to as an index into your list or matrix.

Like this:

Summarize( growth_date_list = by( :Date ), max_growth_list = Max( :Growth ) );

Show( growth_date_list, max_growth_list );

growth_date_list = growth_date_list[Loc( !Is Missing( max_growth_list ) )];

max_growth_list = max_growth_list[Loc( !Is Missing( max_growth_list ) )];

Show( growth_date_list, max_growth_list );


-Jeff

-Jeff
terapin
Level VI

Re: How do you remove missing data from lists (JSL)?

Thanks Jeff for the speedy and informative reply,

Can you tell me how the !Is Missing command is different from the plain vanilla Is Missing? The script guide doesn't explain the difference.

pmroz
Super User

Re: How do you remove missing data from lists (JSL)?

The exclamation point is a logical NOT.  You can use it in many circumstances to negate a logical test.

So, !Is Missing simply means something is not missing.