Choose Language Hide Translation Bar
Highlighted
D_T_M
Level II

Unable to create two different stacked tables

Hi @txnelson , 

 

I have a data set with close to a hundred thousand columns, labeled as "PG1_1s_xxxxx" or "PG1_1US_xxxx". I intend to stack these columns separately into two different tables and continue with my analysis. Here's a sample of my script that I wrote to do the same. 

dt = current data table();

colList = dt << Get Column Names( Numeric, "Continuous" );

For( i = 1, i <= N Items( colList ), i++,
	If( Contains( colList[i], "PG1_1S_" )  &
             Contains( colList[i], "MED" )
             Column( colList[i] ) << Set Selected( 1 )
	)
);

dt << Stack(
			column(dt << get selected columns()),
			Source Label Column("Label"),
			Stacked Data Column("RBER"),
			Name("Non-stacked Columns")(Keep(::LOT, :SLOT, :ROW, :COL, :JOB_NAME)),
			Output table("PG1_1S"));

Data table("PG1_1S") << Graph Builder(
			Variables( X( :V ), Y( :RBER ), Group X( :Deck ), Overlay( :JOB_NAME ) ),
			Elements( Line( X, Y, Legend( 6 ) ) ),
			Local Data Filter( Add Filter( columns( :Type ) ) ),
			SendToReport(
				Dispatch(
					{},
					"RBER",
					ScaleBox,
					{Scale( "Log" ), Format( "Scientific", 12, 0 ),
					Min( 0.0000000027082467925 ), Max( 1.02000000009481 ), Inc( 1 ),
					Minor Ticks( 0 )}
				)
			)
		);

// Creating the second stacked table. colList = dt << Get Column Names( Numeric, "Continuous" ); For( i = 1, i <= N Items( colList ), i++, If( Contains( colList[i], "PG1_1US_" ) & Contains( colList[i], "MED" ) Column( colList[i] ) << Set Selected( 1 ) ) ); dt << Stack( column(dt << get selected columns()), Source Label Column("Label"), Stacked Data Column("RBER"), Name("Non-stacked Columns")(Keep(::LOT, :SLOT, :ROW, :COL, :JOB_NAME)), Output table("PG1_1US")); Data table("PG1_1US") << Graph Builder( Variables( X( :V ), Y( :RBER ), Group X( :Deck ), Overlay( :JOB_NAME ) ), Elements( Line( X, Y, Legend( 6 ) ) ), Local Data Filter( Add Filter( columns( :Type ) ) ), SendToReport( Dispatch( {}, "RBER", ScaleBox, {Scale( "Log" ), Format( "Scientific", 12, 0 ), Min( 0.0000000027082467925 ), Max( 1.02000000009481 ), Inc( 1 ), Minor Ticks( 0 )} ) ) );

When I run this script, It only creates the first stacked table "PG1_1S", but not the second one. How do I modify this to create to different stacked tables. 

 

Thanks

 

3 REPLIES 3
Highlighted
phil_kay
Staff

Re: Unable to create two different stacked tables

Just some advice on how to post in a way that will help others in the community to help you:

It is great that you have included some script but...

Your script refers to a data table that you have not provided. So that will make it difficult for anyone to use the script to answer your question.

A lot of your script does not seem relevant to the question that you have.

I recommend that you find a simple example using a JMP sample data set (Big Class is always good) that illustrates the problem that you have. In that way it will also be helpful for other people that find they have the same problem. It is not really fair to expect people to fix your JSL only for your specific requirements.
Highlighted
D_T_M
Level II

Re: Unable to create two different stacked tables

Apologize for the lack of clarity in my question. I'll adhere to the guidelines as you've requested from here after. Thanks for pointing it out. 

Highlighted
txnelson
Super User

Re: Unable to create two different stacked tables

Off hand, what I see, is that you are not clearing your column selections before either of your pieces of code where you select the columns you want to use in the stacking.  It is probably a pretty good bet that no columns have been selected for the first stacking, but in the second stacking, all of the selected columns from the 1 stacking remain, and your second selection setting just adds to the columns that were selected from the first stacking.

Jim
Article Labels

    There are no labels assigned to this post.