Link to home
Start Free TrialLog in
Avatar of lancerxe
lancerxe

asked on

Issue with Crystal 10 Record Selection

Hello experts:

I have a report with the following record selection criteria:
 
(({NewThreats.SuspiciousAmountIndicator} = '1' and

{NewThreats.LowAverageBalanceIndicator} = '1' and

{NewThreats.SimilarAmountsIndicator} = '1' and

{NewThreats.UnusualZeroesIndicator} = '1' and

(not isnull({NewThreats.DrawingOnRDPIndicator}) and

{NewThreats.DrawingOnRDPIndicator} = '1'))  or

 
({NewThreats.SuspiciousAmountIndicator} = '1' and

{NewThreats.LowAverageBalanceIndicator} = '1' and

{NewThreats.SimilarAmountsIndicator} = '1' and

{NewThreats.UnusualZeroesIndicator} = '1' and

(not isnull({NewThreats.DrawingOnExposureIndicator}) and

{NewThreats.DrawingOnExposureIndicator} = '1')))
 
I added the criteria below but the results are the same as before
even though there's tons of RDI on the database.

Or
({NewThreats.Hittype} = 'RDI')




 The new formula looks like this:

(({NewThreats.SuspiciousAmountIndicator} = '1' and

{NewThreats.LowAverageBalanceIndicator} = '1' and

{NewThreats.SimilarAmountsIndicator} = '1' and

{NewThreats.UnusualZeroesIndicator} = '1' and

(not isnull({NewThreats.DrawingOnRDPIndicator}) and

{NewThreats.DrawingOnRDPIndicator} = '1'))  or

 

 

({NewThreats.SuspiciousAmountIndicator} = '1' and

{NewThreats.LowAverageBalanceIndicator} = '1' and

{NewThreats.SimilarAmountsIndicator} = '1' and

{NewThreats.UnusualZeroesIndicator} = '1' and

(not isnull({NewThreats.DrawingOnExposureIndicator}) and

{NewThreats.DrawingOnExposureIndicator} = '1')) or

 
({NewThreats.Hittype} = 'RDI')


)



 Thanks

 


Avatar of JayConverse
JayConverse
Flag of United States of America image

or  ({NewThreats.Hittype} = 'RDI')

needs to be outside the last parenthesis.


Avatar of peter57r
Do you have any Null values in HitType?
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try moving the NULL checks to the top, like attached.
~Kurt
(
  (
    (
      not isnull({NewThreats.DrawingOnRDPIndicator} or
      not isnull({NewThreats.DrawingOnExposureIndicator}
    ) and
    {NewThreats.SuspiciousAmountIndicator} = '1' and 
    {NewThreats.LowAverageBalanceIndicator} = '1' and
    {NewThreats.SimilarAmountsIndicator} = '1' and
    {NewThreats.UnusualZeroesIndicator} = '1' and 
    {NewThreats.DrawingOnRDPIndicator} = '1'
  ) or
  {NewThreats.Hittype} = 'RDI'
)

Open in new window

Avatar of Mike McCracken
Mike McCracken

That is not the same since the the tested field after the null test is different.

I thought the same at first.

Is NewThreats the only table in the report?

mlmcc
Good catch.  Since the "DrawingOn.." fields are set explicitly to = '1', there's no need for a NULL check at all, since if it's '1', it can't possibly be NULL.
(
  (
    (
      {NewThreats.DrawingOnRDPIndicator} = '1' or
      {NewThreats.DrawingOnExposureIndicator} = '1'
    ) and
    {NewThreats.SuspiciousAmountIndicator} = '1' and 
    {NewThreats.LowAverageBalanceIndicator} = '1' and
    {NewThreats.SimilarAmountsIndicator} = '1' and
    {NewThreats.UnusualZeroesIndicator} = '1'
  ) or
  {NewThreats.Hittype} = 'RDI'
)

Open in new window