[英]How do I set 1st row value from sql in ssrs report?
I'm working on SSRS report. 我正在研究SSRS报告。
There are two main fields CurrentMV
and PreviousMV
both are having there different formulas but I'm taking PreviousMV as a value of CurrentMV using =Previous(Sum(Fields!CurrentMV.Value))
有两个主要字段
CurrentMV
和PreviousMV
都有不同的公式,但是我使用=Previous(Sum(Fields!CurrentMV.Value))
将PreviousMV作为CurrentMV的值。
Now How can I set 1st field only from sql and rest of other as it is coming from expression? 现在,如何仅从sql设置其他字段,而其余的其他字段则来自表达式呢?
Because of I'm using Previous function
1st value is always coming null :( 由于我使用的是
Previous function
第一个值始终为null :(
I have the field in reporting proc which can give me the values but How can I set both 1st values as well as Previous function
? 我在报告过程中具有可以给我值的字段,但是如何设置第一个值和
Previous function
?
Using Ian
posts in answer But , I want to display only 1st field
from Sum(Fields!PreviousMV.Value)
and all preceding values by using Previous(Sum(Fields!CurrentMV.Value))
使用
Ian
在回答职位,但,我想只显示1st field
由Sum(Fields!PreviousMV.Value)
和所有前面用数值Previous(Sum(Fields!CurrentMV.Value))
I tried like following and getting syntax error: 我尝试像以下并获取语法错误:
=First(Sum(Fields!PreviousMV.Value)) ,Previous(Sum(Fields!CurrentMV.Value))
You can explicitly check for NULL values: 您可以显式检查NULL值:
=IIf(IsNothing(Previous(Sum(Fields!CurrentMV.Value)))
, Sum(Fields!PreviousMV.Value)
, Previous(Sum(Fields!CurrentMV.Value)))
Since there are no Previous
groups for the first group, this will return NULL for the first group, and hence the above expression will work for you. 由于第一组没有
Previous
组,因此第一组将返回NULL,因此上面的表达式将对您有用。
Here is a simple report that uses the expression. 这是使用该表达式的简单报告。
Data: 数据:
Report: 报告:
The expression value is the one above. 表达式值是上面的值。
Result: 结果:
You can see it's picking up the values as intended. 您可以看到它正在按预期拾取值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.