Forum Discussion

MokaSatya's avatar
MokaSatya
Icon for Microsoft Employee rankMicrosoft Employee
7 years ago

OR 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)

 

 

1 Reply

  • MokaSatya Please share data in excel using onedrive/google drive to get your answer quickly. Remove any sensitive information before sharing and also what your expected output is.