Dynamically appending a query (for data entitlements)