Subscribe Bookmark RSS Feed

Splitting A Column Containing Numeric and Character Information

d_barnett

Community Trekker

Joined:

Nov 30, 2011

I have an 'Initial Output File' data table that contains a column with both Numeric and Character data in it. This is coded as Character so that the data is available for use as if I make it numeric the character data disappears.

What I want to do is to split this column and create columns that are numeric for numbers and Character for the names,

8669_pastedImage_0.png

I've tried various things and can't seem to get this to automatically format the columns like this so that the final output is the same as in the 'required output format'.

I've had a look on the user community and can't see anything to answer my question, but I can't believe that it isn't possible within JMP.

Regards


David

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Throw a little JSL at it:

dt = Data Table( "Initial Output File" );

dt_split = dt << Split(

     Split By( :Name ),

     Split( :Char_value ),

     Group( :Name( "Barcode/DMC" ), :Order )

);

// Set the format of the new columns

numeric_cols = {"Absolute % target", "Mass Dispensed", "Mass from balance",

"Relative Amount %", "Start Time", "Stop Time", "Target weight (g)"};

for (i = 1, i <= nitems(numeric_cols), i++,

     col_name = numeric_cols[i];

     column(dt_split, col_name) << data type(numeric) << Set Modeling Type( Continuous );;

);

1 REPLY
Solution

Throw a little JSL at it:

dt = Data Table( "Initial Output File" );

dt_split = dt << Split(

     Split By( :Name ),

     Split( :Char_value ),

     Group( :Name( "Barcode/DMC" ), :Order )

);

// Set the format of the new columns

numeric_cols = {"Absolute % target", "Mass Dispensed", "Mass from balance",

"Relative Amount %", "Start Time", "Stop Time", "Target weight (g)"};

for (i = 1, i <= nitems(numeric_cols), i++,

     col_name = numeric_cols[i];

     column(dt_split, col_name) << data type(numeric) << Set Modeling Type( Continuous );;

);