Reputation:
I have a Switch statement in a textbox in my SSRS report, but I have three datasets and need to specify which dataset to use in the switch. Is there a way to to this? If so how would I go about doing it?
This is my Switch statement:
=Switch(Fields!ProjectStatus.Value =100000000,"Active", Fields!ProjectStatus.Value = 100000001,"On Hold", Fields!ProjectStatus.Value = 100000002,"Completed", Fields!ProjectStatus.Value = 100000003, "Cancelled", Fields!ProjectStatus.Value = 100000004, "Researching", Fields!ProjectStatus.Value = 100000005, "Wish List", Fields!ProjectStatus.Value = 100000006, "Queued", Fields!ProjectStatus.Value = 100000007, "Redined"))
Thanks!
Upvotes: 2
Views: 1071
Reputation: 2847
You'll need to perform an aggregation of some sort. Often times FIRST
or MAX
are useful for this.
=Switch(First(Fields!ProjectStatus.Value, "Dataset1") =100000000,"Active", First(Fields!ProjectStatus.Value, "Dataset2") = 100000001,"On Hold", First(Fields!ProjectStatus.Value, "Dataset3") = 100000002,"Completed", First(Fields!ProjectStatus.Value, "Dataset1") = 100000003, "Cancelled", First(Fields!ProjectStatus.Value, "Dataset2") = 100000004, "Researching", First(Fields!ProjectStatus.Value, "Dataset3") = 100000005, "Wish List", First(Fields!ProjectStatus.Value, "Dataset1") = 100000006, "Queued", First(Fields!ProjectStatus.Value, "Dataset2") = 100000007, "Redined"))
Resource: http://msdn.microsoft.com/en-us/library/ms345237.aspx
Upvotes: 2