<?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: Script multiple columns grouped in distribution plot in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/166118#M40097</link>
    <description>exactly what I needed... thanks tx!!</description>
    <pubDate>Sun, 24 Feb 2019 16:11:25 GMT</pubDate>
    <dc:creator>RonSwanson</dc:creator>
    <dc:date>2019-02-24T16:11:25Z</dc:date>
    <item>
      <title>Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/162557#M40092</link>
      <description>&lt;P&gt;I'm trying to script a way to plot multiple parameter columns that are grouped together in a distribution (as shown in figure). My problem is the code needs a separate "Continuous Distribution" row for each parameter column. My data pulls have different column names and number of columns to plot depending on what I'm doing. I can't figure out how to take that column name list and have it plotted in a group as show below, rather than looping through and creating individual plots for each parameter.&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;Distribution(
	Continuous Distribution( Column( :Parameter1 ) ),
	Continuous Distribution( Column( :Parameter2 ) ),
	Continuous Distribution( Column( :Parameter3 ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 961px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15796i79FB82242E3EC16F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 17:25:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/162557#M40092</guid>
      <dc:creator>RonSwanson</dc:creator>
      <dc:date>2019-02-23T17:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/162798#M40093</link>
      <description>&lt;P&gt;Here is one way to generate the code required to produce what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

// Get the all of the numeric, continuous column names
colNames = dt &amp;lt;&amp;lt; get column names( string, continuous );

// Build a character string that represents the commands that need to be run
theExpr = "dis = dt &amp;lt;&amp;lt; Distribution(
	Continuous Distribution( column( column(dt, colNames[1])))";

// Loop across the remaining columns in the colNames list and generate the continuous distribution
// commands
For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	theExpr = theExpr || ", Continuous Distribution( column( column(dt, colNames[" || Char( i ) || "])))"
);

// place the closing ")" to complete the command string
theExpr = theExpr || ");";

// Execute the code generated and placed into the character string variable
Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Feb 2019 19:31:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/162798#M40093</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-02-23T19:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/166118#M40097</link>
      <description>exactly what I needed... thanks tx!!</description>
      <pubDate>Sun, 24 Feb 2019 16:11:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/166118#M40097</guid>
      <dc:creator>RonSwanson</dc:creator>
      <dc:date>2019-02-24T16:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/167310#M40107</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/13311"&gt;@RonSwanson&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;'s script provides you much more control and a solution. This as an alternate option, since I have often been asked how to easily script an unknown number of distributions.&amp;nbsp; This script also includes commands to "wrap" distributions and how to send messages to all distributions by sending a message to the object (Capability Analysis message) and to send a message to the reveal icon.&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 = Open("$Sample_Data/Semiconductor Capability.jmp");

cnames = dt &amp;lt;&amp;lt; get column names("Continuous", "string");

//Here I will just use 10

cnames = cnames[1::10];
 dist = dt &amp;lt;&amp;lt; Distribution(Columns(evalList(cnames)));
 //if you want to limit the number per row
 dist &amp;lt;&amp;lt; arrange in rows(3);  //change 3 to 5 or whatever you want

 dist &amp;lt;&amp;lt; Capability Analysis(0);  //turn off the distribution
 
report(dist)[OutlineBox(2)] &amp;lt;&amp;lt; Open all like this(1);    //reveal all distributions
 
 report(dist)[OutlineBox(2)] &amp;lt;&amp;lt; Close all like this(1);  //do not reveal 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 367px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15813i35E0E8EB07C38DB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 978px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15814i99794406A190BAF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 05:30:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/167310#M40107</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-02-25T05:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/219529#M43939</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;i have used this script and it worked. What i am trying to do is automating my report but my data table is composed of 300+ columns, number of columns vary per week. I have column names that starts with ex. "Fail1", "Fail2",,, "Total1","Total2",,, "Yield1", "Yield2",,, "Loss1", "Loss2",,.&amp;nbsp;How to filter to show continuous distributions for example "Loss1", "Loss2",, only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 08:27:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/219529#M43939</guid>
      <dc:creator>ducksb0y</dc:creator>
      <dc:date>2019-08-01T08:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/219537#M43941</link>
      <description>&lt;P&gt;All you need to do is to modify the list of column names, to meet the requirements.&amp;nbsp; There are many ways to do this, below is one example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// Get the all of the numeric, continuous column names
colNames = dt &amp;lt;&amp;lt; get column names( string, continuous );

// Work backwards through the list of columns eliminating those that
// do not meet the pattern one is interested in
For( i = N Items( colNames ), i &amp;gt;= 1, i--,
	If( left( colNames[i], 3 ) != "NPN" , colNames = remove( colNames, i, 1 ) );
);

// Build a character string that represents the commands that need to be run
theExpr = "dis = dt &amp;lt;&amp;lt; Distribution(
	Continuous Distribution( column( column(dt, colNames[1])))";

// Loop across the remaining columns in the colNames list and generate the continuous distribution
// commands
For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	theExpr = theExpr || ", Continuous Distribution( column( column(dt, colNames[" || Char( i ) || "])))"
);

// place the closing ")" to complete the command string
theExpr = theExpr || ");";

// Execute the code generated and placed into the character string variable
Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2019 12:33:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/219537#M43941</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-01T12:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277077#M53856</link>
      <description>&lt;P&gt;If I wanted to put that into an application, with a local data filter, could I put the Allocate statement inside the Eval(Parse) ?&lt;/P&gt;&lt;P&gt;So..&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;theExpr = "dis = Allocate(
				Border1 = Border Box();
				DataFilterContext1 = Data Filter Context Box();
				List1 = H List Box();
				DataFilter1 = Dt &amp;lt;&amp;lt; Data Filter( Local );
				Report1 = Platform(
					Dt,
					Distribution(
	Continuous Distribution( column( column(Dt, colNames[1])))";

	For( i = 2, i &amp;lt;= N Items( colNames ), i++,
	theExpr = theExpr || ", Continuous Distribution( column( column(Dt, colNames[" || Char( i ) || "])))"
);

theExpr = theExpr || "	)
	);
	)";
	
	show(theexpr);
Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 15:21:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277077#M53856</guid>
      <dc:creator>spudton</dc:creator>
      <dc:date>2020-07-07T15:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277090#M53859</link>
      <description>&lt;P&gt;The short answer is No.&amp;nbsp; At a minimum you need to create a character string that includes all of the JMP App code.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 16:33:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277090#M53859</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-07T16:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277279#M53876</link>
      <description>&lt;P&gt;OK Thanks.&lt;/P&gt;&lt;P&gt;what would be your strategy for doing this? Would you avoid using application builder with allocate etc, and just use a script to position everything?&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;P&gt;Wayne.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 07:10:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277279#M53876</guid>
      <dc:creator>spudton</dc:creator>
      <dc:date>2020-07-08T07:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277293#M53877</link>
      <description>&lt;P&gt;I would just avoid the overhead of placing it into an application.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 08:16:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277293#M53877</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-08T08:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277299#M53880</link>
      <description>&lt;P&gt;Noted, I think that my assumption that everything starts with an application has caused me much pain.&lt;/P&gt;&lt;P&gt;One more question, hopefully, If I want to set the properties of &lt;U&gt;all&lt;/U&gt; the distributions in a report, as I've done with this single variable here, &lt;CODE class=" language-jsl"&gt;"T05066DD ET_DELTA Ratio" &lt;/CODE&gt;is there a simple command to do it, or do i need to build a for loop and run the "sendtoreport" for each variable in my list?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ET_DELTA_List = {};&lt;BR /&gt;dist = dt &amp;lt;&amp;lt; Distribution(Columns(evalList(ET_DELTA_List)));

 dist &amp;lt;&amp;lt; arrange in rows(5);  
 dist &amp;lt;&amp;lt; Quantiles(0);  
 dist &amp;lt;&amp;lt; Summary Statistics(0);  
 
report(dist)[OutlineBox(2)] &amp;lt;&amp;lt; Open all like this(1);    
 //show properties(dist)
 
 dist &amp;lt;&amp;lt;	SendToReport(
		Dispatch(
			{"T05066DD ET_DELTA Ratio"},//this is one of many distributions. i would like to set the following properties to all the distributions in the report
			"1",
			ScaleBox,
			{Min( -5 ), Max( 5 ), Inc( 5000 ), Minor Ticks( 1 ),
			Add Ref Line( 2, "Solid", "Black", "", 1 ),
			Add Ref Line( -2, "Solid", "Black", "", 1 )}
		)
	)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 09:07:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277299#M53880</guid>
      <dc:creator>spudton</dc:creator>
      <dc:date>2020-07-08T09:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script multiple columns grouped in distribution plot</title>
      <link>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277309#M53883</link>
      <description>&lt;P&gt;Here is how I would handle the issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");

colList = dt &amp;lt;&amp;lt; get column names(continuous,string);
// For this illustration I want to use just the NPNn columns
for(i=nitems(colList), i&amp;gt;=1,i--,
	If(substr(colList[i],1,3)!="NPN", remove from(colList,i,1))
);

// build the JSL string
theExpr = 
"Dis = Distribution(
		Continuous Distribution( Column( :" || colList[1] || " ), 
		Process Capability( Use Column Property Specs ) )";
For( i = 2, i &amp;lt;= N Items( colList ), i++,
	theExpr = theExpr || "," || "Continuous Distribution( Column( :" || colList[i] ||
	" ), Process Capability( Use Column Property Specs ) )"
);
theExpr=theExpr||");";

// run the built JSL string
eval(parse(theexpr));

// Standardize the settings
disr = Dis &amp;lt;&amp;lt; report;

disr[colList[1]]["Quantiles"]&amp;lt;&amp;lt;close all like this;
disr[colList[1]]["Summary Statistics"]&amp;lt;&amp;lt;close all like this;
disr[colList[1]]["Process Capability"]&amp;lt;&amp;lt;close all like this;

For(i=1,i&amp;lt;=nitems(colList),i++,
	disr[colList[i]][AxisBox(1)] &amp;lt;&amp;lt; min(87) &amp;lt;&amp;lt; max(127) &amp;lt;&amp;lt; inc(5)
	&amp;lt;&amp;lt; Add Ref Line( 121, "Solid","Black","",1)
	&amp;lt;&amp;lt; Add Ref Line( 100, "Solid", "Black", "", 1 )
	&amp;lt;&amp;lt; Add Ref Line( 90, "Solid", "Black", "", 1 )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jul 2020 10:16:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-multiple-columns-grouped-in-distribution-plot/m-p/277309#M53883</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-08T10:16:28Z</dc:date>
    </item>
  </channel>
</rss>

