Reporting : Better boolean condition on filters | Community
Skip to main content
TIT0S
August 2, 2023
New

Reporting : Better boolean condition on filters

  • August 2, 2023
  • 3 replies
  • 614 views

Currently to do a boolean condition like this : A and B and (C or D)

We need to have : A and B and C OR A and B and D

 

It can quickly become misleading with increasing conditions, so would it be possible to add parenthesis or something similar to encase some filters together without interfering with others ?

To simplify, would it be possible to be able to create filters with this: A and B and (C or D) ?

3 replies

RandyRoberts
Community Advisor
Community Advisor
August 3, 2023

That would be a cumulative condition. In Javascript it's:

if (A === 1 && B === 1 && (C === 1 || D === 1)) {
  A & B are true & either C or D is true
} else {
  Either A or B is not true or C and D is not true
}

Python is similar:

if A == 1 and B == 1 and (C == 1 or D == 1):
    print("The condition is True.")
else:
    print("The condition is False.")

 The if statement checks three conditions:

  1. A == 1: A is equal to 1.
  2. B == 1: B is equal to 1.
  3. (C == 1 or D == 1): Either C is equal to 1 or D is equal to 1.

For the provided values, A and B are both equal to 1, and D is also equal to 1. So, the overall condition will be True, and it will print "The condition is True." If any of the conditions are not met, it will print "The condition is False."

TIT0S
TIT0SAuthor
August 3, 2023

Thanks @randyroberts !

You did cleanly reformulate what I wanted to do with filters of reports in Workfront !

 

But I meant was that actually it's not possible to create those cumulative conditions with the interface of Workfront's filters.

You did used JavaScript and Pythons as example but my idea was to impement this function directly inside WorkFront filters without passing by the text mode !

RandyRoberts
Community Advisor
Community Advisor
August 3, 2023

That's correct. You cannot do this with text mode or the filter "wizard".

I showed this example to make it known that most other languages have this feature and to let folks know exactly what is being requested.