Display Description of Parameter number values

Hello,

I have a parameter that contains scores 0 to 5.  What I want to do is create a title in the page header that shows the user the Description of the values that they have selected for the report.  I am using the following formula (greatly provided by the expert mlmcc) to capture the values:
Loacl StringVar ParamList := '';
Local NumberVar i;

For i := 1 to UBoud({?pScore}) do
(
    If ParamList = '' then
        ParamList := CStr({?pScore[i]},0)
    else
        ParamList := ParamList & ', ' & CStr({?pScore[i]},0)
);
ParamList

However, I would like to display them on the report with their description instead of the number values.  Is there a way to do this?

My score value and classifications are:
0 = Failed
1 = Insufficient
2 = Possible
3 = Minor
4 = Moderate
5 = Major

Thank You!
cyardleyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

UnifiedISCommented:
Create a formula and use switch
SWITCH (parameter = 0, "Failed", parameter = 1, "Insufficient")

and so on
replace parameter with the proper parameter field.

0
cyardleyAuthor Commented:
UnifiedIS,

Thank you for the reply.  The switch formula does work but not if I select multiple values to report on.  It only shows one value.  The parameter is a multiple value parameter so users might select the score of 3 and 5, for example.  Is there a formula that will show all value names that are selected?

Thanks!
0
UnifiedISCommented:
Here you go:

Local StringVar ParamList := '';
Local NumberVar i;

For i:= 1 to UBound({?pScore}) do
(
If ParamList = '' then
        ParamList := CHOOSE({?pScore}[i] + 1,"Failed", "Insufficient", "Possible", "Minor", "Moderate", "Major")
else
ParamList := ParamList & ", " &  CHOOSE({?pScore}[i] + 1,"Failed", "Insufficient", "Possible", "Minor", "Moderate", "Major");
);
ParamList
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cyardleyAuthor Commented:
Thank You very much!  That worked perfect.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.