根據上面行中不同列的值的評估填充空白單元格你好
我有以下問題:
我想透過「父清單」列中的公式或腳本填充單元格,該列位於「層級」列中的下一個 n-1 值上:
填入空白儲存格(「父清單」列,第 10 行):
•在有空白儲存格的行中前往包含值「4」的層級列
•計算n-1(“3”)
• 找出上麵包含值 n-1 (3) 的下一行,即第 9 行。 將材質列的字元 (7P61G05) 複製到空白儲存格(零件列表,第 10 行):

相應地填入所有空白單元格。
另外還可能出現以下特殊情況:
編號下降:仍選擇儲存格中具有 n-1 值的行

我希望任何人都可以解決這個問題! 預先感謝您,
馬蒂亞斯
進階統計建模自動化和腳本編寫資料混合與清理回覆:根據上面行中不同列的值評估填入空白儲存格以下是另一個想法,因為它使用的方法與 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
);
));回覆:根據上面行中不同列的值評估填入空白儲存格親愛的傑德
太棒了,腳本完美地按照預期運行! 非常感謝您的支持。 這將是腳本的組成部分,該腳本將以某種形式提供 SAP 數據,使數據可用於物料跟踪,這在 SAP 中是一個難題。 我之前的腳本已經使JMP在公司內非常受歡迎,因為它被廣泛使用。 也感謝您的腳本課程。 這絕對是我想要更好學習的東西。
再次感謝並致上最誠摯的問候,
馬蒂亞斯
回覆:根據上面行中不同列的值評估填入空白儲存格啊,我想,現在我更了解你在尋找什麼。 這是一個更新的腳本,以及連結到免費且優秀的線上 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
)
);
回覆:根據上面行中不同列的值評估填入空白儲存格你好傑德,
這是太棒了! 非常感謝您的大力支持! 還有一點小錢,也許你也能解決這個問題?
該腳本似乎在級別列中進一步向下查找 n-1 數字,而它應該查找最後一個 n-1,在本例中為級別“3”,即在要填充的單元格之前! 因此,第 10 行到第 14 行的儲存格中使用了錯誤的字元。我創建了「正確」列,您可以看到正確填充的儲存格:

該腳本使用下一個即將到來的第 3 級中的字元“D9844”,而不是相應行之前最後一個第 3 級中的“7P61G05”。
我將添加 jmp 表。
預先感謝您並致以最誠摯的問候,
馬蒂亞斯
回覆:根據上面行中不同列的值評估填入空白儲存格如果我理解正確,這個 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
)
);
回覆:根據上面行中不同列的值評估填入空白儲存格是的,當然,謝謝。 在“所需列”列中,我從“材料”列中複製了我希望腳本應插入的單元格,具體取決於“級別!”列中的值。
回覆:根據上面行中不同列的值評估填入空白儲存格您能否提供包含資料和包含正確值的一列的資料表?