Hi All, I am a first-time poster in need of guidance please.
I have created a BAQ which shows all open releases for a given part number. This works fine. However, our company uses multi-level BOM’s. I need to amend the BAQ so that if a user searches a MaterialPart, the query will return not only releases for the MaterialPart, but also any releases for the ParentPart (and only the very top-level parent part not any of the sub-assemblies).
I have built a separate query which can give the top-level part for a given material part (using a CTE). My plan was to use the results of this query and somehow bring in all releases for those parts too (haven’t worked that bit out yet). But when I try to insert it into my initial query it fails because it contains a Union All which is different to the Union All in the first query.
Is it possible to have two different union all’s in the same BAQ?
Am I going about this the wrong way?
Did you find it? If not… in the BAQ Studio… use the upper right-hand 3-dot menu and choose “Query Reference”.
Click the “New” (plus) icon and search for the BAQ you want to add into the main query. Once added, it will now show up if click on the (Sub)Queries tab in the upper right:
You can double click on it there and it will be added the query currently open on your designer workspace.
Connect the reference query to your desired table, adjust the join, etc.
This is also great and would solve my problem. So, if I understand you correctly, I can separate out one Union all from another so there is no conflict?