我试图通过将 rowNoVFPD 列与另一个表中的列相匹配来将此表(如下)连接到另一个表。

使用以下公式分配 VFPDplus1 列:
Lag(:VFPD, -1).
当我尝试使用 JSL 执行此操作时,VFPDplus1 列复制到空白处,但其他方面正确。
当我尝试使用“表格”工具栏中的 JMP“加入”选项时,它可以正确复制。
我该如何在 JSL 中解决这个问题?
我当前的连接函数是这样写的:
Data Table( "markTableSubset" ) << Join(
with( Data Table( "VFPD" ) ),
by matching columns( :FloorVdiv64 = :rowNoVFPD )
);
几周后我发现了我的问题,以理清头绪。
这是我的原始脚本中的示例片段:
If( File Exists( path ), //Check file exits, import VFPD file
vfpdTable = Open( path, Import Settings( Data Starts( 5 ) ) );
Column( 1 ) << Data Type( Numeric ) << Modeling Type( "Continuous" ) << Set Name( "rowNoVFPD" );
Column( 2 ) << Set Name( "VFPD" );
New Column( "VFPDplus1", Numeric, Continuous, Formula (Lag(:VFPD,(-1)))); //Look at next row for interpolation after joining
Column( 3 ) << delete property(formula); //Copying formula causes issues when joining
);
我的表可能超过 500,000 行,因为它们是大型实验数据集,所以当我删除公式属性时,公式还没有完成计算整列的结果(回到我最初尝试获取连接的尝试之一工作),因此在加入之前根本没有应用任何公式结果。 如果我在创建新公式列后立即尝试加入,也会发生同样的事情。
我更改了脚本以添加 1 秒的延迟以使公式完全计算,现在我可以毫无问题地加入。 我希望这可以帮助遇到同样问题的其他人。
If( File Exists( path ), //Check file exits, import VFPD file
vfpdTable = Open( path, Import Settings( Data Starts( 5 ) ) );
Column( 1 ) << Data Type( Numeric ) << Modeling Type( "Continuous" ) << Set Name( "rowNoVFPD" );
Column( 2 ) << Set Name( "VFPD" );
New Column( "VFPDplus1", Numeric, Continuous, Formula (Lag(:VFPD,(-1)))); //Look at next row for interpolation after joining
Wait(1); //Necessary to stop deleting the formula before it's calculated the full column
Column( 3 ) << delete property(formula); //Copying formula causes issues when joining
);