Sorry, still not clear. I suggest to write out the rules. Or write out the logic for each record.
For the first record, SHEE34, their manager is DAVID. The Access UIDs are for SHEE34, their manager, and lead staff ID.
Same rule for the second record.
For the third record, DAVID22, both SHEE34 and ANJ343 are included in Access UIDs, I guess because David is there manager.
What would the row for Kay look like?
What would the row for Kay's manager look like?
How many levels of nesting are there?
BASUG is hosting
free webinars ! Check out recordings of our past webinars:
https://www.basug.org/videos. Save the date for our
in person SAS Blowout on Oct 18 in Cambridge, MA. Registration opens in September.