cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Creating a query in MKS

ppatil
4-Participant

Creating a query in MKS

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

3 REPLIES 3

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


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
ppatil
4-Participant
(To:KaelLizak)

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.

Query builder.png

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


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
Announcements


Top Tags