WHERE clause in SSRS expression
44,977
Use the IIF method:
=Sum(IIF(Fields!Program.Value = "FC", Fields!QuantityToShip.Value, 0))
Author by
sion_corn
Updated on July 09, 2022Comments
-
sion_corn almost 2 years
What's the syntax for inserting a
WHERE
clause in anSSRS expression
? I am usingBIDS 2008
.=Sum(Fields!QuantityToShip.Value) WHERE FIELDS!Program.Value = "FC"
The code listed above represents the logic I want to use, but obviously inserting the
WHERE
in there creates a syntax error.The purpose of this expression is to define a series' value field in a stacked bar chart.
Any help would be greatly appreciated!
-
user1647667 about 10 yearshi, what if i have 2 fields for where clause can i just use like this: Fields!Program.Value = "FC" and Fields!Program.Value = "GC"
-
Sir Crispalot about 10 yearsWell it's just a boolean expression, so you should be able to do something like:
=Sum(IIF((Fields!Program.Value = "FC" And Fields!Program.OtherValue = "XX"), Fields!QuantityToShip.Value, 0))
. Obviously your example won't work becauseProgram.Value
can't be FC and GC at the same time. Plus it'sAnd
in VB, notand
. -
T3.0 over 6 yearsHow can you write an IIF depending upon the value of the intersecting column?
-
Sir Crispalot over 6 years@T3.0 not entirely sure what you mean. Perhaps try asking a new question with an example of your problem and what you've tried so far.