Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi All,
Can you all please help me out in how to create a query for the below mentioned points:
- Identifies any item in a document which as
§ Sub-items i.e. the contains relationship has some requirements
§ AND The category is not heading
o OR
§ Sub-items i.e. the contains relationship has some requirements
§ AND The formatting is not any heading
o OR
§ The category is heading
§ AND The formatting is not any heading
o OR
§ The category is not heading
§ AND The formatting is any heading
Hello Prateek Patil,
I'm not sure about the order of operations of your query, because they're all in-line and without indentation, but I'll try to address how to generate each of your clauses:
Can you all please help me out in how to create a query for the below mentioned points:
- Identifies any item in a document which as
Check to see if the field Contained By has any relationships in it: Relationship filter on Contained By: has a relationship.
§ Sub-items i.e. the contains relationship has some requirements
Check to see if the field Containeds has any relationships in it: Relationship filter on Containeds: has a relationship.
o OR
§ Sub-items i.e. the contains relationship has some requirements
Check to see if the field Contained By has any relationships in it: Relationship filter on Contained By field to the Type on the related item being a Requirement.
§ AND The formatting is not any heading
I'm not sure about this one off the top of my head.
o OR
§ The category is heading
Check to see if the field Contained By has any relationships in it: Relationship filter on Contained By field to the Category on the related item being Heading.
§ AND The formatting is not any heading
Again, I'm not sure about this one off the top of my head.
o OR
§ The category is not heading
Check to see if the field Contained By has any relationships in it: Relationship filter on Contained By field to the Category on the related item being any of the values other than Heading (that will be faster than inverting on Heading.
§ AND The formatting is any heading
Yet again, I'm not sure about this one off the top of my head.
Regards,
Kael
Hi Kael,
Thanks a lot for the inputs.
I have created a query assuming that " formatting " means "text field". Please find the image below for the same.
But I am not sure whether I am on the correct path.
Can you please try and let me know about this " formatting is any heading ".
It would be really helpful.
Thanks & Regards,
Prateek
Hello Prateek Patil,
That looks well structured, but not optimized.
The main point of optimization would be to change the not(field[Category] = "Heading") blocks to (field[Category] = <WhiteListOfAcceptableValues>. It's generally a best practice to use positive clauses instead of negative ones, because negative clauses have negative performance implications on the database backend performance. For more information on this and other query best practices, see CS200306.
If it's a relatively small and fast query, it won't make much of a difference, but as the number of potential items to consider goes up, so will the run time of the query.
I hope that helps.
Regards,
Kael