<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trouble Manipulating Tabulated Tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108616#M39504</link>
    <description>The dtFinalYield is supposed to just be dtFinal.. When i attach scripts to this forum, i have to rename everything and I missed that one.. My apologies.&lt;BR /&gt;&lt;BR /&gt;I see the issues with the '=' sign instead of the '&amp;lt;&amp;lt;' I am not sure why i was doing that..</description>
    <pubDate>Fri, 01 Feb 2019 15:12:42 GMT</pubDate>
    <dc:creator>Yngeinstn</dc:creator>
    <dc:date>2019-02-01T15:12:42Z</dc:date>
    <item>
      <title>Trouble Manipulating Tabulated Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108602#M39498</link>
      <description>&lt;P&gt;I am don't quite understand why i am having issues manipulating columns from a table created from a tabulated report. I have attached the tables and scripts for your references. I am trying to create a table that matches our current report table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Always, thanks for you help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

LotListSQLString = "Wafer_1";

	tab = dt  
		&amp;lt;&amp;lt; Tabulate(
		invisible,
			Show Control Panel( 0 ),
			Add Table(
				Column Table( 
					Category Table, 
					Statistics(
						N,
						Name( "% of Total" ) 
					) 
				),
				
				Row Table( 
					Columns by Categories( 
						:Name( "test" ),
						:Name( "[Rx] test1" ),
						:Name( "[Rx] test2" ),
						:Name( "[Rx] test3" ),
						:Name( "[Tx] test1" ),
						:Name( "[Tx] test2" ),
						:Name( "[Tx] test3" ),
						:Name( "test4" ),
						:Name( "Composite" )	
					 ) 
				 )
			)
		);
		
	dtFinal = tab &amp;lt;&amp;lt; Make Into Data Table;
	
	Wait( 1 );
	
	dtFinal &amp;lt;&amp;lt; set name( " Yield Report" );
	
	dtFinal = New Column( "Mode",
		&amp;lt;&amp;lt; Formula( 
			If( (:Columns by Categories == "test" ), "-",
				IF( :Columns by Categories == "[Rx] test1", "Rx", 
					IF( :Columns by Categories == "[Rx] test2", "Rx",
						IF( :Columns by Categories == "[Rx] test3", "Rx",
							IF( :Columns by Categories == "[Tx] test1", "Tx", 
								IF( :Columns by Categories == "[Tx] test2", "Tx",
									IF( :Columns by Categories == "[Tx] test3", "Tx",
										If( :Columns by Categories == "test4", "-"
										)
									)
								)
							)
						)
					)
				)
			)
		)
	);
	
	Wait( 0 );
	
	dtFinal = New Column( "TestName",
		&amp;lt;&amp;lt; Formula( 
			If( (:Columns by Categories == "test" ), "test",
				IF( :Columns by Categories == "[Rx] test1", "test1", 
					IF( :Columns by Categories == "[Rx] test2", "test2",
						IF( :Columns by Categories == "[Rx] test3", "test3",
							IF( :Columns by Categories == "[Tx] test1", "test1", 
								IF( :Columns by Categories == "[Tx] test2", "test2",
									IF( :Columns by Categories == "[Tx] test3", "test3",
										If( :Columns by Categories == "test4", "test4"
										)
									)
								)
							)
						)
					)
				)
			)
		)
	);
	
// ------------------------ BEGIN FORMATING TABLE FOR FINAL REPORTING

// Says Scriptable[] but won't delete
	
	dtFinal &amp;lt;&amp;lt; Delete Columns( {"N(Fail)", "% of Total(Fail)"} );

// Works Correctly

	dtFinal = New Column( "wafer_number",
		&amp;lt;&amp;lt; Formula(
			LotListSQLString
		)
	);

// Says Scriptable[] but won't go to column and obviously doesn't move

	dtFinal &amp;lt;&amp;lt; Go To( "wafer_number" );
	Wait ( 0.5 );
	dtFinal &amp;lt;&amp;lt; move selected Columns( To First );
	dtFinal &amp;lt;&amp;lt; clear Column selection;

// Works Correctly
	
	dtFinal = Column( "Mode" ) &amp;lt;&amp;lt; Delete Formula;
	dtFinal = Column( "TestName" ) &amp;lt;&amp;lt; Delete Formula;
	
// Says Scriptable[] but won't go to column and obviously doesn't move
	
	dtFinal &amp;lt;&amp;lt; Go To( :Mode );
	Wait ( 1 );
	dtFinal &amp;lt;&amp;lt; move selected Columns( after( "wafer_number" ) );
	dtFinal &amp;lt;&amp;lt; Clear Column Selection;
	
// Says Scriptable[] but won't go to delete

	dtFinal &amp;lt;&amp;lt; Delete Columns( :Columns by Categories);

// Says Scriptable[] but won't go to delete
	
	dtFinal &amp;lt;&amp;lt; go to( :TestName );
	Wait( 1 );
	dtFinal &amp;lt;&amp;lt; Move Selected Column( after( "name" ) );
	dtFinal &amp;lt;&amp;lt; clear Column selection;

// Works Correctly
	
	lot = "XYZ";
	
	part = New Column( "part_number" );
	part &amp;lt;&amp;lt; Set Formula( lot );

// Says Scriptable[] but won't go to column and obviously doesn't move
	
	dtFinal &amp;lt;&amp;lt; go to( :part_number );
	Wait ( 1 );
	dtFinal &amp;lt;&amp;lt; Move Selected Column( after( "name" ) );
	dtFinal &amp;lt;&amp;lt; clear Column selection;

// Works Correctly
	
	die = 334;
	
	numdie = New Column( "NumDie" );
	numdie &amp;lt;&amp;lt; Set Formula( die ); 

// Says Scriptable[] but won't go to column and obviously doesn't move
	
	dtFinal&amp;lt;&amp;lt; go to( :NumDie );
	Wait ( 1 );
	dtFinalYield&amp;lt;&amp;lt; move selected Columns( after( "part_number" ) );
	dtFinalYield&amp;lt;&amp;lt; clear Column selection;
	
	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:22:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108602#M39498</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2019-02-01T12:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Manipulating Tabulated Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108611#M39499</link>
      <description>&lt;P&gt;i run your script with your data without problem....&lt;/P&gt;&lt;P&gt;created tabulate report and related table.... and is also possible to modify such table....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you explain better what kind of trouble you have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ciao&lt;/P&gt;&lt;P&gt;Gianpaolo&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:16:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108611#M39499</guid>
      <dc:creator>gianpaolo</dc:creator>
      <dc:date>2019-02-01T13:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Manipulating Tabulated Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108612#M39500</link>
      <description>&lt;P&gt;Incorrect syntax created several name collisions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtFinal = tab &amp;lt;&amp;lt; Make Into Data Table;
	
	Wait( 1 );
	
	dtFinal &amp;lt;&amp;lt; set name( " Yield Report" );
	
	dtFinal = New Column( "Mode",&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As written your script expects, dtFinal to be the table reference, yet the syntax dtFinal = New Column() is assigning the new column to reference dtFinal.&amp;nbsp; The syntax should be dtFinal &amp;lt;&amp;lt; New Column( )&amp;nbsp; also at the end of your script you refer to dtFinalyield, there is no such table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also you should look up the syntax for JMP If() functions. You do not need to nest the the ifs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If (cond1, result1, cond2, result2, ...condk, result k, else);&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:39:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108612#M39500</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-02-01T13:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Manipulating Tabulated Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108614#M39502</link>
      <description>&lt;P&gt;Below is my review of your script......the issues seem to be not understanding the difference between when to use "=" and when to use "&amp;lt;&amp;lt;", and also you seem to be more careful, which sometimes relates to not totally understanding JSL.&amp;nbsp; So I strongly suggest that you read the Scripting Guide!&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;
&lt;P&gt;Here is my annotated script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

LotListSQLString = "Wafer_1";

	tab = dt  
		&amp;lt;&amp;lt; Tabulate(
		invisible,
			Show Control Panel( 0 ),
			Add Table(
				Column Table( 
					Category Table, 
					Statistics(
						N,
						Name( "% of Total" ) 
					) 
				),
				
				Row Table( 
					Columns by Categories( 
						:Name( "test" ),
						:Name( "[Rx] test1" ),
						:Name( "[Rx] test2" ),
						:Name( "[Rx] test3" ),
						:Name( "[Tx] test1" ),
						:Name( "[Tx] test2" ),
						:Name( "[Tx] test3" ),
						:Name( "test4" ),
						:Name( "Composite" )	
					 ) 
				 )
			)
		);
		
	dtFinal = tab &amp;lt;&amp;lt; Make Into Data Table;
	
	Wait( 1 );
	
	dtFinal &amp;lt;&amp;lt; set name( " Yield Report" );
	
	// changed from 
	// dtFinal = New Column( "Mode", 
	// to
	dtFinal &amp;lt;&amp;lt; New Column( "Mode", character,
		// More efficient way to code the If()
		Formula(
			If(
				:Columns by Categories == "test", "-",
				:Columns by Categories == "[Rx] test1", "Rx",
				:Columns by Categories == "[Rx] test2", "Rx",
				:Columns by Categories == "[Rx] test3", "Rx",
				:Columns by Categories == "[Tx] test1", "Tx",
				:Columns by Categories == "[Tx] test2", "Tx",
				:Columns by Categories == "[Tx] test3", "Tx",
				:Columns by Categories == "test4", "-"
			)
		)
	);
	
	Wait( 0 );
	// changed from 
	// dtFinal = New Column( "TestName", 
	// to
	dtFinal &amp;lt;&amp;lt; New Column( "TestName", character,
		// More efficient way to code the If()
		Formula(
			If(
				:Columns by Categories == "test", "test",
				:Columns by Categories == "[Rx] test1", "test1",
				:Columns by Categories == "[Rx] test2", "test2",
				:Columns by Categories == "[Rx] test3", "test3",
				:Columns by Categories == "[Tx] test1", "test1",
				:Columns by Categories == "[Tx] test2", "test2",
				:Columns by Categories == "[Tx] test3", "test3",
				If( :Columns by Categories == "test4",
					"test4"
				)
			)
		)
	);
	
// ------------------------ BEGIN FORMATING TABLE FOR FINAL REPORTING

// Says Scriptable[] but won't delete
// You had not used the proper syntax in the above step, so that dtFinal 
// was changed from a data table pointer to pointer to column "TestName"
	
	dtFinal &amp;lt;&amp;lt; Delete Columns( {"N(Fail)", "% of Total(Fail)"} );

// Works Correctly
	// changed from 
	// dtFinal = New Column( "wafer_number",
	// to
	dtFinal &amp;lt;&amp;lt; New Column( "wafer_number", character,
		&amp;lt;&amp;lt; Formula(
			LotListSQLString
		)
	);

// Says Scriptable[] but won't go to column and obviously doesn't move

	dtFinal &amp;lt;&amp;lt; Go To( "wafer_number" );
	Wait ( 0.5 );
	dtFinal &amp;lt;&amp;lt; move selected Columns( To First );
	dtFinal &amp;lt;&amp;lt; clear Column selection;

// Works Correctly
	// Changed from
	// dtFinal = Column( "Mode" ) &amp;lt;&amp;lt; Delete Formula;
	// to
	dtFinal:Mode &amp;lt;&amp;lt; Delete Formula;
	// Changed from
	// dtFinal = Column( "TestName" ) &amp;lt;&amp;lt; Delete Formula;
	// to
	dtFinal:TestName &amp;lt;&amp;lt; Delete Formula;
	
// Says Scriptable[] but won't go to column and obviously doesn't move

	// With keeping dtFinal as a pointer to the data table this now works	
	dtFinal &amp;lt;&amp;lt; Go To( :Mode );
	// Wait ( 1 ); // not necessary wait
	dtFinal &amp;lt;&amp;lt; move selected Columns( after( "wafer_number" ) );
	dtFinal &amp;lt;&amp;lt; Clear Column Selection;
	
// Says Scriptable[] but won't go to delete
	
	// With keeping dtFinal as a pointer to the data table this now works
	dtFinal &amp;lt;&amp;lt; Delete Columns( :Columns by Categories);

// Says Scriptable[] but won't go to delete
	
	dtFinal &amp;lt;&amp;lt; go to( :TestName );
	//Wait( 1 );
	// changed from
	// dtFinal &amp;lt;&amp;lt; Move Selected Column( after( "name" ) );
	// to
	dtFinal &amp;lt;&amp;lt; Move Selected Column( after( :name("N(Pass)" ) ) );
	dtFinal &amp;lt;&amp;lt; clear Column selection;

// Works Correctly
	
	// This form will not work, once you save the table and reopen it
	// because the formula requires a variable named Lot
	//lot = "XYZ";
	
	//part = New Column( "part_number" );
	//part &amp;lt;&amp;lt; Set Formula( lot );
	// here is a form that will work
	dtFinal &amp;lt;&amp;lt; New Column( "part_number", character, set each value("XYZ" ) );

// Says Scriptable[] but won't go to column and obviously doesn't move
	
	dtFinal &amp;lt;&amp;lt; go to( :part_number );
	//Wait ( 1 );
	// There is not a column named "name", therefore 
	// changed
	// dtFinal &amp;lt;&amp;lt; Move Selected Column( after( "name" ) );
	// to
	dtFinal &amp;lt;&amp;lt; Move Selected Column( after( :name("N(Pass)" ) ) );
	dtFinal &amp;lt;&amp;lt; clear Column selection;

// Works Correctly
	
	// This form will not work, once you save the table and reopen it
	// because the formula requires a variable named die
	//die = 334;
	
	//numdie = New Column( "NumDie" );
	//numdie &amp;lt;&amp;lt; Set Formula( die );
	dtFinal &amp;lt;&amp;lt; New Column( "NumDie", set each value(334) ); 

// Says Scriptable[] but won't go to column and obviously doesn't move
	
	dtFinal&amp;lt;&amp;lt; go to( :NumDie );
	//Wait ( 1 );
	// There is no pointer called dtFinalYield
	// changed from
	// dtFinalYield&amp;lt;&amp;lt; move selected Columns( after( "part_number" ) );
	// dtFinalYield&amp;lt;&amp;lt; clear Column selection;
	// to
	dtFinal &amp;lt;&amp;lt; move selected Columns( after( "part_number" ) );
	dtFinal &amp;lt;&amp;lt; clear Column selection;
	
	&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:58:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108614#M39502</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-02-01T13:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Manipulating Tabulated Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108616#M39504</link>
      <description>The dtFinalYield is supposed to just be dtFinal.. When i attach scripts to this forum, i have to rename everything and I missed that one.. My apologies.&lt;BR /&gt;&lt;BR /&gt;I see the issues with the '=' sign instead of the '&amp;lt;&amp;lt;' I am not sure why i was doing that..</description>
      <pubDate>Fri, 01 Feb 2019 15:12:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108616#M39504</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2019-02-01T15:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Manipulating Tabulated Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108617#M39505</link>
      <description>Just getting the syntax is killing me.. Thank you for pointing that out.. Since i am still learning how to code in JSL, i most definately have both these formus, the scripting guide and the scripting index all open to search how to do things.. I missed that = to &amp;lt;&amp;lt; ..</description>
      <pubDate>Fri, 01 Feb 2019 15:18:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trouble-Manipulating-Tabulated-Tables/m-p/108617#M39505</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2019-02-01T15:18:19Z</dc:date>
    </item>
  </channel>
</rss>

