boucle la fonction de capacité de processusJ'essaie de parcourir une série de noms de colonnes sélectionnés par l'utilisateur (nom_col)
puis de cette liste, le code sera exécuté pour chaque colonne individuelle
le problème est que je n'arrive pas à faire en sorte que JMP lise le nom_colonne [i] sous forme de colonne, il suffit de le lire sous forme de chaîne
et indiquez que la colonne est introuvable dans la table de données
/*****************************************************
*********************** Cpk *********************
*****************************************************/
cpk =expr(
for (k=1,k<=n items(col_name),k++
Process Capability(
Process Variables( col_name[i]) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{choice[i] << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[k] )
))
);Re: boucle la fonction de capacité de processussalut, ci-joint est une version simplifiée des données brutes utilisées
Re: boucle la fonction de capacité de processusVeuillez fournir des exemples de données pour vous aider à résoudre le problème.
Re: boucle la fonction de capacité de processusne semble pas fonctionner, j'ai essayé d'imprimer la configuration remplacée, il semble
mais le nom de la sortie n'a toujours pas changé
CPK = Expr(
v list box(
For( i = 1, i <= N Items( choices ), i++,
For( j = 1, j <= N Items( Config ), j++,
;
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits(
__choices__(
LSL( FAI_SPECS[choices[i] || " LSL"] ),
Target( FAI_SPECS[choices[i] || " Nominal"] ),
USL( FAI_SPECS[choices[i] || " USL"] )
)
),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[j] );//"P1_41_PBO")///":name(\!"" || Config[j] || "\!")")
SendToReport(
Dispatch(
{},
"Individual Detail Reports",
OutlineBox,
{Set Title( __YourConfig__ )}
)
);
);
print(__YourConfig__);
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[i] || "\!")" ),
Expr( __YourConfig__ ), Char( Config[j] )
)
)
;
)
)
)
);Re: boucle la fonction de capacité de processusVoici un développement simple de la fonction Substitute () qui devrait vous donner les résultats souhaités.
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
For( j = 1, j <= N Items( Config ), j++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits(
__choices__(
LSL( FAI_SPECS[choices[i] || " LSL"] ),
Target( FAI_SPECS[choices[i] || " Nominal"] ),
USL( FAI_SPECS[choices[i] || " USL"] )
)
),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[j] );//"P1_41_PBO")///":name(\!"" || Config[j] || "\!")")
SendToReport(
Dispatch(
{},
"Individual Detail Reports",
OutlineBox,
{Set Title( __YourConfig__ )}
)
);
)
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[i] || "\!")" ),
Expr( __YourConfig__ ), Char( Config[j] )
)
)
;
)
)
);Re: boucle la fonction de capacité de processusBonjour Monsieur,
merci de votre patience pour m'aider avec ce script jsl
Je n'aurais pas pu le faire sans vous.
juste un ajustement supplémentaire pour ce script
Comment puis-je définir le titre?
CPK = Expr(
For( i = 1, i <= n items(choices), i++,
for(j=1,j<=n items(Config),j++,
print(choices);
Eval(
Substitute(
Expr(
Process Capability(
Process Variables(as column(choices[i])) ,
Spec Limits( __choices__( LSL(FAI_SPECS[choices[i] || " LSL"] ), Target( FAI_SPECS[choices[i] || " Nominal"] ), USL( FAI_SPECS[choices[i] || " USL"] ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config ==config[j]);//"P1_41_PBO")///":name(\!"" || Config[j] || "\!")")
SendToReport(
Dispatch(
{},
"Individual Detail Reports",
OutlineBox,
{Set Title( "To the same as config[j]" )}
)
)
)
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[i] || "\!")" )
)
)
)
)
);Re: boucle la fonction de capacité de processusAvec le nom de colonne complexe que vous avez, JMP a besoin d’aide pour l’analyser correctement. La fonction: Name () doit être utilisée pour afficher le nom comme étant un nom et non comme un élément à exécuter.
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config=="P1_A1_MBO" )
);
Print( "choice: _", __choices__, "_chhoice" );
),
Expr( __choices__ ), Parse( ":name(\!"" || choices[1] || "\!")" )
)
);
)
);
dt=current data table();
choices = { "FAI 37_SPC AK R14 Thickness R14 top - Cu Surface","Filling VIM Total Thickness" };
new window("jo",V list box(cpk));Re: boucle la fonction de capacité de processusle code a fonctionné sur l'exemple de table de données, mais lorsque je l'ai essayé sur mes données, ils m'ont donné cette erreur.
la pièce jointe est montrer que les données im essayant de tirer
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config==P1_A1_MBO )
);
Print( "choice: _", __choices__, "_chhoice" );
),
Expr( __choices__ ), Parse( ":" || choices[1] )
)
);
)
);
dt=current data table();
choices = { "FAI 37_SPC AK R14 Thickness R14 top - Cu Surface","Filling VIM Total Thickness" };
new window("jo",V list box(cpk));{"Plateau FAI 37_SPC AK R14 Epaisseur R14 - Surface Cu", "Epaisseur totale de remplissage VIM"}
Nom non résolu: Config {1} dans l'accès ou l'évaluation de 'Config',: Config / * ### * /
Cette clause Where pour la table de données 'FAI_Spec 2' n'a généré aucune ligne:: Config == P1_A1_MBO
"choix: _"
Nom non résolu: FAI 37_SPC AK R14 épaisseur R14 top {1} en accès ou évaluation de 'FAI 37_SPC AK R14 épaisseur R14 top',: FAI 37_SPC AK R14 épaisseur R14 top / * ### * /
Re: boucle la fonction de capacité de processusVoici un tableau de données simplifié avec le code que vous avez fourni. Sur mon système, il fonctionne sans erreur, y compris vos instructions Print.
dt = New Table( "Example",
Add Rows( 40 ),
New Column("config",
Character( 1 ),
Set Values(
{"P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "M", "M", "M", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "M", "M", "M",
"M", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "P1_31_PBO", "M", "M", "M", "M", "M", "M", "M", "P1_31_PBO",
"P1_31_PBO", "M", "M", "M", "M", "M", "P1_31_PBO", "P1_31_PBO", "M", "P1_31_PBO", "M", "M"}
)
),
New Column("height",
Set Values(
[59, 61, 55, 66, 52, 60, 61, 51, 60, 61, 56, 65, 63, 58, 59, 61, 62, 65,
63, 62, 63, 64, 65, 64, 68, 64, 69, 62, 64, 67, 65, 66, 62, 66, 65, 60,
68, 62, 68, 70]
)
)
);
CPK = Expr(
For( i = 1, i <= N Items( choices ), i++,
Print( choices );
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( As Column( choices[i] ) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{__choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
);
Print( "choice: _", __choices__, "_chhoice" );
),
Expr( __choices__ ), Parse( ":" || choices[1] )
)
);
)
);
dt=current data table();
choices = { "height" };
cpk;Re: boucle la fonction de capacité de processus CPK = Expr(
For( i = 1, i <= n items(choices), i++,
print(choices);
Eval(
Substitute(
Expr(
Process Capability(
Process Variables(as column(choices[i]) ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
);
print("choice: _",__choices__,"_chhoice")
),
Expr( __choices__ ), Parse(":" || choices[1] )
)
)
)
);j'ai essayé d'utiliser print pour voir ce que cela donne mais je continue à avoir l'erreur "inconnue"
Re: boucle la fonction de capacité de processusPour ajouter à la recommandation de Jim, ce cas serait un bon moment pour utiliser le débogueur pour examiner ou surveiller vos variables lorsque vous parcourez des lignes ou des points d'arrêt.
Re: boucle la fonction de capacité de processusJe vous suggère de parcourir les valeurs de "i" et de vérifier quel code est produit à partir de la fonction Substitution () pour chaque valeur de "i"; Vous devriez alors voir pourquoi le code ne fonctionne pas pour certaines valeurs de "i"
Re: boucle la fonction de capacité de processus///BOX PLOT///
boxplot=expr(
data_filtering;
choices=choice<<GETKEYS></GETKEYS><BR />
//BOX PLOT inner expression//
box_plot_inner_expr=expr(
for(i=1,i<=n items(choices),i++,
FAI_USL=Fai_specs[concat(choices[i]," USL")];
FAI_LSL=Fai_specs[concat(choices[i]," LSL")];
FAI_target=Fai_specs[concat(choices[i]," Nominal")];
print(FAI_USL);
Oneway(
Y(choices[i]),
X( :Config),
All Pairs(
1,
Confidence Quantile( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 0 )
),
Comparison Circles( 0 ),
Means and Std Dev( 1 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
Points Jittered( 1 ),
SendToReport(
Dispatch(
{},
OutlineBox,
{
}
),
Dispatch(
{},
"1",
ScaleBox,
{Min( FAI_LSL-10 ), Max(FAI_USL+10 ), Inc( 5 ), Minor Ticks( 1 ),
Add Ref Line( FAI_LSL, "Dashed", "Medium Dark Red", "LSL", 1 ),
Add Ref Line( FAI_USL, "Dashed", "Medium Dark Red", "USL", 1 ),
Add Ref Line( FAI_target, "Dashed", "Dark Green", "Target", 1 )}
),
Dispatch(
{},
"Oneway Plot",
FrameBox,
{Frame Size( 347, 229 ), DispatchSeg(
Box Plot Seg( 1 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 2 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 3 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 4 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 5 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 6 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 7 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 8 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 9 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 10 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 11 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 12 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 13 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 14 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 15 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 16 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 17 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 18 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
), DispatchSeg(
Box Plot Seg( 19 ),
{Box Type( "Outlier" ), Confidence Diamond( 0 ), Line Color( "Red" )
}
)}
),
Dispatch( {}, "Means and Std Deviations", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Means Comparisons", OutlineBox, {Close( 1 )} )
)
)));
Re: boucle la fonction de capacité de processusQuel est le code qui appelle l'expression CPK?Re: boucle la fonction de capacité de processusmerci de votre patience, mais même après avoir modifié n éléments, les spécifications et l'histogramme de l'un des éléments ne sont également disponibles.
l’autre JMP m’a quand même demandé de saisir manuellement
CPK = Expr(
For( i = 1,i<=n items(choices) , i++,
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( as column(choices[i])),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
)
),
Expr( __choices__ ), Parse( ":" || choices[i] )
)
)
)
);Re: boucle la fonction de capacité de processusJ'ai changé la définition de la boucle For () lorsque je testais le code, et j'ai oublié de la modifier ...... c'est probablement le problème ..... veuillez remplacer la boucle For () par
CPK=expr(for(i=1,i<=n items(choices),i++,
Re: boucle la fonction de capacité de processustweeté légèrement
mais les spécifications et l'histogramme masqué ne fonctionnent que sur le deuxième élément de la liste, savez-vous que vous y êtes?
CPK = Expr(
For( i = 1, i <= 2, i++,
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( as column(choices[i])),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
)
),
Expr( __choices__ ), Parse( ":" || choices[i] )
)
)
)
);Re: boucle la fonction de capacité de processusCertaines instructions de JSL ne permettent pas d'évaluer les éléments des instructions avant de les exécuter. Si tel est le cas, il est préférable d’utiliser une substitution pour créer l’instruction complète avant de l’exécuter. Vous trouverez ci-dessous une modification de votre script à la méthodologie de substitution.
CPK = Expr(
For( i = 1, i <= 1, i++,
Eval(
Substitute(
Expr(
Process Capability(
Process Variables( __choices__ ),
Spec Limits( __choices__( LSL( 400 ), Target( 425 ), USL( 450 ) ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{ __choices__ << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
)
),
Expr( __choices__ ), Parse( ":" || choices[i] )
)
)
)
);Re: boucle la fonction de capacité de processusMerci pour la réponse rapide,
k n'est pas lié à i
k est comme le numéro d'élément d'un groupe et i est le groupe
les colonnes as fonctionnent pour la variable de processus mais pour les limites de spécifications et la fermeture de l'histogramme, cela ne semble pas fonctionner
/*****************************************************
*********************** Cpk *********************
*****************************************************/
CPK=expr(for(i=1,i<=n items(choices),i++,
Process Capability(
Process Variables(as column(choices[i]) ),
Spec Limits(
as column(choices[i])(LSL( 400 ),
Target( 425 ), USL( 450 ))
),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{as column(choices[i]) <<
Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == "P1_31_PBO" )
);
));
Re: boucle la fonction de capacité de processusJe crois que votre seul problème de syntaxe est que vous avez besoin d’une fonction As Column () autour du nom de col [i].
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt:sex << set name( "Config" );
dt:height << set property( "spec limits", {LSL( 55 ), USL( 70 ), Show Limits( 0 )} );
dt:weight << set property( "spec limits", {LSL( 80 ), USL( 160 ), Show Limits( 0 )} );
config = {"F", "M"};
col_name = dt << get column names( string, continuous );
cpk = Expr(
For( k = 1, k <= N Items( col_name ), k++,
Process Capability(
Process Variables( As Column( col_name[i] ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 ),
Capability Index Plot( 0 ),
{choice[i] << Process Capability Analysis( Histogram( 0 ) )},
Where( :Config == config[k] )
)
)
);
For( i = 1, i <= N Items( col_name ), i++,
cpk
);
Je suis aussi un peu confus sur votre boucle For () utilisant "k". Êtes-vous sûr de vouloir parcourir les éléments 1 à N (nom_col). Il semble que nom_colonne soit lié à la variable "i"?