?
Solved

Parameter with Value, or Null or empty sting.

Posted on 2013-05-17
6
Medium Priority
?
320 Views
Last Modified: 2013-05-25
I have a question regarding parameter that could have value or Null value or empty string “” value.


For example I have report with four fields: field1,field2,field3,field4.
For every field I  have parmeter Par1,Par2,Par3,Par4.

I understand that parameter is filter applied in selection criteria against a field.
Records will be selected based on value or values of the parameter or parameters for the field or fields.

Sometimes user asks for option to have specific values, multiple values or All values option for particular parameter.
I am ok with that  situation and I know how to provide it and what this selection will bring back.

However I was not sure about situation when there are scenario that in the same filed could be values and could be null values too and user ask selection on this way to be done:
 
You have parameter e.g.  Par3 for that field3. In report as I mentioned you have  other fields with their parameters.
You select other fields based on their parameter values  and you came to the Par3 you select value and for example there is no value-match for that filed it means complete record will not be pulled out,  does not matter that other fields have value.

Lot of times  customer wants and  asks  to pull out that record  out and show empty field in our case  field3 that Par3 was filtering and hit Null or empty string.
I never was sure how to provide it.
Any Idea?
0
Comment
Question by:Taras
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 39175843
SO if Par3 has 45 as the value to look for what you want is 45 or NULL?

(IsNull({Field3}  OR {?Par3} = {Field3})

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 39176996
Do you want to allow the user to specifically ask for the records where field X is null or an empty string (instead of asking for some other value), or do you want to include those records, no matter what value the user asked for?

 mlmcc's suggestion should give you the second one, although he left out the ")" for the IsNull function:

(IsNull({Field3}) OR {?Par3} = {Field3})


 If you want to allow the user to specifically ask for the null values, you could have a special parameter value for that.  One obvious choice would be "Null", assuming that your field will never be that string.  Then that part of the formula would look something like:

(
({?Par3} = "Null" and IsNull ({Field3})) or
 {?Par3} = {Field3}
)


 If you want them to be able to ask for the records where the field is an empty string, they could just enter an empty string in the parameter.  If you want to combine that with the "Null" option, so that it gives you both the null and empty string records, you could use:

(
({?Par3} = "Null" and (IsNull ({Field3}) or {Field3} = "")) or
 {?Par3} = {Field3}
)


 James
0
 

Author Comment

by:Taras
ID: 39190720
James I am interested in for that first  option you mentioned.

 Let say can we put both option empty string “” and Null value for the field3  as “NoEntry”.
To not confuse user with "" or "Null" , he see that as no entry.

Now when parameter is opened in front of the user he sees next choices e.g. :
A
B
C
D
NoEntry.

If he wants e.g.  A and B   he will pick up A and B and selection will pull only records for A and B no other.
If he wants A and B plus those with empty string or Null values he  will select :  A, B, NoEntry.

How code with Par3 looks for this?
0
[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

 
LVL 35

Accepted Solution

by:
James0628 earned 2000 total points
ID: 39191893
I think it would just be something like this:

(
({?Par3} = "NoEntry" and (IsNull ({Field3}) or {Field3} = "")) or
 {?Par3} = {Field3}
)


 James
0
 

Author Closing Comment

by:Taras
ID: 39194738
Thanks a lot.
0
 
LVL 35

Expert Comment

by:James0628
ID: 39196416
You're welcome.  Glad I could help.

 James
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question