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!

Parameter selections 2

Status
Not open for further replies.

YANKRAY

Technical User
Nov 7, 2003
283
Using CR 10.0

I have renamed some fields to allow for multiple selections based on a parameter selection.

//@station
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN "01,02,04,05,09" then "Predock" else
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN "10,11,12,15,17" then "Teardown/ShakeDown Evaluation" else
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN "20,21,22,23,24,27,28,35,42" then "Repair 1 & 2" else
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN "37,80,85,87,89" then "Fuel & Installs" else
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN "38,81,82,83,88" then "Final Assy" else
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN "91,94,95,96,97,98" then "Flightline" else
"Unassigned Station Group"

I can then use a parameter //?stationgroup to pull the Work_Center_no as a group.

I would like to further define the parameter so that if I request "Predock" I get the WORK_CENTER_NO defined by "Predock".

If I request "Teardown/ShakeDown Evaluation" I get the WORK_CENTER NO defined by "Predock" and "Teardown/ShakeDown Evaluation".

If I request "Repair 1 & 2" I get the WORK_CENTER_NO defined by "Predock" and "Teardown/ShakeDown Evaluation" and Repair 1 & 2".

and so on down the list where the next selection gives me the WORK_CENTER_NO defined by that station and all previous stationgroups.

Any suggestions?

Thanks,
Ray
 
It's not very elegant, but you could do this with a supression formula instead of in the select expert. Return all data, and then supress the data greater that whatever your parameter was.
 
Add another parameter, and give it default values of part or all of the values of @station. (You could use just the first two letters and compair it to Left(@station), 2).)

For your overall selection, you could use a 'boolian', a formula field written to give the answers 'true' or false. It could be @ParamChoice, something like
Code:
(?NameParam not = " "  and (?NameParam = Left(@station), 2))
or
?NumParam = {SR_VISIT_WC_TASK.WORK_CENTER_NO}
In selection, you could test @ParamChoice = true, or just say @ParamChoice, which is how boolians work.

This doesn't seem to meet the whole requirement, because you ask for 1 and 2 and then seem to expect 10s and 20s to be included. You can get that by selecting bits, ToText allows you to take the start or end of a numeric code.

Hope this helps.



[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
if {SR_VISIT_WC_TASK.WORK_CENTER_NO} is a string, then your formula should look like:

if {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09"] then "Predock" else //etc.

...where each possible value is enclosed in quotes.

-LB
 
LB,

{SR_VISIT_WC_TASK.WORK_CENTER_NO} is a string.

I have rewritten @station per your example.

@station is now a selection parameter for the {SR_VISIT_WC_TASK.WORK_CENTER_NO}.

What I have now are these stations based on @station

Predock
Teardown/ShakeDown Evaluation
Repair 1 & 2
Fuel & Installs
Final Assy
Flightline
Unassigned Station Group

The user selects one of these and gets the {SR_VISIT_WC_TASK.WORK_CENTER_NO} assigned.

These are in the order that an aircraft goes through work stations and gets repaired. So now what I want to accomplishe is this:

If the user selects Predock, they get only the WORK_CENTER_NO(s) assigned to Predock.

If the user selects Teardown/ShakeDown Evaluation they get all the Predock WORK_CENTER_NO(s) and the Teardown/ShakeDown Evaluation WORK_CENTER_NO(s).

If the user selects Repair 1 & 2 they get all the Predock WORK_CENTER_NO(s) all the Teardown/ShakeDown Evaluation WORK_CENTER_NO(s) and all the Repair 1 & 2 WORK_CENTER_NO(s).

And on down the line adding the previous selection.
 
Try this for a record selection statement:

if {?station} = "Predock" then
{SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09"] else
if {?station} = "Teardown/ShakeDown Evaluation" then
{SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17"] else
if {?station} = "Repair 1 & 2" then
{SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42"] else //etc.

...where you add in all previous codes with each higher level selection.

-LB
 
LB,

This selection statement is still just giving me the WORK_CENTER_NO(s) associated with the @station formula.

Ray
 
That makes no sense to me. When the user is selecting a parameter option, they can only choose one, correct?

How are you using the {@station formula}? If you are grouping on it, the grouping will remain the same regardless of what parameter is chosen. Were you hoping that the groups would change?

-LB
 
The user can only choose one.
I am grouping on @station and I want the grouping to remain the same.

I have a parameter ?stationgroup that has the list of @stations names as the LOV.

In the record selection I have

{@Station} = {?StationGroup} and
if {@Station} = "Predock" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09"] else
if {@Station} = "Teardown/ShakeDown Evaluation" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17"] else
if {@Station} = "Repair 1 & 2" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17","20","21","22","23","24","27","28","35","42"] else
if {@Station} = "Fuel & Installs" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17","20","21","22","23","24","27","28","35","42","37","80","85","87","89"] else
if {@Station} = "Final Assy" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17","20","21","22","23","24","27","28","35","42","37","80","85","87","89","38","81","82","83","88"] else
if {@Station} = "Flightline" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17","20","21","22","23","24","27","28","35","42","37","80","85","87","89","38","81","82","83","88","91","94","95","96","97","98"] and
 
It should just be:

if {@Station} = "Predock" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09"] else
if {@Station} = "Teardown/ShakeDown Evaluation" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17"] else
if {@Station} = "Repair 1 & 2" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42"] else
if {@Station} = "Fuel & Installs" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42","37",
"80","85","87","89"] else
if {@Station} = "Final Assy" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42","37",
"80","85","87","89","38","81","82","83","88"] else
if {@Station} = "Flightline" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42","37",
"80","85","87","89","38","81","82","83","88","91",
"94","95","96","97","98"] and //etc.

-LB
 
I can understand LB's consternation.

Why do you have {@Station} = {?StationGroup}?

LB's example didn't demonstrate that.

And whar does "I have a parameter ?stationgroup that has the list of @stations names as the LOV." mean?

Try dropping the {@Station} = {?StationGroup}, it means nothing.


I didn't read the entire thread as LB is perfectly capable of handling this, but I'm curious about your grouping as well, I think that you may want to group on a field in the database, such as {SR_VISIT_WC_TASK.WORK_CENTER_NO}.

-k
 
I guess I am stuck on making @station a parameter.

I was using the ?stationgroup parameter to give the user a list of values with the @station names for selection.
 
Sorry, it should be:

if {?StationGroup} = "Predock" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09"] else
if {?StationGroup} = "Teardown/ShakeDown Evaluation" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17"] else
if {?StationGroup} = "Repair 1 & 2" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42"] else
if {?StationGroup} = "Fuel & Installs" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42","37",
"80","85","87","89"] else
if {?StationGroup} = "Final Assy" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42","37",
"80","85","87","89","38","81","82","83","88"] else
if {?StationGroup} = "Flightline" then {SR_VISIT_WC_TASK.WORK_CENTER_NO} IN ["01","02","04","05","09","10","11","12","15","17",
"20","21","22","23","24","27","28","35","42","37",
"80","85","87","89","38","81","82","83","88","91",
"94","95","96","97","98"] and

Your parameter should be set up to have string values of:
"Predock","Teardown/ShakeDown Evaluation","Repair 1 & 2", etc.

You should only be using {@station} for your group.

-LB
 
Formulas aren't parameters, nor do they serve as sources for parameters.

Try LB's solution.

-k
 
Can you give me an example of how to set up the parameter to have string values.

For some reason I am not comprehending this.

Thanks for sticking with me LB and k.
 
On your field explorer, choose "Parameter"->New. Not sure how it's set up in 10.0, but in 8.0, you would then select "string"->set default values and then you would manually enter the text you want for your values. In 11.0, you have the option of inserting values by clicking on "Click here to add item", and then type in your text values, one by one.

-LB
 
I have the parameter, it is entitled {?StationGroup}.

I have enter the text values for the parameter, they are:

"Predock"
"Teardown/ShakeDown Evaluation"
"Repair 1 & 2"
"Fuel & Installs"
"Final Assy"
"Flightline"

How do I associate this back to {@station}?

How do I make the parameter a selection for the user?
 
Why do you want to associate it back to @station?

Here's the methodlogy:

You create a parameter
In the Report->Edit Selection Formula-Record place the record selection formula as LB has defined it.

According to LB @station is the formula you'll use for your grouping, do NOT confuse this with the parameter as they are not joined in any way, although they likely share some code base.

Once you've done the above, the report should prompt for parameters and group according to what's in the @station.

-k
 
I've got it now.
Sorry - I misread one of the responses.

It works perfectly.

Again thanks!

Ray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top