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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula: How to include/report against all groups 1

Status
Not open for further replies.

kapaa

Programmer
Nov 3, 2006
28
US
Crystal 8 - SQL db

I'm not sure how to do this or if it's possible.

I created a parameter field called Group, where the user will be prompted to type a group name to report against: SC, SEC, SDT, DET, etc.

I then created a formual field called SetGroup that say:
if {?group} = "SC" then 401023
else if {?group} = "SEC" then 302450... etc etc

Within the Selection Formula Editor:

if {call_req.group_id} = {@SetGroup} then ...

Up to this point everything is working just fine but what if the user wants to include ALL groups. I can add the option for them to type ALL but I'm not sure how the formula should read. I tried: if {?Group} = "ALL" then * but it doesn't like this, says looking for boolean value. Put the * in quotes,

 
Add another parameter option "ALL" to your list of values (SC, etc). Then change your record selection formula to:

(
if {?group} <> "ALL" then
{call_req.group_id} = {@SetGroup} else
if {?group} = "ALL" then
true
)

-LB
 
Thank you lbass, this worked... I'm so happy. I was very close to this formula, it was the "then true" part I didn't think of and still don't get. Co-worker said same thing, "how does crystal know that 'then true' stands for include all the groups?
 
Crystal doesn't "know" what it means. The formula just says if {?group} = "All" then {?group} = {?group} or, in other words, this parameter will not be used to select records.

-LB
 
Check out my FAQ for advanced record selection formulas:

faq767-3825

What Lbass is saying is that ELSE TRUE means do nothing, which is what you want, you don't want to specifically state bring all groups, the default brings everything anyway.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top