...
NOTE. Nested groups should reflect the sort order. The outermost group header should be the highest priority sort, and the footer order should be reversed. Find more information on this Understanding Sorting and Grouping.
Sorting By Formula
To sort and group by information that may not be contained within an individual data field, you can use Formulas. See What are formulas for additional help.
Pressing the button or the Formula Editor () button opens the Formula Editor window:
...
There are two potential solutions. If there is a relationship between Y and Z, then you can use Advanced Joins to impose additional constraints so that only the rows with both Y and Z are shown. For more information, see Joins.
On the other hand, there may be no relationship between Y and Z, only between X and Y, X and Z. Or there may be a relationship, but it does not matter for this data set. You can use repeating groups to ignore that relationship and simply organize the data by X instead.
...