<?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: Getting categories from another script. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846425#M102108</link>
    <description>&lt;P&gt;If I'm understanding your post correctly, it looks like your invoked script is creating "categories" in your data table by creating multiple column groups. Those column groups will have names like "Reject", "Engineering", "Etc...".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After you have run your invoked script, you can get the list of column groups from your data table by using the "get column groups names" function. An example is shown below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt = current data table();

categoryList = dt &amp;lt;&amp;lt; get column groups names;

show(categoryList);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To take it one step farther, after you get your list of categories, you can loop through the list and use the "get column group" function to get the list of all the test measurement columns that are within each column group. Here's an example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt = current data table();

categoryList = dt &amp;lt;&amp;lt; get column groups names;

for( k = 1, k &amp;lt;= n items( categoryList ), k++,
    
    show( categoryList[k] );

    colList = dt &amp;lt;&amp;lt; get column group( categoryList[k] );

    print( colList );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Mar 2025 08:25:40 GMT</pubDate>
    <dc:creator>ngambles</dc:creator>
    <dc:date>2025-03-06T08:25:40Z</dc:date>
    <item>
      <title>Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/835484#M101303</link>
      <description>&lt;P&gt;This was very helpful to get me where I am&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Invoking-a-script-from-another-script/td-p/675349" target="_blank"&gt;Solved: Invoking a script from another script - JMP User Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I can invoke a script from the main script.&amp;nbsp; The script I invoke applies categories to the target data set and I'd like to be able to form a list of categories in the script I invoke that I can apply to the main script.&amp;nbsp; Below is a snapshot of the invoked script, several parameters and categories can be iterated and I'd like a list of categories available in the main table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Try((Column( "Parameter") &amp;lt;&amp;lt; Set Selected(1););
dt &amp;lt;&amp;lt; group columns( "ENG" );
dt &amp;lt;&amp;lt; deselect column group( "ENG" );):&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 19:17:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/835484#M101303</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-02-04T19:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/835972#M101311</link>
      <description>&lt;P&gt;Are you just running Include, to run the other script file? Does it have expressions/functions?&amp;nbsp;Which categories and how you wish to have them available?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 05:11:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/835972#M101311</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-02-05T05:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/843185#M101683</link>
      <description>&lt;P&gt;I do use Include to run the other script, which applies categories to the table columns.&amp;nbsp; An alternative way to get what I need would be to list the categories in the finished table.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 14:51:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/843185#M101683</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-02-20T14:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/843186#M101684</link>
      <description>&lt;P&gt;Where are the categories? What do you mean by categories? How should they be added to your main table?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 14:59:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/843186#M101684</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-02-20T14:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846353#M102094</link>
      <description>&lt;P&gt;Each measurement that has specs falls within a category defined by the test organisation.&amp;nbsp; Some categories are Reject, meaning they are crucial to pass, others are Engineering, meaning they are of interest but not critical to pass.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 21:44:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846353#M102094</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-03-05T21:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846425#M102108</link>
      <description>&lt;P&gt;If I'm understanding your post correctly, it looks like your invoked script is creating "categories" in your data table by creating multiple column groups. Those column groups will have names like "Reject", "Engineering", "Etc...".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After you have run your invoked script, you can get the list of column groups from your data table by using the "get column groups names" function. An example is shown below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt = current data table();

categoryList = dt &amp;lt;&amp;lt; get column groups names;

show(categoryList);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To take it one step farther, after you get your list of categories, you can loop through the list and use the "get column group" function to get the list of all the test measurement columns that are within each column group. Here's an example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt = current data table();

categoryList = dt &amp;lt;&amp;lt; get column groups names;

for( k = 1, k &amp;lt;= n items( categoryList ), k++,
    
    show( categoryList[k] );

    colList = dt &amp;lt;&amp;lt; get column group( categoryList[k] );

    print( colList );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Mar 2025 08:25:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846425#M102108</guid>
      <dc:creator>ngambles</dc:creator>
      <dc:date>2025-03-06T08:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getting categories from another script.</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846798#M102143</link>
      <description>&lt;P&gt;Nice!&amp;nbsp; I use something like this to feed information from the subscript to the main script.&amp;nbsp; I am writing the subscript with another script.&amp;nbsp; Probably not standard but I write the script in the columns of the data table containing the spec limits, copy that as text and paste into a script window.&amp;nbsp; Seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	Spud = (":" || cnmes2[l]);
	Spuds = Parse( Eval Insert( Spud ) );
	Tabname = Char( dt );
	
//This section of the script devises a name for each script generated.
 	
	Tabname = Char( dt );
	Show( Tabname );
	name = Char( Column Name( l ) );
	names = Char( "Spec Limits, Group and Notes Script " ) || Char( Tabname ) || Char( name );
	Show( names );
	Show( Spuds );
	Ainim = Regex( names, "\!"", "", GLOBALREPLACE );
	Show( Ainim );
	link = Char(cats);
	
//Scripts are generated in 2 table columns "Address Data Table" and "Group with Notes and Spec Limits" before being pasted into a Script Window.

	New Column( "Address Data Table",
		Character,
		"Nominal",
		Formula(
			If( Row() == 1,
				"dt=Current Data Table();
				Process_Script = " || "\!"" || Ainim || "\!"" || "; Show( Process_Script );
	cats = " || link ||  "; Show( Process_Script );"
			)
		)
	);
	
	Column( "Address Data Table" ) &amp;lt;&amp;lt; Delete Formula;For( l = Num(Start), l &amp;lt;= N Items( cnmes2 ), l++, 

summarize(cats=by(cnmes2 [l] ));
delcats = {"", "-"};

For( i = 1, i &amp;lt;= N Items( delcats ), i++,
	Remove From( cats, As List( Loc( cats, delcats[i] ) ) )
);

show(cats);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Mar 2025 19:31:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-categories-from-another-script/m-p/846798#M102143</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-03-07T19:31:49Z</dc:date>
    </item>
  </channel>
</rss>

