我試圖透過將 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
);