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!

How to use a multi-value parameter in a formula field?

Status
Not open for further replies.

xp8103

Programmer
May 22, 2001
62
US
I am convinced I am barking up the wrong tree.....
My CR9 report uses several parameters to select data, one of which allows multiple values.
I want to put a note in the header of the report to let the user know which parameters he or she has selected. Basically something that looks like:
"Report lists {?Live Study Bills Only} {?Study Type} bills" where {?Live Study Bills Only} is a simple Y or N and {?Study Type} can be a single value like Legislative or multiple like Legislative and Departmental.
If each parameter can only accept one value, this is a no brainer. But once you introduce an array that may or may not have more than one value (it MUST have at least one), it doesnt work. I have tried several different functions (for loops, while do, etc..) with no luck. I envision something like:

IF ({?Live Study Bills Only?} = &quot;Y&quot;) and ({?Study Type} = &quot;All Studies&quot;) <--- The default value
Then &quot;Listing of all live study bills&quot;
Else
IF ({?Live Study Bills Only?} = &quot;Y&quot;) and ({?Study Type} <> &quot;All Studies&quot;)
Then &quot;Listing of live &quot; & {?Study Type} & &quot; study bills&quot;
Else
If ({?Live Study Bills Only?} = &quot;N&quot;) and ({?Study Type} = &quot;All Studies&quot;)
Then &quot;Listing of all study bills&quot;
Else
&quot;Listing of all &quot; & {?Study Type} & &quot; study bills&quot;

The problem comes when I actually try to output the value of ?Study Type when it can have multiple values.
 
Try something like:

IF ({?Live Study Bills Only?} = &quot;Y&quot;) and ({?Study Type} = &quot;All Studies&quot;) <--- The default value
Then &quot;Listing of all live study bills&quot;
Else
IF ({?Live Study Bills Only?} = &quot;Y&quot;) and ({?Study Type} <> &quot;All Studies&quot;)
Then &quot;Listing of live &quot; & join({?Study Type},&quot;, &quot;)+ & &quot; study bills&quot;
Else
If ({?Live Study Bills Only?} = &quot;N&quot;) and ({?Study Type} = &quot;All Studies&quot;)
Then &quot;Listing of all study bills&quot;
Else
&quot;Listing of all &quot; & join({?Study Type},&quot;, &quot;) & &quot; study bills&quot;

The point is to use a join() to concatenate multiple choices.

-k
 
Hey k,
I would not have guessed that. And I most certaily WAS barking up the wrong tree! I was going for more the brute force programming solution.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top