First, both your category and sub-category should have references to them from the context (data view) entity.
Next, create a second reference selector for sub-category.
On that second selector, look in the "Selectable Objects" tab for the "Constrained By" option. One of the XPaths selectable in the "Constrained By" list will achieve your goal..