上の行の異なる列の値の評価に基づいて空のセルを埋めるこんにちは
次の問題があります。
列レベルの次の n-1 値を使用して、列「親リスト」の数式またはスクリプトを使用してセルを埋めたいと考えています。
空のセルに入力します (列「親リスト」、行 10):
•空のセルがある行では、値「4」を含むレベル列に移動します。
•n-1 (「3」) を計算します。
•値 n-1 (3) が含まれる上の次の行 (行番号 9) を検索します。 材料列の文字 (7P61G05) を空のセル (部品リスト、行 10) にコピーします。

それに応じてすべての空のセルを埋めます。
さらに、次のような特殊なケースが発生する可能性があります。
番号付けが下がります: セル内の n-1 値を持つ行を引き続き選択します

誰かがそれを解決できることを願っています! よろしくお願いします。
マティアス
高度な統計モデリング自動化とスクリプト作成データのブレンディングとクリーンアップRe: 上の行の異なる列の値の評価に基づいて空のセルを埋める以下は、Jed とは少し異なる方法を使用する他のアイデアです。
Names Default To Here(1);
// format data
dt = Open("$DOWNLOADS\Fill empty cells V2.jmp");
Column(dt, "Desired Column")[10::N Rows(dt)] = ""; // set empty values
Column(dt, "Desired Column") << Set Name("Parent List");
//Column(dt, "Parent List") << Set Each Value( I would suggest creation of new column
dt << New Column("ParentListFixed", Character, Nominal, << Set Each Value(
As Constant(
m_levels = :Level << get values;
m_materials = :Material << get values;
);
If(Is Missing(:"Parent List"n) & !Is Missing(:Level),
level_to_search = :Level - 1;
If(level_to_search > 0,
row_of_interest = Max(Loc(m_levels[1::Row()], level_to_search));
m_materials[row_of_interest];
,
"";
);
,
:"Parent List"n
);
));Re: 上の行の異なる列の値の評価に基づいて空のセルを埋める親愛なるジェドへ
素晴らしいですね、スクリプトは意図したとおりに完璧に機能します。 ご支援誠にありがとうございました。 これは、SAP にとって面倒な材料追跡のためにデータにアクセスできる形式で SAP データを提供するスクリプトの不可欠な部分になります。 私の以前のスクリプトにより、JMP は広く使用されており、すでに社内で非常に人気のあるものになりました。 スクリプト講座もよろしくお願いします。 それは間違いなく私がもっと良く学びたいことです。
それでは、改めて感謝いたします。よろしくお願いします。
マティアス
Re: 上の行の異なる列の値の評価に基づいて空のセルを埋めるああ、あなたが何を探しているのか、よりよく理解できたと思います。 ここに更新されたスクリプトと、無料の優れたオンライン JMP スクリプト コースへのリンク
/*JMP STATISTICAL DISCOVERY LLC (“JMP”) PERMITS THE USE OF THIS COMPUTER SOFTWARE CODE (“CODE”) ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS LISTED HEREIN. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE OF THE CODE IS AT YOUR OWN RISK. JMP MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRIGEMENT, AND TITLE, WITH RESPECT TO THE CODE.
You may use the Code solely as part of a software product you currently have licensed from JMP, JMP’s parent company SAS Institute Inc. (“SAS”), or one of JMP’s or SAS’s subsidiaries or authorized agents (the “Software”), and not for any other purpose. The Code is designed to add functionality to the Software but has not necessarily been tested. Accordingly, JMP makes no representation or warranty that the Code will operate error-free. JMP is under no obligation to maintain, support, or continue to distribute the Code.
Neither JMP nor its licensors shall be liable to you or any third-party for any general, special, direct, indirect, consequential, incidental, or other damages whatsoever arising out of or related to your use or inability to use the Code, even if JMP has been advised of the possibility of such damages. Except as otherwise provided above, the Code is governed by the same agreement that governs the Software. If you do not have an existing agreement with JMP or SAS governing the Software, you may not use the Code.
JMP and all other JMP Statistical Discovery LLC product or service names are registered trademarks or trademarks of JMP Statistical Discovery LLC in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.
*/
Names Default To Here( 1 );
dt = Current Data Table();
row()=10;
For Each Row(
dt,
If( Row() > 1,
n = row(); //temporary row variable for later
look_for_n = :Level[Row()] - 1; //find Level - 1
rows_with_n = dt << get rows where( :Level == look_for_n & row() < n ); //get all rows that match
last_n = rows_with_n[N Items( rows_with_n )]; //get the last of those rows
:Desired Column = Char( :Material[last_n] ); //put into desired column
)
);
Re: 上の行の異なる列の値の評価に基づいて空のセルを埋めるこんにちは、ジェドさん
これは素晴らしいです! 素晴らしいサポートをしていただき、本当にありがとうございました! まだ少額のお金が残っていますが、それも解決できるかもしれません。
スクリプトは、レベル列のさらに下にある n-1 の数値を探しているようですが、セルが入力される前にある最後の n-1 (この場合はレベル「3」) を探す必要があります。 そのため、行 10 から 14 のセルに間違った文字が入力されました。正しく入力されたセルが表示されるように、「正しい」列を作成しました。

スクリプトでは、それぞれの行の前の最後のレベル 3 の文字「7P61G05」の代わりに、次に来るレベル 3 の文字「D9844」を使用します。
jmpテーブルを追加します。
よろしくお願いいたします。
マティアス
Re: 上の行の異なる列の値の評価に基づいて空のセルを埋める私の理解が正しければ、この JSL はあなたが探していることを行うはずです。
/*JMP STATISTICAL DISCOVERY LLC (“JMP”) PERMITS THE USE OF THIS COMPUTER SOFTWARE CODE (“CODE”) ON AN AS-IS BASIS AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS LISTED HEREIN. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE OF THE CODE IS AT YOUR OWN RISK. JMP MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRIGEMENT, AND TITLE, WITH RESPECT TO THE CODE.
You may use the Code solely as part of a software product you currently have licensed from JMP, JMP’s parent company SAS Institute Inc. (“SAS”), or one of JMP’s or SAS’s subsidiaries or authorized agents (the “Software”), and not for any other purpose. The Code is designed to add functionality to the Software but has not necessarily been tested. Accordingly, JMP makes no representation or warranty that the Code will operate error-free. JMP is under no obligation to maintain, support, or continue to distribute the Code.
Neither JMP nor its licensors shall be liable to you or any third-party for any general, special, direct, indirect, consequential, incidental, or other damages whatsoever arising out of or related to your use or inability to use the Code, even if JMP has been advised of the possibility of such damages. Except as otherwise provided above, the Code is governed by the same agreement that governs the Software. If you do not have an existing agreement with JMP or SAS governing the Software, you may not use the Code.
JMP and all other JMP Statistical Discovery LLC product or service names are registered trademarks or trademarks of JMP Statistical Discovery LLC in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.
*/
Names Default To Here( 1 );
dt = Current Data Table();
For Each Row(
dt,
If( Row() > 1,
look_for_n = :Level[Row()] - 1; //find Level - 1
rows_with_n = dt << get rows where( :Level == look_for_n ); //get all rows that match
last_n = rows_with_n[N Items( rows_with_n )]; //get the last of those rows
:Desired Column = Char( :Material[last_n] ); //put into desired column
)
);
Re: 上の行の異なる列の値の評価に基づいて空のセルを埋めるはい、もちろん、ありがとうございます。 「Desired Column」列では、「Level!」列の値に応じて、スクリプトが挿入する必要があると予想されるセルを「マテリアル」列からコピーしました。
Re: 上の行の異なる列の値の評価に基づいて空のセルを埋めるデータと正しい値が含まれる 1 つの列を含むデータ テーブルを提供していただけますか?