report builder IIF() function with multiple TRUE value

Mask picture Mask · May 20, 2015 · Viewed 19.9k times · Source

I'm encountering an issue while develloping some report on RB.

I have a tablix that where the columns are the hours of the day, and the rows are different products. I also have a parameter with 3 values (AM, PM, NIGHT).

The point here is that if the parameter is set to AM, the tablix only display columns from 6 to 12, if it's set to PM, the tablix display from 12 to 18,...

I can display time intervals (6 to 12) by using filter where i tell him "Hour" IN "6, 7, 8, 9, 10, 11, 12". But it doesn't work when i set the filter value as following:

Expression: =Cstr(Fields!ProdHour.Value)

Operator: IN

Value:

=iif(join(Parameters!Shift.Value) = "AM", "6, 7, 8, 9, 10, 11, 12" , iif(join(Parameters!Shift.Value) = "PM", "13, 14, 15, 16, 17, 18", iif(join(Parameters!Shift.Value) = "NIGHT", "19, 20, 21, 22, 23, 0", false) ) )

Do you have any idea how I could solve this? Tried to change every number in Integer but didn't work...

Answer

Naveen Kumar picture Naveen Kumar · May 20, 2015

I would suggest change the binding of your parameter like (ID,Value) see screen shot below

enter image description here

Now you can use the expression to get selected value

=Parameters!ReportParameter1.Value

You can also use below query to bind your dropdown, if don't want to hard code

Select ID,Value From 
(Values('6,7,8,9,10,11,12','AM'),
('13,14,15,16,17,18','PM'),
('19,20,21,22,23,0','Night'))
tblTime(ID,Value)

I think that is what you are looking for