<?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: Deleting Specific Column after closing Graph Builder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406451#M65658</link>
    <description>&lt;P&gt;You can add &amp;lt;&amp;lt;On Close() to the graph builder window which will delete the column. Example with Big Class, will delete sex column when graph builder is closed&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(535, 451),
	Show Control Panel(0),
	Variables(X(:age), Y(:weight), Overlay(:sex)),
	Elements(Points(X, Y, Legend(13)))
);

gb &amp;lt;&amp;lt; On Close(dt &amp;lt;&amp;lt; Delete Column("sex"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 18:44:01 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-08-02T18:44:01Z</dc:date>
    <item>
      <title>Deleting Specific Column after closing Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406426#M65655</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have code that populates a data table with a new column containing a formula. This column is then used as overlay in graph builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there is a way to delete this column (with the formula) once the user exits out of the graph builder. Thank you for the help!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
dt = Current Data Table();

// first program
program1 = function({},
	show("formula 1");
// JSL code
dt &amp;lt;&amp;lt; New Column("Bin", Character, formula(If( /*formula code*/)));

);

// second program
program2 = function({},
	show("formula 2");
// JSL code
dt &amp;lt;&amp;lt; New Column("Bin", Character, formula(If( /*formula code*/)));

);

// third program
program3 = function({},
	show("formula 3");
// JSL code
dt &amp;lt;&amp;lt; New Column("Bin", Character, formula(If( /*formula code*/)));

);

// fourth program
program4 = function({},
	show("formula 4");
// JSL code

dt &amp;lt;&amp;lt; New Column("Bin", Character, formula(If( /*formula code*/)));
	

);


//window that allows users to press button to generate graph with state ID labels based on protocol type
nw = new window("Program Options", &amp;lt;&amp;lt; modal,


	panel box("Click the button to run the desired program",
		lineup box(ncol(1),
			SpacerBox(),
			b1 = button box("program 1",
				program1();
				okBtn &amp;lt;&amp;lt; Click();
			),
			b2 = button box("program 2",
				program2();
				okBtn &amp;lt;&amp;lt; Click();
			),
			b3 = button box("program 3",
				program3();
				okBtn &amp;lt;&amp;lt; Click();
			),
			b4 = button box("program 4",
				program4();
				okBtn &amp;lt;&amp;lt; Click();
			),
		),
	),
	h list box(SpacerBox(),okbtn = Button Box("Cancel"), SpacerBox())
);


//make graph
gb = dt &amp;lt;&amp;lt; Graph Builder (
		
		//time, volume, bin are column names
		Variables( X( :Time ), Y( :Volume ), Overlay( :Bin )),
		Elements
		( 
			Points
			(
				X, Y, Legend( 9 )
			) 
		),
		Categorical Color Theme("JMP Vibrant");
	
);

reportWindow = gb &amp;lt;&amp;lt; Report;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:53:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406426#M65655</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2023-06-09T19:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Specific Column after closing Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406446#M65657</link>
      <description>&lt;P&gt;You need to use the On Close() function&lt;/P&gt;
&lt;P&gt;Here is an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$sample_data/big class.jmp");

dt&amp;lt;&amp;lt;new column("x", formula(:height/:weight));

gb = Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :x ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

gb &amp;lt;&amp;lt; on close(dt&amp;lt;&amp;lt;delete columns("x"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Aug 2021 18:42:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406446#M65657</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-08-02T18:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Specific Column after closing Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406451#M65658</link>
      <description>&lt;P&gt;You can add &amp;lt;&amp;lt;On Close() to the graph builder window which will delete the column. Example with Big Class, will delete sex column when graph builder is closed&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(535, 451),
	Show Control Panel(0),
	Variables(X(:age), Y(:weight), Overlay(:sex)),
	Elements(Points(X, Y, Legend(13)))
);

gb &amp;lt;&amp;lt; On Close(dt &amp;lt;&amp;lt; Delete Column("sex"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 18:44:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406451#M65658</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-08-02T18:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Specific Column after closing Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406461#M65660</link>
      <description>&lt;P&gt;Thank you! Exactly what I needed!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 18:49:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406461#M65660</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-08-02T18:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting Specific Column after closing Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406464#M65661</link>
      <description>&lt;P&gt;Thanks! This is perfect!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 18:49:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Deleting-Specific-Column-after-closing-Graph-Builder/m-p/406464#M65661</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-08-02T18:49:47Z</dc:date>
    </item>
  </channel>
</rss>

