"AND NOT" in a query?
Goal: a query of all stories with either no children or no valid children. "No children" is easy, "no valid children" not so much.
I need the operator "AND NOT", however, that doesn't exist. Is there a way to tweak the existing language to result in the equivalent of "AND NOT"?
There is no way to query for "ALL children are invalid". If I query for the status of children, it will return true if only one child is invalid, regardless of other children. Thus what I need is to query for child status is not invalid (and therefor valid) - if only one child is not invalid (and thus valid) it will return true. However, that's when I DON'T want the story to appear in my query, thus the need for "AND NOT". Switching from "child status is not invalid" to "child status is anything else" (all but invalid are checked) still leaves me in the same predicament.
Any ideas how to do this with existing operators?
I need the operator "AND NOT", however, that doesn't exist. Is there a way to tweak the existing language to result in the equivalent of "AND NOT"?
There is no way to query for "ALL children are invalid". If I query for the status of children, it will return true if only one child is invalid, regardless of other children. Thus what I need is to query for child status is not invalid (and therefor valid) - if only one child is not invalid (and thus valid) it will return true. However, that's when I DON'T want the story to appear in my query, thus the need for "AND NOT". Switching from "child status is not invalid" to "child status is anything else" (all but invalid are checked) still leaves me in the same predicament.
Any ideas how to do this with existing operators?
3 answers
Hi Mike,
I have no solution for that. This would require nested subqueries and operators like "For All" or "Exists". As far as i know the query mechanism there is is not that smart today. Like most of those it can't handle inner joins. I have filed a work item for it some time ago. Here is a similar one that is more recent: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=165456 you could support one of the open ones.
I have no solution for that. This would require nested subqueries and operators like "For All" or "Exists". As far as i know the query mechanism there is is not that smart today. Like most of those it can't handle inner joins. I have filed a work item for it some time ago. Here is a similar one that is more recent: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=165456 you could support one of the open ones.
Funny - that's not exactly what I was referring to, but I have posted about that same thing in the past, so I added my support to your ticket. They are two approaches to the same thing. This item is specifically at the AND/OR set level. Currently AND means "AND IS" and I want to add "AND IS NOT". I posted a ticket for it:
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=178802
It could be used to accomplish the same thing. I am hoping that being very specific about what is likely an easy addition will help move it forward.
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=178802
It could be used to accomplish the same thing. I am hoping that being very specific about what is likely an easy addition will help move it forward.
Mike,
I have thought about several potential solutions. IS NOT is an approach but it is to some extend limited and would not solve other issues. The restrictions of the query capability I have experienced where almost always related to relationships or transitive relationships.
I would definitely support that there is a need for more complex query capabilities. One answer could be using RRDI (Rational Reporting for Developer Intelligence) which should be more capable and can be used in dashboards. This is however not running in queries and does not run on life data either.
I have thought about several potential solutions. IS NOT is an approach but it is to some extend limited and would not solve other issues. The restrictions of the query capability I have experienced where almost always related to relationships or transitive relationships.
I would definitely support that there is a need for more complex query capabilities. One answer could be using RRDI (Rational Reporting for Developer Intelligence) which should be more capable and can be used in dashboards. This is however not running in queries and does not run on life data either.