<?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: select current data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250923#M49274</link>
    <description>&lt;P&gt;Yeah, that works. I was just hoping for a method that would prompt users to select a table since we often have many open at once. And relying on awareness of the various users for their current data table hasn't worked well in the past. was just hoping to have a method of prompting users to specify. But this will have to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 20:30:36 GMT</pubDate>
    <dc:creator>cassadeus</dc:creator>
    <dc:date>2020-03-05T20:30:36Z</dc:date>
    <item>
      <title>select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/20401#M18567</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am using a small jmp_addin to add spec limits info to selected columns.&amp;nbsp; Anyways, the problem I run into is that whenever I run it, it always grabs the latest data table that was open, even if I am running the addin from a different window...is there a way to highlight to the jmp_addin that I am trying to run script from the selected data table?&amp;nbsp; I thought currentdatatable would do this, but again it seems it always works on latest data table open, and sometimes I need to change/add specs to an already open table...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&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;dt = currentdatatable();
table=list("Spec1", "Spec2", "Spec3" );
r = Column Dialog(
Spec = Col List( "Columns to add Spec" ),
v list ("Select Product Spec Table", rb = Combo Box( table()))
);
 
dtedc = open("C:\myData\ADDIN\Spec Limit\"||table[r["rb"]]||".jmp",invisible);
 
for ( i=1, i&amp;lt;=N Items(r["Spec"]),i++,
for (j=1, j&amp;lt;= nrows(dtedc), j++,
if(as Name(r["Spec"]) == as Name(dtedc:Parameter),
 
  Eval(
  Substitute(
  Expr(
Column(dt, r["Spec"]) &amp;lt;&amp;lt; set property("spec limits",
  {LSL( l), Target( t ), USL( u ), Show Limits(1)}
  )
  ),
  Expr( l ), dtedc:LSL,
  Expr( t ), dtedc:Target,
  Expr( u ), dtedc:USL
  )
 
);
 
  );
);
);
 
close(dtedc, nosave);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 20:30:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/20401#M18567</guid>
      <dc:creator>jojo</dc:creator>
      <dc:date>2017-12-13T20:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/51802#M29382</link>
      <description>&lt;P&gt;I just came across this old question that, unfortunately, never got a response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/13-2/Set_the_Current_Data_Table.shtml" target="_self"&gt;Current Data Table()&lt;/A&gt; should return a reference to the active data table window. I'm not sure why it isn't in your case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, a more reliable method is to prompt the user to choose from the open data tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a small function that prompts with a list of data tables and returns the choice made by the user.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;choose_data_table=function({},
list = {};

For( i = 1, i &amp;lt;= N Table(), i++,
	list[i] = Data Table( i ) &amp;lt;&amp;lt; get name
);

win = New Window( "Select a data table", &amp;lt;&amp;lt; Modal,
	hb = H List Box(
		Panel Box( "Choose a data table",
			dt = List Box(
				list,
				max selected( 1 ),
				chosen = Data Table( (dt &amp;lt;&amp;lt; get selected)[1] );
				show (chosen);
			)
		),

	)
);
chosen);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use it like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=choose_data_table();&amp;nbsp;
show(dt);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 22:56:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/51802#M29382</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2018-02-21T22:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250621#M49198</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to employ this in a fairly simple module that formats data markers. It worked great when I initially set the script, but since has been inconsistently working. Are there any ideas why it would be so? The Column titles and values are reliable.&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;dt=choose_data_table();
show(dt);
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Overload" );
dt &amp;lt;&amp;lt; Colors( 22 );
dt &amp;lt;&amp;lt; Markers( 11 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Curve Error" );
dt &amp;lt;&amp;lt; Colors( 27 );
dt &amp;lt;&amp;lt; Markers( 2 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Detected" );
dt &amp;lt;&amp;lt; Colors( 4 );
dt &amp;lt;&amp;lt; Markers( 12 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Position Misalign" );
dt &amp;lt;&amp;lt; Colors( 3 );
dt &amp;lt;&amp;lt; Markers( 2 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Negative (w/ Misalign)" );
dt &amp;lt;&amp;lt; Colors( 1 );
dt &amp;lt;&amp;lt; Markers( 2 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Negative" );
dt &amp;lt;&amp;lt; Colors( 1 );
dt &amp;lt;&amp;lt; Markers( 0 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Disconnect" );
dt &amp;lt;&amp;lt; Colors( 0 );
dt &amp;lt;&amp;lt; Markers( 9 );
dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "High CP Current" );
dt &amp;lt;&amp;lt; Colors( 56 );
dt &amp;lt;&amp;lt; Markers( 24 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 13:49:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250621#M49198</guid>
      <dc:creator>cassadeus</dc:creator>
      <dc:date>2020-03-05T13:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250794#M49234</link>
      <description>&lt;P&gt;I think we're going to need more information about what "inconsistently working" means. Can you provide more detail?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 13:52:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250794#M49234</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-03-05T13:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250901#M49266</link>
      <description>&lt;P&gt;Yeah, I'll try. Sorry I am pretty new and not formally trained in any scripting, which is probably obvious. I added the data table selector into this script rather than use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = Current Data Table();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and ensuring that the current data table was the table I wanted to reformat. When I first implemented the Choose data table function it worked like a charm, and created a prompt from which to select the desired table. I sent it too a colleague to use, and it didn't work for him, despite verifying that the script was unchanged. I opened the saved script and it didn't work for me either. So I alternated between previous methods of formatting, and back to the choose data table method and it worked again. Later it no longer did.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't really have a good technical explanation for the inconsistency, or what changed between successful and unsuccessful attempts. As far as I can tell nothing specifically did. I hack these things together, so there are definitely some fundamental principles that I am lacking, such as clearing or designating preferences or symbols. Maybe the issue is outside the scope of a short forum post?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks either way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 18:53:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250901#M49266</guid>
      <dc:creator>cassadeus</dc:creator>
      <dc:date>2020-03-05T18:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250903#M49268</link>
      <description>&lt;P&gt;what errors are you getting in the log?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 19:15:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250903#M49268</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-05T19:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250914#M49270</link>
      <description>&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you for asking. I hadn't considered checking the log. It says:&lt;BR /&gt;&lt;BR /&gt;Name Unresolved: choose_data_table in access or evaluation of 'choose_data_table' , choose_data_table() /*###*/&lt;BR /&gt;&lt;BR /&gt;In the following script, error marked by /*###*/&lt;BR /&gt;dt = choose_data_table() /*###*/;&lt;BR /&gt;Show( dt );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Overload" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 22 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 11 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Curve Error" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 27 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 2 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Detected" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 4 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 12 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Position Misalign" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 3 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 2 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Negative (w/ Misalign)" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 1 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 2 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Negative" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 1 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 0 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "Disconnect" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 0 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 9 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Pad Summary == "High CP Current" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Colors( 56 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 24 );&lt;BR /&gt;dt &amp;lt;&amp;lt; Select Where( :Run Status == "Invalid" );&lt;BR /&gt;dt &amp;lt;&amp;lt; Markers( 4 );</description>
      <pubDate>Thu, 05 Mar 2020 20:05:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250914#M49270</guid>
      <dc:creator>cassadeus</dc:creator>
      <dc:date>2020-03-05T20:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250915#M49271</link>
      <description>&lt;P&gt;When I saw the line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = choose_data_table();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I assumed that you had a function somewhere earlier in your code that let you pick the data table to run on.&amp;nbsp; But if you do not, then I suggest you change the line to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and try running your code&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 20:10:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250915#M49271</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-05T20:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250923#M49274</link>
      <description>&lt;P&gt;Yeah, that works. I was just hoping for a method that would prompt users to select a table since we often have many open at once. And relying on awareness of the various users for their current data table hasn't worked well in the past. was just hoping to have a method of prompting users to specify. But this will have to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 20:30:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250923#M49274</guid>
      <dc:creator>cassadeus</dc:creator>
      <dc:date>2020-03-05T20:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: select current data table</title>
      <link>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250937#M49276</link>
      <description>&lt;P&gt;If you put the choose_data_table function definition at the top of your code it will work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 20:41:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/select-current-data-table/m-p/250937#M49276</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-03-05T20:41:21Z</dc:date>
    </item>
  </channel>
</rss>

