Selection Critera Not Working

I have a report which I want to filter by selections
I have created a parameter to either show all or select multiple entries
I have then created a formula to select ALL or the selected critera
Have then added the formula to the Report selection

The ALL is working ok, but if I select a criteria I see all not selected and not the criteria selected
What have I done wrong?
Have attached PDF file, Will upload RPT file later

Gordon
tasks-with-equipment-v6.pdf
Gordon HughesDirectorAsked:
Who is Participating?
 
James0628Commented:
As I mentioned before, the logic in {?Work Category} is backwards.  The last part should be "then 1 else 0".

 Did you actually change {@Task Number} in the report?  The version in your last post looks OK, but is that how it looks in the report?  The formulas that you posted couldn't possibly match everything _except_ RS* when you enter RS* for the parameter.  If the Like test didn't work, you could get everything, or nothing, but getting the opposite of what you asked for means that you've still got the logic reversed somewhere.

 FWIW, you could just forget the {@Task Number} and {@Work Category} formulas and put all of the logic in the record selection formula.  That would simplify things a bit.  For example:

{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
({?Task Number} ='ALL' or {TASK.TASKNUM} LIKE {?Task Number}) and
({?Work Category} ='ALL' or {TASK.EXPENSECLASS} in {?Work Category}) and
{TASK.PRIORITY} = {?Priority}

 Using the {@Task Number} and {@Work Category} formulas should also work (once the logic is corrected), but they're not necessary.

 James
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
What is the record selection formula?
0
 
Gordon HughesDirectorAuthor Commented:
Hi
Have attached the latest RPT file
The record selection formula is:-
{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
{@Task Number} = 1.00 and
{@Work Category} = 1.00 and
{TASK.PRIORITY} = {?Priority}

Gordon
Tasks-with-Equipment-V7.rpt
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Your {?Work Category} and {?Task Number} parameters are NOT part of your record selection logic.
That's why they don't have any impact on that logic.
0
 
Gordon HughesDirectorAuthor Commented:
The two {?} are part of the {@} which I have to use to be able to use the "ALL" criteria
Normally works? But I have something wrong
Any other suggestions

Gordon
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Try to change
... if {?Work Category} = {TASK.EXPENSECLASS} ...
to
...if {TASK.EXPENSECLASS} in {?Work Category} ...
0
 
Gordon HughesDirectorAuthor Commented:
Hi

It still out selects the required work category and shows all the rest

Gordon
0
 
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Place the logic that seems to fail on the report layout.  See if it returns the value you expect (1 or zero).
In other words, isolate where the problem is.
0
 
Gordon HughesDirectorAuthor Commented:
Hi

If I change the select record forula to
{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
{TASK.PRIORITY} = {?Priority} and
{@Task Number} = 1.00 and
{@Work Category} = 0.00

It seems to give me the right data for a work category, but if I select ALL I get nothing

Gordon
0
 
mlmccCommented:
What is the formula for Work Category and Task Number

Try something like

 {TASK.INSERVTASK} = {?In Service} and
 {TASK.SITEID} = {?Site} and
 {TASK.PRIORITY} = {?Priority} and
(
   {?task} = 'ALL'
OR
 {@Task Number} = 1.00
)
AND
(
   {?WorkPriority} = 'ALL'
OR  
 {@Work Category} = 0.00
)

If that doesn't work, post the formulas

mlmcc
0
 
James0628Commented:
In the report that you posted, the logic in {@Task Number} and {@Work Category} is backwards.

 For example, {@Task Number} is:

if {?Task Number} ='ALL' then 1 else
if {TASK.TASKNUM} LIKE {?Task Number} then 0 else 1

 That should be:

if {?Task Number} ='ALL' then 1 else
if {TASK.TASKNUM} LIKE {?Task Number} then 1 else 0

 Plus, you don't need Like, unless you're using wildcards in the values you enter in {?Task Number}.

 James
0
 
Gordon HughesDirectorAuthor Commented:
Hi mimcc/James

The formula mimcc posted does not work says a string is reqired (even after I corrected the field names
The formula James posted was the original one I used

OK
I would like to be abe to select a specific Work Category from the list that is in the DB and would like to be able to selected tasks using a wildcard ie RS* instead of adding the complete task number
In both cases I have added the option to select ALL

I normally have no issues with this, but for some reason it is not working on the report

So what I have is
The parameters set up o prompt the requirement

2 formula
@Work Category = if {?Work Category} ='ALL' then 1 else
if {TASK.EXPENSECLASS} in
{?Work Category} then 0 else 1

@TaskNumber = if {?Task Number} ='ALL' then 1 else
 if {TASK.TASKNUM} LIKE {?Task Number} then 1 else 0

Then the record selection is
{TASK.INSERVTASK} = {?In Service} and
{TASK.SITEID} = {?Site} and
{@Task Number} = 1.00 and
{@Work Category} = 1.00 and
{TASK.PRIORITY} = {?Priority}

When I run the report after selecting a specific work category it gives me all the other work categories and exclude the one I want to see
The same happens if I try and add part of the task number ie RS* I see all the rest except the ones stating RS*

Gordon
0
 
Gordon HughesDirectorAuthor Commented:
James

Well done, just the job

Gordon
0
 
Gordon HughesDirectorAuthor Commented:
Excellent support as normal
0
 
James0628Commented:
Glad I could help.

 James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.