Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to determine if a parameter is Array

Status
Not open for further replies.

chris777

MIS
Jan 3, 2002
228
US
I need to create a formula to display parameter value(s) entered by the user. The parameter is a Multiple Discrete.

I am having trouble with it as there can be multiple or a single value. If there is only one value I can't use JOIN, so I am trying to figure out a way to determine if the parameter is a distinct value or multiple (array) value and then use the appropriate CASE to display the value(s).

I have been trying to determine a way to COUNT the number of values in the parameter but the COUNT function doesn't work. I don't know of any kind of IS ARRAY? type test.

Any ideas?

Chris


Chris
DFW Crystal User Group
 
I have never tried this, but:

If Count({?ParmField})>1 then <<logic on how to treat arrays>> else <<logic on how to treat single values>>

Let me know if that works

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
The COUNT function was the first thing I tried, but I get an error: &quot;The Summary/Running Total total could not be created&quot;

Thanks.

Chris
DFW Crystal User Group
 
I just tested this in version 8.5 developer and it works:

if count({?Parm})>1 then join({?Parm},&quot;, &quot;) else {?Parm}[1]

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
I believe the join function works even if only one parameter (string) value is selected, so maybe the initial problem with join was also because of the parameter error.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top