• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

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!
0
cyardley
Asked:
cyardley
  • 2
  • 2
1 Solution
 
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
 
cyardleyAuthor Commented:
Thank You very much!  That worked perfect.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now