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

paramter based on another parameter

Status
Not open for further replies.

atarrqis

IS-IT--Management
Nov 26, 2004
155
US
CR8.5 and Oracle
I have a report but the user wants to be able to run it based on a variety of criteria - planner (all or one), part # or order #.

I have a parameter that allows the user to select this:
P1 = Planner, Part No or Shop Order

Then I have a formula that says:
If P1 = "Planner" than planner_code else
If p1 = "Part No" then part_no else
If p1 = "Shop Order" then shop_order
and I can use this for grouping.

I have a second parameter (P2) that allows the user to enter the specific value.

However, I can't figure out how to limit the record selection to this P2 or how to suppress everything except P2. Thanks.
 
this doesn't make sense to me:

"I have a second parameter (P2) that allows the user to enter the specific value."

Specific value of what?

"However, I can't figure out how to limit the record selection to this P2 or how to suppress everything except P2. Thanks."

A standard means for filtering data in the report based on a parameter which will either return everything or specific values is to set a Default Value of All, then in the report->edit selection formula->record use:

(
if {?MyParameter} <> "All" then
{table.field} = {?MyParameter}
else
if {?MyParameter} = "All" then
true
)

-k
 
Sorry.
P2 would be the specific planner, the specific part # or the specific order # the user wanted to run the report for.
 
So whatever they select for thr grouping is what you want to filter by?

If so, use the record selection formula->record with:

If {?P1} = "Planner" then
{planner_code} = {?P2}
else
If {?p1} = "Part No" then
part_no = {?P2}
else
If {?p1} = "Shop Order" then
shop_order = {?P2}

This is using Crystal Syntax, I've no idea what you were using, I guess it was meant as an example as it couldn't have worked as a formula the way it was.

-k
 
Yes, it was a lazy example.
I thought I couldn't use IF statements in the record selection.
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top