cancel
Showing results for 
Search instead for 
Did you mean: 

Or statement in Filters

former_member424792
Participant
0 Kudos

I cannot get an or statement to work in my filters. I am using Crystal Reports 2011, I need to look at 3 different tracking obligations. If Abstracting_1 = 'Closed' (I want the data to show on the report) OR if Abstracting_2 = "Closed" (Show data) OR Abstracting_3 = "Closed" (Show data) . HOwever when I use this is the filters it is only showing data for whichever statement is first.

Thanks for the help in advance,

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Matt,

Is this the only filter in the selection formula?

Are there any more AND statements?

-Abhilash

former_member424792
Participant
0 Kudos

I ended up figuring it out using a If True statement:

If Abstracting_1 = "Closed" then True else

If Abstracting_2 = "Closed" then True else

Abstracting_3 = "Closed" then True


But thank you for the reply, if you see an issue with this please let me know.

abhilash_kumar
Active Contributor
0 Kudos

That is the same as writing:

(Abstracting_1 = "Closed"  OR Abstracting_2 = "Closed" OR Abstracting_3 = "Closed")


and probably more efficient too, as CR sometimes does not seem to translate if else statements to where clause.

-Abhilash

former_member424792
Participant
0 Kudos

What is more efficient that way I did it or how you are suggesting?

abhilash_kumar
Active Contributor
0 Kudos

The OR statements.

-Abhilash

former_member424792
Participant
0 Kudos

This is not working I switched to an OR statement as you suggested and I am not picking everything up. Here is my filters for the report:

IsNull({TITLE_OPINION_MASTER_VW.SR_REVIEW_STATUS}) and

{TITLE_OPINION_MASTER_VW.CLIENT_MATTER_NUMBER} = "265155.50001" and

{TITLE_OPINION_MASTER_VW.STATUS} = "Active" and

({DD_TRACKING.SJ_FULLAB_STATUS} = "Closed" or

{DD_TRACKING.AUA_UPT_RVW_STATUS} = "Closed" or

{DD_TRACKING.FILE_RVW_STATUS_1} = "Closed")

So for the OR statement I have that in its own ()

Thanks

former_member424792
Participant
0 Kudos

I really need to get an answer to this today if you are able to get back to me. I did the OR statement as you suggested and it is only looking at the first "Closed" and not all 3.

Thank you,

abhilash_kumar
Active Contributor
0 Kudos

Are there NULL values?

Could you select 'Default Values for Nulls' from the drop-down in the formula editor?

-Abhilash

former_member424792
Participant
0 Kudos

I can select that from drop down when I enter the formula, could that cause it not to work properly?

abhilash_kumar
Active Contributor
0 Kudos

If there are NULL values in any of those fields you've used in the selection formula, then the formula stops execution, unless 'Default Values for Nulls' is selected or NULLs are explicitly handled using the isNull function.

-Abhilash

former_member424792
Participant
0 Kudos

It is always something small that I overlook or do not know about. Thank you as always.

Answers (0)