你好!我正在嘗試將 8 個表組合在一起並自動更新原始表(無論是 excel 還是 JMP 數據表)。
- 這 8 個表具有相同的列名和屬性,它們只是具有不同的數據集,所以我在技術上試圖做的是將它們連接在一起。
- 如果添加/刪除了饋線表中的數據等,我還需要連接表(8 饋入的表)能夠更新。
我知道有一個“連接”可以創建一個數據庫,該數據庫實際上會隨著輸入數據表的更改而更新,但該功能不能滿足我的需要,因為它只是替換數據(JMP 上的“連接”功能);它不連接。
是否有一種功能可以虛擬地連接 8 個數據表(最好是 excel),以便連接的數據表(具有所有 8 個原始數據表的組合)將在饋線數據表更改時更新?
先感謝您!
編輯:有關更新的更多詳細信息——我們以不規則的間隔接收數據(某些測試需要更長的時間),因此在我們開始分析某些數據之前並非所有結果都可用。我們希望在分析數據(在組合/串聯表中)時更新數據(對單獨的 8 個數據表)。 所以理想情況下,我們希望自動更新連接的數據表(如果更新了 8 個單獨數據表的任何部分),同時在側欄上維護分析或繪圖腳本。
我也不知道有什麼工具類似於虛擬連接,但聽起來您可以使用傳統連接的不太複雜的腳本來完成此操作。這是我將開始的一般方法:
Names Default to here(1);
//reference the current data table (the one you are already working in)
dtLatest = current data table();
//list of all source files and variable to hold references to source tables
SourceFile = {"C:\file1.xlsx", "C:\file2.xlsx", ... };
dtSource = list();
//If all files have the same format, use a function to open them all
openfile = Function({fn},
//Open function, copy this from the source script after opening a file interactively
dt = Open(
fn,
Worksheets( "Sheet 1" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 1 ),
Data Starts on Row( 2 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 1 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
dt << New Column(..); //add any more columns, filter or clean data as appropriate
dt;
);
//Open source tables
for( f=1, f<= n items(SourceFile), f++,
dtSource = openfile( SourceFile[f] )
);
//Join all the files together
dtJoined = Concatenate(dtSource);
//Close the source tables
dtSource << Close Window()
//In the source table, delete all rows
dtLatest << Select all Rows;
dtLatest << Delete Rows;
//Concatenate the new rows again
dtLatest << Concatenate( dtJoined );
謝謝@gzmorgan0對於建議,我添加了更多細節。
啊,好的,謝謝:(有點不幸。我不熟悉 SQL,但如果它簡單/直接,我願意學習/嘗試它。
@AU ,
我不知道 JMP 內置選項可以做你想做的事,但 SQL 大師可能有一種方法可以做我認為你想做的事。 我不確定您的期望/用例是什麼。
您希望在分析數據時有更新嗎? 您有想要更新的分析嗎? 或者這個文件/分析是否預計會定期更新?
如果您更詳細地描述了您的期望(嘗試做的事情),那麼社區可能會為您提供解決方案,即使它不是 JMP 內置解決方案。