你好
我寫了一個腳本來刪除一列。但是,我收到錯誤消息“當公式將其引用到另一列時,無法刪除該列。 "
沒有公式,但如果手動使用“刪除參考”選項,我可以手動刪除列。
我需要學習如何在我的腳本中使用這個函數來使用“刪除參考”
我正在使用 JMP 16.1.0
您可能想退後一步,考慮一下您正在使用的方法。 與其解決這個問題,不如一開始就避免它。 例如,您為什麼在其他數據列中使用公式? 為什麼要刪除列?
您也許可以使用其他方式來填充完全不涉及公式的數據列。 在編寫 JMP 腳本時使用公式的唯一原因是您需要在數據表更改時更新數據列。 否則還有其他方法。
你能發布你的腳本嗎? 或者描述你的腳本所採取的步驟?
我想知道是否有隱藏的公式列? 如果真的沒有公式列,這聽起來像是一個錯誤,將表格發送給技術支持可以幫助修復它。
問題與匯總表有關嗎?
就在今天,當我嘗試刪除公式時,我確實注意到匯總表的一些奇怪行為。 我目前正在測試這個問題,並會在我提供適當的示例後將票發送給 JMP 支持。 準備好後,我也可以在此處發布示例。
編輯:
這是關於我今天遇到的問題的快速示例(我很少使用公式......):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
//create some formula colums
dt << New Column("deduction", Numeric, "Continuous", Format("Best", 12), Formula(:height - :weight));
dt << New Column("concat_col", Character, "Nominal", Formula(:name||"_"||Char(:name)));
dt_summary = dt << Summary(
Group(:name,:sex, :concat_col),
Mean(:height),
Mean(:deduction),
Freq("None"),
Weight("None"),
Link to original datatable(0)
);
Try(
dt_summary << Delete Column("name");
,
show(exception_msg);
);
Try(
f = Column(dt_summary, "concat_col") << Get Formula;
show(f);
Column(dt_summary, "concat_col") << Delete Formula;
,
show(exception_msg);
);
/*
Cannot delete column "name" while it is referenced by the formula of column "concat_col".
Removing a formula leaves the data unchanged. Removing references replaces each reference with an empty value. These effects are permanent and cannot be undone.
f = :name || "_" || Char(:name);
exception_msg = {"Column concat_col has no formula"(1, 2, "Delete Formula", Delete Formula /*###*/)};
*/
公式在左側的列列表中不可見,公式在公式面板框中也不可見。

如果我單擊編輯公式,公式就在那裡。 如果我將連接中的“_”更改為“”,則公式消失,列被鎖定並且數據表中的值確實會發生變化:


在這種情況下,簡單的修復可能是在創建匯總表之前首先從原始數據表中刪除所有公式,但我認為不應將公式(僅值)複製到匯總表,因為它可能有一些非常奇怪的行為取決於公式。
編輯2:
我現在已經向 JMP 支持發送了關於我描述的這個問題/功能的票。