cancel
Showing results for 
Search instead for 
Did you mean: 

Include condition with 'AND' operator in Decision table

former_member198721
Participant
0 Kudos

Hi Experts,

My requirement is to  use negation with AND .

for example ,

If commodity code not equals to 100-101-2000 and 101-201-200 than its should give X ,

Like in place of OR can we have AND?

Accepted Solutions (1)

Accepted Solutions (1)

carsten_ziegler
Active Contributor

Code <> 1 and Code <> 2

can be transformed into

Exclude( Code = 1 or Code = 2)

The decision table allows you defining that.

0 Kudos

As usual Carsten is right and knows a shorter solution 🙂

In the UI of the decision table this option is not visible at a first glance, so you have to perform the following steps:

  1. Do the "Direct Value Input" into the cell (opening up with an include condition)
  2. Then insert an exclude condition (which connects to the include condition via "and unless")
  3. Then remove the include condition (which causes the "and unless" to switch to a "not" -> see screenshot below)
  4. Then you can insert a second exclude condition and can enter the logical negation of your condition as shown below
    Code <> 1 AND Code <> 2 becomes Exclude (Code = 1 OR Code = 2)


Logical, but getting it done in the UI is not too intuitve at the first glance

former_member198721
Participant
0 Kudos

This is awesome ...You made my day ..thankyou so much.

former_member198721
Participant
0 Kudos

Thankyou very much

Answers (1)

Answers (1)

0 Kudos

Hi,

the direct value input in decision table supports two options:

  • include conditions that connect the conditions with an OR
  • exclude conditions that connects the conditions with an AND UNLESS

The connection via AND is not available. But you can achieve that by using a boolean expression (which allows you that logical combination) and embed that expression in your decision table

BR

Christian

former_member198721
Participant
0 Kudos

Hi Christian,

Both include and exclude condition cannot work in my case. Can you please elaborate more how to achieve by Boolean expression.

0 Kudos

Hi,

here come the details:

You have to model the condition that you want to use as a Boolean expression as shown in the screenshot below

Within your decision table instead of using the direct value input you assign this expression to the cell in the condition column

When the decision table is evaluated it will delegate to the expression and if it evalutes to true the condition of the cell is met while if it evaluates to flase it is not met.

I attached two screenshots of simulation runs where you can see how the evaluation is done by the system:

Example 1 - Zname = 01-02-000 -> Result = "Result 2"

Example 2 - Zname = 01-02-002 -> Result = "Result 1"

BR

Christian