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 do I select multiple values based on parameters 1

Status
Not open for further replies.
Jul 28, 2011
167
NG
Hi all,
I have a little challenge. I have a report that I declared a parameter called Department that has default values like this:
All Departments
Project
Field Service
Workshop
Warranty
Marine
Contract
Manufacturing

I have also enabled the "Allow Multiple Values" check box. In my select expert, I have:
Code:
{command.Job Posting Group} in 
switch(
{?Department} = "All Departments",["","JOB - EXT", "JOB-AFMEXP", "JOB-LUB/S", "JOB-NBCMTU","JOB-ABB-AS","JOB-CANPJB",
                     "JOB-INSTAL","JOB-CUMNS", "JOB-W/SHOP", "JOB-WS/GEN","JOB-WTY","JOB-MAR","JOB-S/AGR", "RENTAL"],
{?Department} = "Project",["JOB-INSTAL"],
    {?Department} = "Field Service",  ["JOB - EXT", "JOB-AFMEXP", "JOB-LUB/S", "JOB-NBCMTU","JOB-ABB-AS"],
	{?Department} = "Workshop",  ["JOB-CUMNS", "JOB-W/SHOP", "JOB-WS/GEN"],
	{?Department} = "Warranty",["JOB-WTY"],
	{?Department} = "Marine",["JOB-MAR"],
	{?Department} = "Contract",["JOB-S/AGR"],
	{?Department} = "Manufacturing",["JOB-CANPJB"]
    )
The problem is that when I test this (with CR10 or on web), and I select multiple values, the thing does not show the values for the multiple values. It only works when I select a single department.
What should I do?

 
Maybe try creating a formula {@Dept} like this:

if {command.Job Posting Group} = "JOB-WTY" then
"Warranty" else
if {command.Job Posting Group} = "JOB-MAR" then
"Marine" else
if {command.Job Posting Group} in ["JOB-CUMNS", "JOB-W/SHOP", "JOB-WS/GEN"] then
"Workshop" else
//etc.

Don't add an "All Dept" option to the formula. Then use a selection formula like this:

(
(
{?Department} <> "All Departments" and
{@Dept} = {?Department}
) or
{?Department} = "All Departments"
)

Or if "All Departments" is still a subset of all potential departments, change it to:

(
(
{?Department} <> "All Departments" and
{@Dept} = {?Department}
) or
(
{?Department} = "All Departments" and
{command.Job Posting Group} in ["","JOB - EXT", "JOB-AFMEXP", "JOB-LUB/S", "JOB-NBCMTU","JOB-ABB-AS","JOB-CANPJB",
"JOB-INSTAL","JOB-CUMNS", "JOB-W/SHOP", "JOB-WS/GEN","JOB-WTY","JOB-MAR","JOB-S/AGR", "RENTAL"]
)
)

-LB
 
@lbass: Wow! thanks, you seem to have solved my puzzle again the second time. I'm indeed grateful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top