你好,
我正在編寫一個腳本來對 json 文件進行解卷積。
進入jmp 後,結果表由標記為“study.xyz”、“study.cro”、“groups.xyz”、“groups.id”、“test.xyz”、“test.name”等的多組列組成。
我正在嘗試為每個組創建一系列表格,例如研究/組/測試。
我有一個腳本,當每個子集單獨處理時,效果很好,但由於某些原因,當它移動到下一組時,它會停止創建子集表。
我可以移動處理這些組的順序以及要“子集化”的第一個組。
換句話說,如果我嘗試首先對“研究”進行子集化,則不會處理“組”
如果我將專用於“組”的腳本部分移到第一個位置,它會得到處理,但“學習”不會。
我很困惑。 任何建議將不勝感激。
最好的,
塞巴斯蒂安
try(data table("P0_json")<<CLOSE window=""></CLOSE>這是腳本:
@蒂埃里_S已經回答了你原來的問題。 這是一個不同的答案,可能會避免編寫任何 JSL。
您可以使用 JSON 嚮導獲取所需的表,假設您的數據類似於以下內容:
One way to represent your data in JSONOne way to represent your data in JSON以 JSON 表示數據的一種方法
在嚮導中打開:
Guess and stack to get the first viewGuess and stack to get the first view猜測並堆疊以獲得第一個視圖
記得疊起來!
Choose what JSON tags generate rows in the JMP tableChoose what JSON tags generate rows in the JMP table選擇哪些 JSON 標籤在 JMP 表中生成行
說明:嚮導讀取 JSON 文本,掃描標籤。 標籤檢查為排導致將一行添加到表中。 標籤檢查為坳添加列。
節點顯示 JSON 中文本的嵌套。
Select the columns you don't want (easy on the column headers at the bottom) then pick No ColumnSelect the columns you don't want (easy on the column headers at the bottom) then pick No Column選擇您不需要的列(很容易選擇底部的列標題),然後選擇“無列”
您可以在表格預覽中選擇列,或者在預覽上方的 GUI 中一次選擇一個列,或者在節點樹。 “無列”適用於所有選定的列。
At this point you might also uncheck Groups as a row generator. I forgot, and it made no difference this time. Depends on the JSON organization.At this point you might also uncheck Groups as a row generator. I forgot, and it made no difference this time. Depends on the JSON organization.此時,您還可以取消選中“組作為行生成器”。 我忘了,這次也沒什麼區別。 取決於 JSON 組織。
單擊“確定”
The resulting table's Source script can be re-run to open the table againThe resulting table's Source script can be re-run to open the table again可以重新運行生成的表的源腳本以再次打開該表
對另一張表重複上述操作
Repeat the process to get the other table. Uncheck the study row to remove a blank row from the JMP table.Repeat the process to get the other table. Uncheck the study row to remove a blank row from the JMP table.重複該過程以獲得另一張表。 取消選中研究行可從 JMP 表中刪除空白行。
附上我使用的 JSON,你的可能有點不同,所以步驟可能有點不同。 您還可以重命名列(列名稱字段),但我認為它們已經是您想要的。
你好,
我花了一些時間來調試,但主要問題是您沒有指向第一個子集之後的原始表。 另外,您使用 Col_List 變量引用列,這可能會產生奇怪的結果:我用更標準的“Column (, )”替換這些調用。
這是更新後的腳本
Names default to Here (1);
try(data table("P0_json")<<CLOSE window=""></CLOSE>