Script multiple columns grouped in distribution plotI'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.
Distribution(
Continuous Distribution( Column( :Parameter1 ) ),
Continuous Distribution( Column( :Parameter2 ) ),
Continuous Distribution( Column( :Parameter3 ) )
);

Re: Script multiple columns grouped in distribution plotHere is how I would handle the issue
names default to here(1);
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");
colList = dt << get column names(continuous,string);
// For this illustration I want to use just the NPNn columns
for(i=nitems(colList), i>=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 <= 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 << report;
disr[colList[1]]["Quantiles"]<<CLOSE all="" like="" this=""></CLOSE>Re: Script multiple columns grouped in distribution plotNoted, I think that my assumption that everything starts with an application has caused me much pain.
One more question, hopefully, If I want to set the properties of all the distributions in a report, as I've done with this single variable here, "T05066DD ET_DELTA Ratio" 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?
ET_DELTA_List = {};<BR />dist = dt << Distribution(Columns(evalList(ET_DELTA_List)));
dist << arrange in rows(5);
dist << Quantiles(0);
dist << Summary Statistics(0);
report(dist)[OutlineBox(2)] << Open all like this(1);
//show properties(dist)
dist << 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 )}
)
)</CODE></P><P> </P></LINGO-BODY><LINGO-SUB id="lingo-sub-277293" slang="en-US" mode="NONE">Re: Script multiple columns grouped in distribution plot</LINGO-SUB><LINGO-BODY id="lingo-body-277293" slang="en-US" mode="NONE"><P>I would just avoid the overhead of placing it into an application.</P></LINGO-BODY><LINGO-SUB id="lingo-sub-277279" slang="en-US" mode="NONE">Re: Script multiple columns grouped in distribution plot</LINGO-SUB><LINGO-BODY id="lingo-body-277279" slang="en-US" mode="NONE"><P>OK Thanks.</P><P>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?</P><P>thanks again</P><P>Wayne.</P></LINGO-BODY><LINGO-SUB id="lingo-sub-277090" slang="en-US" mode="NONE">Re: Script multiple columns grouped in distribution plot</LINGO-SUB><LINGO-BODY id="lingo-body-277090" slang="en-US" mode="NONE"><P>The short answer is No. At a minimum you need to create a character string that includes all of the JMP App code.</P></LINGO-BODY><LINGO-SUB id="lingo-sub-277077" slang="en-US" mode="NONE">Re: Script multiple columns grouped in distribution plot</LINGO-SUB><LINGO-BODY id="lingo-body-277077" slang="en-US" mode="NONE"><P>If I wanted to put that into an application, with a local data filter, could I put the Allocate statement inside the Eval(Parse) ?</P><P>So..</P><PRE><CODE class=" language-jsl">theExpr = "dis = Allocate(
Border1 = Border Box();
DataFilterContext1 = Data Filter Context Box();
List1 = H List Box();
DataFilter1 = Dt << Data Filter( Local );
Report1 = Platform(
Dt,
Distribution(
Continuous Distribution( column( column(Dt, colNames[1])))";
For( i = 2, i <= N Items( colNames ), i++,
theExpr = theExpr || ", Continuous Distribution( column( column(Dt, colNames[" || Char( i ) || "])))"
);
theExpr = theExpr || " )
);
)";
show(theexpr);
Eval( Parse( theExpr ) );
Re: Script multiple columns grouped in distribution plotAll you need to do is to modify the list of column names, to meet the requirements. There are many ways to do this, below is one example
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
// Get the all of the numeric, continuous column names
colNames = dt << 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 >= 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 << 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 <= 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 ) );
Re: Script multiple columns grouped in distribution plot@txnelson 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",,. How to filter to show continuous distributions for example "Loss1", "Loss2",, only?
Re: Script multiple columns grouped in distribution plot@RonSwanson ,
Jim @txnelson'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. 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.
Names default to Here(1);
dt = Open("$Sample_Data/Semiconductor Capability.jmp");
cnames = dt << get column names("Continuous", "string");
//Here I will just use 10
cnames = cnames[1::10];
dist = dt << Distribution(Columns(evalList(cnames)));
//if you want to limit the number per row
dist << arrange in rows(3); //change 3 to 5 or whatever you want
dist << Capability Analysis(0); //turn off the distribution
report(dist)[OutlineBox(2)] << Open all like this(1); //reveal all distributions
report(dist)[OutlineBox(2)] << Close all like this(1); //do not reveal

Re: Script multiple columns grouped in distribution plotexactly what I needed... thanks tx!!Re: Script multiple columns grouped in distribution plotHere is one way to generate the code required to produce what you want
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Get the all of the numeric, continuous column names
colNames = dt << get column names( string, continuous );
// Build a character string that represents the commands that need to be run
theExpr = "dis = dt << 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 <= 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 ) );