I'm working on SSRS report.
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))
Now How can I set 1st field only from sql and rest of other as it is coming from expression?
Because of I'm using Previous function
1st value is always coming 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
?
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))
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:
=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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.