Reputation: 16219
I'm working on SSRS reporting , we have one report in that group section is there and for
one value named Long-Only
some expression is there as follows
=IIF(CDec(Parameters!NAV.Value) > 1,((SUM(Fields!LongMV.Value) - SUM(IIF(Right(Fields!SecurityType.Value, 4) = "Cash" OR Left(Fields!SecurityType.Value, 8) = "Treasury", Fields!LongMV.Value, 0)))/(Parameters!NAV.Value/1000)) -1,0)
Here above expression is a calculation for LONGVALUE
I want to execute this function is there any way to do so (only this function by putting sample values)?
NAV.Value = 1200 SUM(Fields!LongMV.Value) = 49
what this does (Right(Fields!SecurityType.Value, 4) = "Cash"
?
I'm new to ssrs reporting could anyone please help me to know the expression.
we are using stored procedures for reporting.
thanks
Upvotes: 0
Views: 1146
Reputation: 39566
Formatting it a bit helps:
=IIF
(
CDec(Parameters!NAV.Value) > 1
,
(
(
SUM(Fields!LongMV.Value) -
SUM
(
IIF
(
Right(Fields!SecurityType.Value, 4) = "Cash" OR Left(Fields!SecurityType.Value, 8) = "Treasury"
, Fields!LongMV.Value
, 0
)
)
) /(Parameters!NAV.Value/1000)
) - 1
, 0
)
So here we can see that for each group, the expression is calculating:
If NAV parameter > 1, return 0
Else return group level ((LongMV - Cash Long MV) / NAV parameter / 1000) - 1
Where Cash Long MV
is:
Group level Cash type Long MV + Group level Treasury type Long MV
.
So that's what the expression is calculating. I'm still not sure what the question is here - only you can put the above in any sort of context based on what your data all means.
Is this something you can discuss further with your colleagues?
Edit after comment:
Right()
is just a standard SSRS/.NET function that returns a specified number of characters from the right of a string..
Right(Fields!SecurityType.Value, 4) = "Cash"
checks whether certain Security Types should be included in the calculation, based on the last 4 characters in the Security Type value. This would include Security Types as Settled Cash and Unsettled Cash, for example.
For testing with specific values is to return those values to the Dataset in the stored procedure, e.g. Make it so that the total LongMV returned sums to your required value.
Or you could just hard code them into the formula; it's not really a question that has a definite answer.
Upvotes: 1