Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSRS 2008: IsNothing Expression when displaying different fields Expand / Collapse
Author
Message
Posted Thursday, December 6, 2012 2:08 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, November 24, 2014 5:47 AM
Points: 62, Visits: 224
Hi All,

I'd like to display different fields/columns in a graph based on a parameter.
If the parameter is Null I need to display this field: Fields!vchParentIncidentType.Value and if its not null i need to diaplay this field:Fields!vchIncidentType.Value
I'm using the expression below but at the moment its just displaying this field: vchIncidentType.Value - even if there's no value supplied for the parameter(NULL)

=IIF(ISNothing(Parameters!uidIncidentTypeId.Value), Fields!vchParentIncidentType.Value, Fields!vchIncidentType.Value)

Please help with the correct expression to use.

Kind Regards
Teee
Post #1393378
Posted Thursday, December 6, 2012 7:42 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, December 24, 2014 9:35 AM
Points: 2,114, Visits: 3,720
Hi,
Multi-valued parameters can't be NULL as far as I know, no value supplied gives a parameter value of blank rather than NULL.
Try this expression:

=iif(Join(Parameters!uidIncidentTypeId.Value) = "", Fields!vchParentIncidentType.Value, Fields!vchIncidentType.Value)

Cheers
Gaz
Post #1393528
Posted Thursday, December 6, 2012 11:08 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, November 24, 2014 5:47 AM
Points: 62, Visits: 224
It works perfectly! Thank you so much.
Post #1393863
Posted Friday, December 7, 2012 2:55 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, December 24, 2014 9:35 AM
Points: 2,114, Visits: 3,720
No problem!
Post #1393953
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse