你好!我正在尝试将 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 内置解决方案。