Nicole McDaniels
asked on
Null as value for Dynamic parameter in CR2008?
Hi
I have a report with a parameter "Problem Code" that is currently set to Dynamic. The users want to be able to add a "Blank" value as a selection so they can still include records with "Problem Code" even if it's null. Is that even possible? In my select expert I just have
{BAX_V_REPORTED_PROBLEM_CO DE} = {?Problem Code}
I have a report with a parameter "Problem Code" that is currently set to Dynamic. The users want to be able to add a "Blank" value as a selection so they can still include records with "Problem Code" even if it's null. Is that even possible? In my select expert I just have
{BAX_V_REPORTED_PROBLEM_CO
If you want the report to always include the null values, then something like Serena's suggestion might work, although I think
<> “?Problem Code”
should be
= {?Problem Code}
However, as I understand it, the users want to be able to specifically ask for the null values, and have them only be included when they ask for them. If that's the case, how are you building the list of values for the parameter? If you're using a Command (ie. a manual query), you could modify the query so that it includes the space as another value for the parameter (this is assuming that the Problem Code field is never actually blank). For example, if the current query was
SELECT BAX_V_REPORTED_PROBLEM_COD E FROM some_table
you could add
UNION
SELECT " "
That would add the space as another value in the list.
Then your record selection would be something like:
(
( {?Problem Code} = " " and IsNull ({BAX_V_REPORTED_PROBLEM_C ODE}) ) or
{BAX_V_REPORTED_PROBLEM_CO DE} = {?Problem Code}
)
James
<> “?Problem Code”
should be
= {?Problem Code}
However, as I understand it, the users want to be able to specifically ask for the null values, and have them only be included when they ask for them. If that's the case, how are you building the list of values for the parameter? If you're using a Command (ie. a manual query), you could modify the query so that it includes the space as another value for the parameter (this is assuming that the Problem Code field is never actually blank). For example, if the current query was
SELECT BAX_V_REPORTED_PROBLEM_COD
you could add
UNION
SELECT " "
That would add the space as another value in the list.
Then your record selection would be something like:
(
( {?Problem Code} = " " and IsNull ({BAX_V_REPORTED_PROBLEM_C
{BAX_V_REPORTED_PROBLEM_CO
)
James
Depending on your database you may have to use a left outer join or even use a command.
mlmcc
mlmcc
ASKER
James, I am not currently using a command, currently my parameter is defined as "Dynamic" in the parameter fields only (and then in the Select Expert as table=?Problem code.)
So, to use a command, how would I use what you have to create a selection of "BLANK" for the user to choose if they wish but also populate the picklist as well?
So, when the report is run, the user would be able to choose from:
BLANK
Problem Code 1
Problem Code 2
Problem Code 3
etc
They want to be able to choose multiple values (e.g. BLANK, PROBLEM CODE 1, PROBLEM CODE 2)
So, to use a command, how would I use what you have to create a selection of "BLANK" for the user to choose if they wish but also populate the picklist as well?
So, when the report is run, the user would be able to choose from:
BLANK
Problem Code 1
Problem Code 2
Problem Code 3
etc
They want to be able to choose multiple values (e.g. BLANK, PROBLEM CODE 1, PROBLEM CODE 2)
ASKER
I have this but I know it's not right...I am very brand new to commands!
select " " as BLANK from dual
union all
SELECT AS_REPORTED_PROBLEM_CODE FROM BAX_V_GCMS_COMPLAINT_RECOR D
select " " as BLANK from dual
union all
SELECT AS_REPORTED_PROBLEM_CODE FROM BAX_V_GCMS_COMPLAINT_RECOR
How about using a second parameter?
The second could just ask if they want to include NULL values. Then you modify the select statement based on the response.
In the report did you just select tables from the database?
If so is the selection being done on the main table or one of the joined tables?
From your sample command I assume you are using Oracle.
mlmcc
The second could just ask if they want to include NULL values. Then you modify the select statement based on the response.
In the report did you just select tables from the database?
If so is the selection being done on the main table or one of the joined tables?
From your sample command I assume you are using Oracle.
mlmcc
ASKER
Yes, I just selected tables from the DB and it is being done on joined tables. So If I add another parameter like Include Null values YES/NO how would I modify the select stmt to include null AND whatever values are in the original Problem Code param?
if {?Null Problem Code}="YES" then isnull({BAX_V_GCMS_COMPLAI NT_RECORD. AS_REPORTE D_PROBLEM_ CODE}) and
{BAX_V_GCMS_COMPLAINT_RECO RD.AS_REPO RTED_PROBL EM_CODE} = {?Problem Code} ??
Doesn't that contradict?
if {?Null Problem Code}="YES" then isnull({BAX_V_GCMS_COMPLAI
{BAX_V_GCMS_COMPLAINT_RECO
Doesn't that contradict?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It worked, thanks!
IsNull({BAX_V_REPORTED_PRO