參考分組列的日期差異計算我正在嘗試計算當前行與未丟失評論的最後一行之間的日期差異。 非常感謝任何幫助!
If( (:ID == Lag( :ID ) | Row() == 1) & !Is Missing( :Comments ), 0,
Date Difference( :Sampled Date, Lag(:Sampled Date, <FONT color="#FF0000">n=last row where !Is Missing(:Comments)</FONT>), "Day" )
)

回复:參考分組列的日期差異計算謝謝! 這行得通!
回复:參考分組列的日期差異計算謝謝ih,但這不起作用。 您創建的新列沒有填充最後評論的日期,只是滯後採樣日期。 感謝您的嘗試!
回复:參考分組列的日期差異計算這是我將用於計算的公式
If( Row() == 1 | :ID != Lag( :ID ),
lastCmtDate = .
);
If( :Comments != "",
lastCmtDate = :Sampled Date
);
:Days Since Last Comment = (:Sampled Date - lastCmtDate) / In Days( 1 );
回复:參考分組列的日期差異計算如果表格總是按日期排序,您可以使用兩列來執行此操作,如下所示。
New Column( "Last Comment Date",
Numeric,
"Continuous",
Format( "m/d/y h:m", 19 ),
Input Format( "Monddyyyy h:m" ),
Formula(
If(
Row() == 1, :Sampled Date,
:Comments == Lag( :Comments, 1 ), Lag( :Sampled Date, 1 ),
:Sampled Date
)
),
Set Display Width( 136 )
);
New Column( "Days Since Last Comment New",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( (:Sampled Date - :Last Comment Date) / (3600 * 24) ),
Set Display Width( 109 )
);
回覆:引用分組列的日期差異計算我想我有一個非常相似的問題。
我嘗試了您給我們的公式,但在我的表中它不起作用。 (第 5 欄(Tagen Bauteil 1 中的差異))。
首先,日期差異不是寫在註釋 (1) 所在的行中,而是寫在所有其他行中。
對我來說更重要的是,它只寫到最後一個日期的差異,而不是最後一個評論(或沒有評論)的日期。
你能再幫忙嗎?
回覆:引用分組列的日期差異計算嘗試這個
If( Row() == 1 | :Source Table != Lag( :Source Table ),
lastCmtDate = :"Datum:"n,
lastCmtDate = Lag( :"Datum:"n )
);
If( :Bauteil 1 == "",
:Differenz in Tagen Bauteil 1 = (:"Datum:"n - lastCmtDate) / In Days( 1 ),
:Differenz in Tagen Bauteil 1 = .
);
回覆:引用分組列的日期差異計算謝謝吉姆。
它仍然不起作用,但是用你的公式我現在找到了一個解決方法並使用 2 個新列來計算,現在它可以工作了:)
New Column( "Letzter Komentar Tag",
Numerisch,
"Stetig",
Format( "t.m.j", 12 ),
Eingabeformat( "t.m.j" ),
Formel(
If( Row() == 1 | :Quelltabelle != Lag( :Quelltabelle ),
lastCmtDate = .
);
If( :Bauteil 1 == "1",
lastCmtDate = :"Datum:"n,
lastCmtDate
)));
New Column( "Differenz Bauteil 1",
Numerisch,
"Stetig",
Format( "Bestes", 12 ),
Formel(
If( :Bauteil 1 == "1",
(:"Datum:"n - Lag( :Letzter Komentar Tag )) / In Days( 1 )
)));