Expression Builder: AND OR
Expression Builder: AND OR
Hi,
I am trying to create the following:
I want to filter on [Rating Value > 20] AND ( [Filename Contains Test] OR [Artist contains Test])
See screenshot (at least, I think that this should be done like this - I may be wrong).
When I press the Text tab, the text shows me this:
[Rating] > '20' And Contains([Filename], 'Test') And Contains([Artist], 'Test')
However, this seems wrong to me! The expression should check on Artist OR Filename, not AND!
Is this a bug that I run into, or is this my mistake?
I am trying to create the following:
I want to filter on [Rating Value > 20] AND ( [Filename Contains Test] OR [Artist contains Test])
See screenshot (at least, I think that this should be done like this - I may be wrong).
When I press the Text tab, the text shows me this:
[Rating] > '20' And Contains([Filename], 'Test') And Contains([Artist], 'Test')
However, this seems wrong to me! The expression should check on Artist OR Filename, not AND!
Is this a bug that I run into, or is this my mistake?
- Attachments
-
- 2022-05-03_21h41_57.png (6.16 KiB) Viewed 1643 times
Re: Expression Builder: AND OR
Also when pressing OK and then opening the filter again, it removed my OR statement.
- Attachments
-
- 2022-05-03_21h44_54.png (5.14 KiB) Viewed 1642 times
Re: Expression Builder: AND OR
I think your mistake is, that all items (criteria) on the same level use the same logical group condition.
Ie. you might want to move the OR condition one level to the left. Meaning you need to add the OR condition to the previous root node.
In your case you have defined multiple groups, which infact doesn’t make much sense, as each group only containes one single condition.
A logical operator only makes sense, when you have at least two conditions in one group.
Ie. you might want to move the OR condition one level to the left. Meaning you need to add the OR condition to the previous root node.
In your case you have defined multiple groups, which infact doesn’t make much sense, as each group only containes one single condition.
A logical operator only makes sense, when you have at least two conditions in one group.
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
Re: Expression Builder: AND OR
Hi Bernd,
Unfortunately, that does not help.
It transforms the image to the following expression:
[Rating] > '20' And Contains([Filename], 'Armin van Buuren') And Contains([Artist], 'Armin van Buuren')
Whereas it should create something like this:
[Rating] > '20' And (Contains([Filename], 'Armin van Buuren') OR Contains([Artist], 'Armin van Buuren'))
Unfortunately, that does not help.
It transforms the image to the following expression:
[Rating] > '20' And Contains([Filename], 'Armin van Buuren') And Contains([Artist], 'Armin van Buuren')
Whereas it should create something like this:
[Rating] > '20' And (Contains([Filename], 'Armin van Buuren') OR Contains([Artist], 'Armin van Buuren'))
- Attachments
-
- 2022-05-04_12h43_12.png (6.52 KiB) Viewed 1630 times
Re: Expression Builder: AND OR
I think the UI of the Expression Builder is a bit misleading (or I got it twisted in my head).
When I enter this text, it creates the following expression.
[Rating] > '20' And (Contains([Filename], 'Armin van Buuren') Or Contains([Artist], 'Armin van Buuren'))
To me, it looks like Rating > 20 OR Filename AND Artist contains. Might be me though!
Can you confirm this is correct now? This expression does what I want though, thanks!
When I enter this text, it creates the following expression.
[Rating] > '20' And (Contains([Filename], 'Armin van Buuren') Or Contains([Artist], 'Armin van Buuren'))
To me, it looks like Rating > 20 OR Filename AND Artist contains. Might be me though!
Can you confirm this is correct now? This expression does what I want though, thanks!
- Attachments
-
- 2022-05-04_12h44_55.png (6.11 KiB) Viewed 1630 times
Re: Expression Builder: AND OR
This is correct now - look at the brackets, which indicate the group. And this is exactly how I mean it in my text.
Any group only makes sense and as such is evaluated, if at least 2 conditions are included.
Any group only makes sense and as such is evaluated, if at least 2 conditions are included.
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution