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

How to build a two-level "where used" query with Query Builder

rvonstaden
1-Newbie

How to build a two-level "where used" query with Query Builder

I can get some basic queries working using Query Builder, but much of it is still a matter of much trial and error for me. I am trying to build a query which will give me results on the following structure:

structure.png

The structure has three levels: Caring Unit, Structure and Member, all of which are custom Parts. I can get a report which will give me Caring Unit and Structure combinations, or Structure and Member combinations, but not all three. I am trying to answer the question, "For each member inside a shelter inside a caring unit, what are the attributes of the member, shelter and caring unit?"

Here are the two queries I have working so far. What must I do to combine them and get data on all three levels?

Members in Shelters:

from1.PNG

join1.PNG

Shelters in Caring Units:

from2.PNG

join2.PNG

4 REPLIES 4
TomU
23-Emerald IV
(To:rvonstaden)

I think you need to use a sub-select and then the results of that get joined against one of the other criteria. You should be able to find what you need somewhere on this page: Resource for reporting

Rudi,

like Tom said you can use sub-select to filter your report but, as far as I know, you can't get a multilevel report using query builder.

Marco

Thanks Tom, Marco,

My understanding of sub-select is that I wouldn't be able to use it to get the kind of report that I want. I would like a report which gives, say, Caring Unit Number, Shelter Number, Member Number, Member Name where Member is contained in Shelter and Shelter is contained in Caring Unit. Limited testing would seem to bear this out, or I'm not skilled enough with sub-selects to figure out how to do it.

So, if I can't get this report with Query Builder, what other options do I have? Info*Path? Custom jsp?

Query-Tree webject within an IE task gets all children in structure. Following may help in your case.

<ie:param name="DIRECTION" data="uses" />
<ie:param name="MODE" data="NESTED" />

http://www.ptc.com/cs/help/windchill_hc/wc102_hc/index.jspx?id=WC_WebjectLib_QueryTree&action=show

Top Tags