如何在Crystal Report的“交叉”选项卡中获取上一个行值 [英] How to get the previous row value in the Cross Tab in Crystal Report
本文介绍了如何在Crystal Report的“交叉”选项卡中获取上一个行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的交叉标签
Hi,
I have a cross tab like this
Gulberg Off SWG
IN Out Total IN Out Total
1/1/1900 0.00 0.00 0.00 20.00 0.00 20.00
7/3/2013 0.00 0.00 0.00 0.00 -1.00 19.00
7/8/2013 0.00 -2.00 -2.00 0.00 0.00 0.00
7/12/2013 10.00 0.00 8.00 0.00 0.00 0.00
7/13/2013 0.00 -1.00 7.00 0.00 0.00 0.00
7/16/2013 0.00 0.00 0.00 0.00 -10.00 9.00
7/27/2013 0.00 -1.00 6.00 0.00 0.00 0.00
7/29/2013 0.00 -4.00 2.00 0.00 0.00 0.00
7/30/2013 0.00 0.00 0.00 0.00 -1.00 8.00
我想要的是将之前的总值转发到IN和Out列中具有零的下一行。
例如2013年7月16日行在Gulberg Off下总值为零,但我想在此行中显示以前的总值为Total,即7.00
如何实现这一目标?
如何在交叉表中获取Previous值以在下一行中使用它i在同一列?
What I want is to forward the previous total value to the next Row having Zero in the "IN" and "Out" Columns.
For example in 7/16/2013 row Under the "Gulberg Off" the total values are zero but I want to show the Previous total value in this row as Total which is 7.00
How can I achieve this ?
How can I get the Previous value in the cross tab to use it in the next row in the same column?
推荐答案
使用派生字段,如下面的查询
(选择顶部来自table1的总数为1,其中mydate< '7/16/2013'和field2 ='Gulberg off'
由mydate desc订购)为'Prev total'
希望这会有所帮助!!
Use the derived field something like the below query
(select top 1 total from table1 where mydate < '7/16/2013' and field2 = 'Gulberg off'
order by mydate desc) as 'Prev total'
Hope this helps!!
这篇关于如何在Crystal Report的“交叉”选项卡中获取上一个行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文