Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Expression for IF, THEN ELSE

I am creating a field from tables with our shoretel phone system and i am intergrating reports via SSRS and i need some assisstance with an expression.

=if(Fields!ExitReason.Value 7,
then if (Fields!ExitReason.Value 1,
else if (Fields!ExitReason.Value 0,)))

Definition results should be:

=if(Fields!ExitReason.Value) = 7 then 1 else 0

I am try to get the field to give me 7, 1 else 0. Any assistance would be great.

Thanks, Arron

like image 362
Arron Robles Avatar asked Dec 04 '13 19:12

Arron Robles


People also ask

How do you write an if statement in SSRS expression?

The keyword for an If statement in SSRS is IIF. SSRS interprets expressions to set property values and constructs expressions using simple constants, parameters, dataset fields, functions, and operators.

How do you create an expression in SSRS?

To add an expression to a text box For example, for the dataset field Sales, type [Sales] . For a complex expression, right-click the text box, and select Expression. The Expression dialog box opens. Type or interactively create your expression after the '=' in the expression pane, and then click OK.

What is CDate in SSRS?

The CDate function converts the value to a date. The Now function returns a date value containing the current date and time according to your system. DateDiff returns a Long value specifying the number of time intervals between two Date values.

What is IsNothing in SSRS?

Functions are almost always used at some point within an expression. A particular function we are going to touch on in this article is called IsNothing. This function will let you inspect the value of an object to find out if it is NULL or not.


1 Answers

You should be able to use

IIF(Fields!ExitReason.Value = 7, 1, 0)

http://msdn.microsoft.com/en-us/library/ms157328.aspx

like image 146
Steve Salowitz Avatar answered Sep 24 '22 11:09

Steve Salowitz