cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
jmp_jr
Level III

Stacking Columns in Script

I have a couple of questions about stacking data columns in a script. When I do it manually, I get the following script from JMP:

Data Table( "Untitled 11" ) << Stack(
columns(
:Name( "EFL 20508-17DT_CG_100ms" ),
:Name( "FFL 20508-17DT_CG_100ms" ),
:Name( "EFL 20508-18DT_CG_100ms" ),
:Name( "FFL 20508-18DT_CG_100ms" ),
:Name( "EFL 20508-19DT_NOCG_2" ),
:Name( "FFL 20508-19DT_NOCG_2" )
),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Number of Series( 2 )
)

In my script, I have a list variable (MyList1) containing the column names, and I would like to stack those columns using "Multiple Series Stack" to create a new table. Also, for "Number of Series" I would like to include NItems(MyList2). Can someone help me with the syntax?

I think this should work:

StackDT = SplitDT << Stack( Columns( MyList1 ),
Source Label Column( "Source" ),
Stacked Data Column( "Data" ),
Number of Series( NItems( MyList2 ) )
)
);

but it gives me "Column not found in access or evaluation of 'Bad Argument' " in the log.
10 REPLIES 10
dghidoni
Level II

Re: Stacking Columns in Script

please note that in JMP9 if you fail to generate correctly the list it will crash totally

for example this wil do:

listaNDD = {"5932_NDD","6038_NDD"};

def5932_NDD = {"chips","bubbles"};

def6038_NDD = {"big on top","small on top"};

for(i=1, i<(NItems(listaNDD)+1), i++,

    a=listaNDD;

    c=Concat(a,"_stacked");

    d=Concat("def",a);

    Open( Concat(a,".jmp"), invisible );

    Open( b, invisible );

Data Table( a ) << Stack(

    columns((d)),

    Source Label Column( "class" ),

    Stacked Data Column( "density" ),

    Name( "Non-stacked columns" )(Keep(    :Split,    :Lot ID, :WID)),

    Output Table( c )

    );

);

because d it's not the list but a variable containing the name of the list ...

Recommended Articles