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

## split data table without including excluded data

Hello all,

I am trying to split a data table that has some bad data in it. I have exleded those bad data in the original table, but I don't know why those data are showling up in split table.

My script is bellow:

dt_daily << New Column( "Outliers Exclusion", Numeric, Continuous, Formula( If( :Mahal. Distances > 1.96, 0, 1 ) ), eval formula );

dt_daily << select where( :Outliers Exclusion == 0 ) << exclude;
Wait( 0 );
dt_dailysplit = dt_daily << Split( Split By( :EquipmentName ), Split( :Energy % from Controls ), Remaining Columns( drop all ) );
Wait( 0 );

dt_daily  is the original table, you can see that I did some exculsion over there.

dt_dailysplit is the new split data table

5 REPLIES 5
Highlighted
Super User

## Re: split data table without including excluded data

The Split platform appears to not support the "Excluded" state.  You will need to either delete the rows, or select the nonexcluded rows and then subset them to a new data table, and then split that data table.

Jim
Highlighted

Highlighted

## Re: split data table without including excluded data

Hello Jim,

I don't want to delete these data and am tring to subset them into a new table. Could you please give me some help on script part for select ing nonexcluded rows and then subset them to a new data table?

Thanks you so much!

Winnie

Highlighted
Super User

## Re: split data table without including excluded data

Here is a simple example:

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

dt << select where( Excluded( Row State() ) == 0 );

dtSub = dt << subset( selected rows( 1 ), selected columns( 0 ) );``````

To learn about how to set and use the various RowState capabilites, see the secion on Row States in the Scripting Guide

Help==>Books==>Scripting Guide

Jim
Highlighted

## Re: split data table without including excluded data

It is super helpful for me! Thanks again!

Article Labels

There are no labels assigned to this post.