参考分组列的日期差异计算我正在尝试计算当前行与未丢失评论的最后一行之间的日期差异。 非常感谢任何帮助!
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 )
)));