0
votes

I have a SSRS report that contains a stacked bar chart with three values (in percentage) on each column. It now just needs to show two values by summing two of the others and leaving one alone. I need to combine two of the categories into one basically.

The way I thought I'd be able to do this is by using the following expression:

     =sum(iif(Fields!Status.Value = "A" OR Fields!Status.Value = "B", 
      Fields!Percents.Value, "1", sum(iif(Fields!Status.Value = "C", 
      Fields!Percents.Value, "2" ))))

But I am getting an error. Any help or suggestions would be appreciated.

1
The "1" and "2" are to order the two in the columnprogramr
any help would be appreciatedprogramr

1 Answers

0
votes

You have too many parameters in your initial IIF statement. IIF() only takes three parameters, but you've given it four.

Based on your comment, it sounds like you need two separate expressions: for fruits:

= sum(iif(Fields!Status.Value = "Apples" or Fields!Status.Value = "Strawberries", Fields!Percents.Value, 0) 

and for vegetables:

= sum(iif(Fields!Status.Value = "Broccoli", Fields!Percents.Value, 0) 

Given your description, I don't think that can be combined into a single expression.