aneilg
asked on
SSRS Expression
i have the following expression.
=Switch(
fields!PercentFlag.Value ="H", format(fields!Time.Value, "HH:mm"),
((Fields!PercentFlag.Value ="Y")AND (Fields!Value.Value >0)), Format(Sum(Fields!Value.Va lue * 100), "0.0"),
True, Replace(cStr(Sum(Fields!Va lue.Value) ),".0","")
)
produces 026369797987998
but when i take out
AND (Fields!Value.Value >0))
so i am left with
=Switch(
fields!PercentFlag.Value ="H", format(fields!Time.Value, "HH:mm"),
((Fields!PercentFlag.Value ="Y")), Format(Sum(Fields!Value.Va lue * 100), "0.0"),
True, Replace(cStr(Sum(Fields!Va lue.Value) ),".0","")
)
i get 2.7. but if the value = 0 i get 0.0.
why does my first expression does not work.
=Switch(
fields!PercentFlag.Value ="H", format(fields!Time.Value, "HH:mm"),
((Fields!PercentFlag.Value
True, Replace(cStr(Sum(Fields!Va
)
produces 026369797987998
but when i take out
AND (Fields!Value.Value >0))
so i am left with
=Switch(
fields!PercentFlag.Value ="H", format(fields!Time.Value, "HH:mm"),
((Fields!PercentFlag.Value
True, Replace(cStr(Sum(Fields!Va
)
i get 2.7. but if the value = 0 i get 0.0.
why does my first expression does not work.
ASKER
basically if my value is greater than 0, then format the date. but when i add 'AND (Fields!Value.Value >0))' the formatting does not work.
This may be a little off on the syntax but I think you will be able to adjust it.
Use a IIF nest IN a IIF.
=IIF(fields!PercentFlag.Va lue ="H", format(fields!Time.Value, "HH:mm"),
IIF (Fields!PercentFlag.Value ="Y" AND (Fields!Value.Value > 0), Format(Sum(Fields!Value.Va lue * 100), "0.0"), Replace(CStr(Sum(Fields!Va lue.Value) ), ".0", False, True))
Use a IIF nest IN a IIF.
=IIF(fields!PercentFlag.Va
IIF (Fields!PercentFlag.Value ="Y" AND (Fields!Value.Value > 0), Format(Sum(Fields!Value.Va
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
question can be closed. no answer given. but the solution has been resloved.
can you explain alittle on what you are wanting to do with your data