Forum Discussion
MokaSatya
Microsoft Employee
7 years agoOR Logic between Relation Tables
I have Tables: Users, UserPartnerMapping, UserRegionMapping, and Fact_Opportunities
Relations:
Users--> UserPartnerMapping -->Fact_Opportunities
Users--> UserRegionMapping -->Fact_Opportunities
One To Many between Users to Mapping Tables
Implimented Row Based Security on Users Table
Requirement:
Based on user permissions on mapping, expected out put is:
Filter the Fact_Opportunities table with the the records mapped to Partners
OR
Filter the Fact_Opportunities table with the the records mapped to Regions
Here is logic with OR, for example if the User is Mapped to Partner 1 and Region US, i am looking for all the records with Partner 1 irrespective of region and Region with US irrepective of Partners (Union of both results)