• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

RE:using AND and OR


Well Known Member
RE:using AND and OR


Here's my two cents...

It seems that the 'OR' only works to seperate groupings of 'AND'

Zoltan is right in that OneWorld will require a much longer set of

Following is my OneWorld Data Selection interpretation of your request..
where (((fieldA = value1 or fieldB = value2) and
(fieldC > value3 and fieldD < value4)) or
((fieldA = value5 or fieldB = value6) and
(fieldC > value7 and fieldD < value8)))


Where FieldA = value1
AND FieldC gt value3
AND FieldD lt value4
OR FieldB = value2
AND FieldC gt value3
AND FieldD lt value4
OR FieldA = value5
AND FieldC gt value7
AND FieldD lt value8
OR FieldB = value6
AND FieldC gt value7
AND FieldD lt value8

Hope this makes some kind of sense....

Sean Gilbert
JDEdwards Consultant

Tel: 514.205.5000 x3619
Fax: 450.655.0163
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any


Legendary Poster
Hi Sean,

At first, thanks for your two cents.
You are right that "that the 'OR' only works to seperate groupings 'AND' statements..." in OneWorld Selections and IF statements.

It seems to me that your example a bit complicated, so I haven't started to verify it (I suppose, it is surely right).

Let me give a bit simplified Boolean algebra lesson:

Notations will be:
Ar1, Br2, ... means: "A","B" - are any Field or left operand of a relation, 'r' - is any relatinal opreand like "euqual", "greather than" etc., 1,2 - is any value or a right operand of a relation

For example:
Ar1 could be: FC AddressNumber "is less than" 1000
The "rule":
AND and OR logical operands in Boolean algebra works the same way like "multiplication" and "addition" operands in mathematic algebra.
The "target":
We have to decompose complicated logical expression to a "normal form" where relations are groupped by AND operands and these "AND" blocks are concatenated with "OR" operands.
The basic step to decompose an OR:
(Ar1 OR Br2) AND Cr3
is in normal form (decomposed):
(Ar1 AND Cr3) OR (Br2 AND Cr3)
...like in mathematic:
(A + B) * C = A*C + B*C
A bit complicated example:
(Ar1 OR Br2) AND (Cr3 OR Dr4)
1st step to decompose:
(Ar1 AND (Cr3 OR Dr4)) OR (Br2 AND (Cr3 OR Dr4))
2nd step and final normal form:
(Ar1 AND Cr3) OR (Ar1 AND Dr4) OR (Br2 AND Cr3) OR (Br2 AND Dr4)
...like in mathematic:
(A + B) * (C + D) = A*C + A*D + B*C + B*D
You can substitute Ar1,Br2...Dr4 in the examples with any "AND concatenated blocks, like:
((Ar1 AND Br2 AND Cr3) OR Dr4 ) AND Er5
in normal form is:
((Ar1 AND Br2 AND Cr3 AND Er5) OR (Dr4 AND Er5)
...like in mathematic:
((A*B*C) + D) * E = A*B*C*E + D*E
P.S.: I used the parentheses in the NORMAL FORMs just to indicate the "AND" blocks.

It were my two cents, maybe could be a some of help for somebody,


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)


Well Known Member
Don't forget in JDE data selection you can use Lists and Ranges for the
value - this opens up the possibilities greatly:

In many cases this removes a lot of OR statements and helps to make it

Also if you have a very complex data selection - your UBE will be very
inefficient - i.e. slow. Try thinking out of the box - add a Category Code,
add an Index on that code and use that. Or use a table join in a business
view to give you an easier data selection.

Data selection is not designed for complex Boolean Algebra, just for giving
a subset of a well defined data set in a report.

OW B732.1 SP11.3.1 (live)
OW733.3 Xe SP 13.1 (dev)
Enterprise Server - Intel NT + Oracle 8.0.6
Client - Citrix TSE + Some 95 and NT PC's