mdiglio
asked on
Help with iif statement in a report
Hello,
If more info is needed just ask...I didn't want to clutter this up w/ too much detail on what the fields are and what I am trying to do.
I'm using Reporting Services. For the y axis on a chart report I have the following:
=round(Fields!CountOfLogin Time.Value / Sum(Fields!no_of_weeks.Val ue, "average")/5,0)
This works and returns the expected result.
However for one instance ( a parameter ) I would like to divide by 6 instead of 5.
So I was thinkng I needed an iif statement
I have one parameter in the report... Parameters!location.Value
So how can i write the following iif statement ? or any other method that can be used
if Parameters!location.Value = 'ab123' then
round(Fields!CountOfLoginT ime.Value/ Sum(Fields!no_of_weeks.Val ue, "average")/6,0)
else
round(Fields!CountOfLoginT ime.Value/ Sum(Fields!no_of_weeks.Val ue, "average")/5,0)
Thank you for your time
If more info is needed just ask...I didn't want to clutter this up w/ too much detail on what the fields are and what I am trying to do.
I'm using Reporting Services. For the y axis on a chart report I have the following:
=round(Fields!CountOfLogin
This works and returns the expected result.
However for one instance ( a parameter ) I would like to divide by 6 instead of 5.
So I was thinkng I needed an iif statement
I have one parameter in the report... Parameters!location.Value
So how can i write the following iif statement ? or any other method that can be used
if Parameters!location.Value = 'ab123' then
round(Fields!CountOfLoginT
else
round(Fields!CountOfLoginT
Thank you for your time
Hi mdiglio!
You will simply do it like this :
if (Parameters!location.Value = 'ab123' or Parameters!location.Value = 'ab321') then
round(Fields!CountOfLoginT ime.Value/ Sum(Fields!no_of_weeks.Val ue, "average")/6,0)
else
round(Fields!CountOfLoginT ime.Value/ Sum(Fields!no_of_weeks.Val ue, "average")/5,0)
Hope this helps you. Just try it.
Goodluck!
eNTRANCE2002 :-)
You will simply do it like this :
if (Parameters!location.Value
round(Fields!CountOfLoginT
else
round(Fields!CountOfLoginT
Hope this helps you. Just try it.
Goodluck!
eNTRANCE2002 :-)
ASKER
Hi,
Thanks for the response.
That doesn't seem to work as an expression
Thanks for the response.
That doesn't seem to work as an expression
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey...I like it!
Thanks for the help
Thanks for the help
ASKER
Can there be an OR in there ?
if Parameters!location.Value = 'ab123' or 'ab321' then
round(Fields!CountOfLoginT
else
round(Fields!CountOfLoginT