Using AND and OR
I want to build a search that says give me all items where (FollowUp = yes and there is no DueDate) OR (FollowUp = Yes and Due date is less than or equal to TODAY). Can this be done? I don't see how to construct it without parenthesis.
Thanks |
Yes this can be done, basically indenting in the Search Criteria Grid (in the Advanced Search interface) provides the equivalent of parantheses.
All rows at the same indent level have the same precedence (are grouped together). So to group certain criteria together, simply indent them to the same indent level. You can indent with the arrow keys in the Item Toolbar or the Move Up/Down/Left/Right entries in the Item menu... |
Got it working but it's not obvious to me. How would you read this with parens?
------FollowUp=yes AND Parent Title <> TEMPLATES ------OR DueDate="" ------OR DueDate>=TODAY What confuses me is that first OR. I switched it to an AND and got the same results. The first AND/OR of an indent is irrelevant? |
If I correctly understand the 1st, 3rd and 4th rows to be indented one level, the following should be the boolean logic employed:
ParentTitle <> TEMPLATES AND (FollowUp=yes or DueDate="" or DueDate>=TODAY) |
I did not do a good job posting that. 1st and 2nd line are not indented and line 3,4 are indented 1 to the right. I need to show AND but those two first lines are not indented.
Here it is again: --------FollowUp=yes AND --Parent Title <> TEMPLATES ---------------OR DueDate="" ---------------OR DueDate>=TODAY |
In that case, the logic used by the search would be:
(FollowUp=yes AND ParentTitle <> TEMPLATES) OR (DueDate="" OR DueDate >= TODAY) which is the logical equivalent of: (FollowUp=yes AND ParentTitle <> TEMPLATES) OR DueDate="" OR DueDate >= TODAY You initially said you wanted to achieve this: "... where (FollowUp = yes and there is no DueDate) OR (FollowUp = Yes and Due date is less than or equal to TODAY)". To obtain this logic you should construct your search like this: FollowUp=yes AND DueDate ="" OR AND or the similar (but equivalent) FollowUp=yes AND OR OR The AND or OR for the first row at a new indent level determines how the expression represented by that indent level is evaluated related to the other indent levels... Hope that helps. [We'll work on the help file to try to make this clearer for future users!] Note: The last suggestion also handles the situation where a Followup attribute is assigned (to an Info Item), but no DueDate attribute is even assigned (not sure if this is necessary for your data or not). |
Thanks Kevina,
1. Two things, The first OR/AND after the indent I don't think works as you stated. I think it is always an AND even if you set it as an OR. I did some tests and changed it to and OR and that should have given me many more results but it gave me the same results as an AND. 2. Most people are going to be confused by this indenting scheme to set up logic. I think if you insert parenthesis into the builder as you indent it might make is easier or just use the space below the tree to show a classic logic expression of what the tree will end up doing. I did not even look in the help because it never occurred to me that indentation might be possible. |
You are correct that an OR relationship of the first criteria row of an indent level is not honored as I explained.
This is a bug and will be addressed in the upcoming minor release. Thanks for reporting it. |
Version 1.3 of Ultra Recall has been released, which fixes this reported bug.
|
Thanks!!
|
All times are GMT -5. The time now is 07:14 PM. |
Copyright © 1999-2023 Kinook Software, Inc.