IN operator form to check belonging to hierarchy
You can check if a catalog belongs to specific hierarchy. IN HIERARCHY operator will return TRUE if the left-side expression value is a reference to a catalog item and is included in the right-side value array or hierarchically belongs to some group which is included in this array:
Example:
// As the Group parameter query receives reference
// to some Nomenclature catalog group.SELECT
Catalog.Nomenclature.DescriptionWHERE
Catalog.Nomenclature.Ref IN HIERARCHY (&Group)
Query result can act as a value array that is checked for matching. In that case you need to specify a query description to the right of IN operator.
Example:
SELECT
Catalog.Nomenclature.DescriptionWHERE
Catalog.Nomenclature.Ref IN HIERARCHY
(
SELECT
Catalog.Nomenclature.Ref
WHERE
Catalog.Nomenclature.Description = "Clothes"
)