<?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: Prompt User to Select a Column(s) by popup window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42698#M24769</link>
    <description>&lt;P&gt;Thx Jim, I found the addin,&amp;nbsp;how do I look at the script code?&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 23:49:04 GMT</pubDate>
    <dc:creator>SamH</dc:creator>
    <dc:date>2017-07-31T23:49:04Z</dc:date>
    <item>
      <title>Select Where a Column Contains a Value</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40119#M23489</link>
      <description>&lt;P&gt;I have a script that is supposed to:&lt;/P&gt;
&lt;P&gt;1) Allow the user to pick multiple files to open&lt;/P&gt;
&lt;P&gt;2) Close any files that have no data (ie only one column with one value that says NA)&lt;/P&gt;
&lt;P&gt;3) Close any files that do not contain 1146 in column 7 (the column is called Sealer # in some filesand is unnamed in others, further it is a character column in some files and a numeric column in others)&lt;/P&gt;
&lt;P&gt;I have gotten the first two things working, but am struggling with the third. Here is the script that I have so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Files = Pick File(
	"Select JMP File",
	"$DESKTOP\Burst Data for Spencer",
	{"Excel|csv;xlsx;xls", "JMP Files|jmp;jsl;jrn", "All Files|*"},
	1,
	0,
	"",
	"multiple"
);
For( i = 1, i &amp;lt;= N Items( Files ), i++,
	DT = Try( Open( Files[i] ) );
	DT &amp;lt;&amp;lt; Set Name( Files[i] );
　
	If( N Cols( DT ) == 1,
		Close( DT, No Save ),
		Column( 7 ) &amp;lt;&amp;lt; Data Type( Character );
		check = DT &amp;lt;&amp;lt; Get Rows Where( Contains( Column( 7 ), "1146" ) );
		If( N Rows( check ) == 0,
			Close( DT, No Save )
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To the best I can tell the problem is the the line &lt;FONT face="Consolas" size="2"&gt;check = DT&amp;lt;&amp;lt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#000080"&gt;Get Rows Where&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000dd"&gt;Contains&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000dd"&gt;column&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#008080"&gt;7&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;), &lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#800080"&gt;"1146"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;));&lt;/FONT&gt;, but I can't figure out how to fix it.&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 23:09:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40119#M23489</guid>
      <dc:creator>rfeick</dc:creator>
      <dc:date>2018-12-12T23:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select Where a Column Contains a Value</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40124#M23491</link>
      <description>&lt;P&gt;This code will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
Eval( Parse( "check = DT &amp;lt;&amp;lt; Get Rows Where( Contains( " || ":" || 
	Char( Column( 3 ) &amp;lt;&amp;lt; get name ) || " , \!"1146\!" ) ) );" ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2017 16:27:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40124#M23491</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-08T16:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select Where a Column Contains a Value</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40139#M23498</link>
      <description>&lt;P&gt;I tried putting the section into the script, but it doesn't seem to be wokring. It still closes thet blank files, but close the files that have data and contain 1146. I tried changing the If(NRows(check)==0 to !=0, but it didn't seem to make a difference. And this error is showing up in the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unexpected ")". Perhaps there is a missing ";" or ",".&lt;/P&gt;
&lt;P&gt;Line 1 Column 64: ...( :Sealer # , "1146" ) ) ►);...&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;The remaining text that was ignored was&lt;/P&gt;
&lt;P&gt;Here's the updated script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Files = Pick File(
	"Select JMP File",
	"$DESKTOP\Burst Data for Spencer",
	{"Excel|csv;xlsx;xls", "JMP Files|jmp;jsl;jrn", "All Files|*"},
	1,
	0,
	"",
	"multiple"
);
　
　
For( i = 1, i &amp;lt;= N Items( Files ), i++,
	DT = Try( Open( Files[i] ) );
	DT &amp;lt;&amp;lt; Set Name( Files[i] );
	If( N Cols( DT ) == 1,
		Close( DT, No Save ), 
&amp;nbsp;
		Column( 7 ) &amp;lt;&amp;lt; Data Type( Character );
		Names Default To Here( 1 );
		Current Data Table( DT );
		Eval(
			Parse( "check = DT &amp;lt;&amp;lt; Get Rows Where( Contains( " || ":" || Char( Column( 7 ) &amp;lt;&amp;lt; get name ) || " , \!"1146\!" ) ) );" )
		);
		If( N Rows( check ) == 0,
			Close( DT, No Save )
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 23:10:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40139#M23498</guid>
      <dc:creator>rfeick</dc:creator>
      <dc:date>2018-12-12T23:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select Where a Column Contains a Value</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40145#M23500</link>
      <description>&lt;P&gt;Here is a slightly modified version of your code, that lists our the values of the Get Rows Where statement and the value of check. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Files = Pick File(
	"Select JMP File",
	"$DESKTOP\Burst Data for Spencer",
	{"Excel|csv;xlsx;xls", "JMP Files|jmp;jsl;jrn", "All Files|*"},
	1,
	0,
	"",
	"multiple"
);
　
For( i = 1, i &amp;lt;= N Items( Files ), i++,
	DT = Try( Open( Files[i] ) );
	Wait( 0 );
	DT &amp;lt;&amp;lt; Set Name( Files[i] );
	If( N Cols( DT ) == 1,
		Close( DT, No Save ), 
 
		Column( DT, 7 ) &amp;lt;&amp;lt; Data Type( Character );
		Names Default To Here( 1 );
 //Current Data Table( DT ); 
		Eval(
			Parse(
				"check = DT &amp;lt;&amp;lt; Get Rows Where( Contains( " || ":" || Char( Column( DT, 5 ) &amp;lt;&amp;lt; get name ) || " , \!"1146\!" ) ) );"
			)
		);
		Show(
			"check = DT &amp;lt;&amp;lt; Get Rows Where( Contains( " || ":" || Char( Column( DT, 7 ) &amp;lt;&amp;lt; get name ) || " , \!"1146\!" ) ) );",
			check
		);
		If( N Rows( check ) == 0,
			Close( DT, No Save )
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You may want to run the JMP Debugger on this. &amp;nbsp;My assumption is that there is a missmatch with the column 7 or something like that. &amp;nbsp;I know the code works, since I tested it out on a sample data table that had a column with a couple of rows that had your 1146 in the column values&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 23:16:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40145#M23500</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-12-12T23:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select Where a Column Contains a Value</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40290#M23592</link>
      <description>&lt;P&gt;I tried debugging that script section, but couldn't ever get it to work. I ended up with this versiont that functioned with some slight modifications.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Items( Files ), i++, 

	DT = Try( Open( Files[i] ) );

	Wait( 0 );

	DT &amp;lt;&amp;lt; Set Name( Files[i] );

	If( N Cols( DT ) == 1, 

		Close( DT, No Save )
	, 

		Column( DT, 7 ) &amp;lt;&amp;lt; Data Type( Character );

		Names Default To Here( 1 );

		name = Char( Column( DT, 7 ) &amp;lt;&amp;lt; get name );

		Print( name );

		Eval( Parse( "check = DT &amp;lt;&amp;lt; Select Where( Contains( " || ":" || name || " , " || "char(1146)))" ) );

		If( N Rows( DT &amp;lt;&amp;lt; Get Selected Rows ) == 0, 

			Close( DT, No Save )
		, 

			DT &amp;lt;&amp;lt; Invert Row Selection;

			DT &amp;lt;&amp;lt; Delete Rows;

			DT &amp;lt;&amp;lt; Clear Select;

//oldname = char(DT&amp;lt;&amp;lt; Get Name());

			//rename = char(Word(-1, oldname, "-"));

			//DT&amp;lt;&amp;lt;Set Name(rename);

			CD = CT &amp;lt;&amp;lt; Concatenate( DT, Append to first table, Create source column );

			Close( DT, No Save );

		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 23:13:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/40290#M23592</guid>
      <dc:creator>rfeick</dc:creator>
      <dc:date>2018-12-12T23:13:27Z</dc:date>
    </item>
    <item>
      <title>Prompt User to Select a Column(s) by popup window</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42694#M24765</link>
      <description>&lt;P&gt;Hi Guys, I am trying to have script prompt the user to select 2 columns x-coordinate and another y-coordinate from a table.&lt;/P&gt;
&lt;P&gt;Graph below is what I like the script to do. User picks the x,y coordinate then I use it to pass it on as a variable. I need it in the script later to do die mapping. any ideas? thanks graph below is photo shop to show end result.&lt;/P&gt;
&lt;P&gt;thanks.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/7021i976699778F8210B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 23:14:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42694#M24765</guid>
      <dc:creator>SamH</dc:creator>
      <dc:date>2018-12-12T23:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt User to Select a Column(s) by popup window</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42695#M24766</link>
      <description>&lt;P&gt;I suggest that you look into the JMP Addin on "Runs Test" which contains an example of doing what you are asking to do with your example. &amp;nbsp;It provides a dialog box that allows for the selection of column and placing them into selection boxes. &amp;nbsp;It also has filtering capability and Recall capability in it.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Runs Test (Wald-Wolfowitz Test) and JSL Implementation of JMP Platform Dialog Box&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 22:16:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42695#M24766</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-07-31T22:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt User to Select a Column(s) by popup window</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42696#M24767</link>
      <description>&lt;P&gt;Hi Jim, can you please be more specific? is that a built in script?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 23:36:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42696#M24767</guid>
      <dc:creator>SamH</dc:creator>
      <dc:date>2017-07-31T23:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt User to Select a Column(s) by popup window</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42698#M24769</link>
      <description>&lt;P&gt;Thx Jim, I found the addin,&amp;nbsp;how do I look at the script code?&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 23:49:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42698#M24769</guid>
      <dc:creator>SamH</dc:creator>
      <dc:date>2017-07-31T23:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Prompt User to Select a Column(s) by popup window</title>
      <link>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42699#M24770</link>
      <description>&lt;P&gt;Download the Addin to your downloads folder&lt;/P&gt;
&lt;P&gt;Then go to JMP and&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;File==&amp;gt;Open&lt;/P&gt;
&lt;P&gt;Go to the download folder&lt;/P&gt;
&lt;P&gt;Single click on the Runs Test.jmpaddin file&lt;/P&gt;
&lt;P&gt;Then go to the down arrow for the Open button, and select&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Open using the Addin Builder&lt;/P&gt;
&lt;P&gt;In the Addin Builder, select the Menu Items tab&lt;/P&gt;
&lt;P&gt;Then click on the Runs Test entry&lt;/P&gt;
&lt;P&gt;In the "Run this JSL" area, you will see the embedded script&lt;/P&gt;
&lt;P&gt;Cut and paste it to a Script Window&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 02:38:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-Where-a-Column-Contains-a-Value/m-p/42699#M24770</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-08-01T02:38:33Z</dc:date>
    </item>
  </channel>
</rss>

