LeeSmith
Registered User.
- Local time
- Today, 17:00
- Joined
- Mar 17, 2006
- Messages
- 27
I am working on a report in SSRS. I have created a calculated field using the IIF function. I now want to group my data by the values returned from the if statement and use them as parameters. The grouping seems to work well, but when I create the parameter I end up with more than one value the same e.g. "Beauty Therapy" appears twice in the drop down list.
Below is the IIF Statement
=(iif((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=011),"Counselling",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=012),"Food Hygiene",
(iif((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=013),"Health and Safety",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=014),"First Aid",
(iif((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=015),"Beauty Therapy",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=021),"Science and Mathematics",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=031),"Agriculture, Horticulture & Animal Care",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=041),"Engineering and manufaturing technologies",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=051),"Planning and the built environment",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=061),"ICT",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=071),"Leisure travel & tourism",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=091),"Arts, media & Publishing",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=101),"History, philosophy & theology",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=111),"Social Services",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=121),"Languages",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=122),"BSL",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=144),"Family Learning",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=147),"SAL",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=131),"Teacher Training",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=141),"Esol",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=142),"EFL",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=143),"Skills For Life",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=146),"GCSE",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=148),"Access To Education",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=151),"Business","Other"))))))))))))))))))))))))))))))))))))))))))))))))))
Also if anyone could suggest a more efficient way of writing this formula, it would be much appreciated
Regards
Lee
Below is the IIF Statement
=(iif((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=011),"Counselling",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=012),"Food Hygiene",
(iif((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=013),"Health and Safety",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=014),"First Aid",
(iif((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=015),"Beauty Therapy",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=021),"Science and Mathematics",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=031),"Agriculture, Horticulture & Animal Care",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=041),"Engineering and manufaturing technologies",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=051),"Planning and the built environment",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=061),"ICT",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=071),"Leisure travel & tourism",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=091),"Arts, media & Publishing",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=101),"History, philosophy & theology",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=111),"Social Services",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=121),"Languages",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=122),"BSL",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=144),"Family Learning",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=147),"SAL",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=131),"Teacher Training",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=141),"Esol",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=142),"EFL",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=143),"Skills For Life",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=146),"GCSE",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=148),"Access To Education",
(IIF((Right(Fields!QUAL_Mgmnt_Code_1.Value,3)=151),"Business","Other"))))))))))))))))))))))))))))))))))))))))))))))))))
Also if anyone could suggest a more efficient way of writing this formula, it would be much appreciated
Regards
Lee