Forum Discussion

kattlees's avatar
kattlees
Icon for Post Patron rankPost Patron
4 years ago
Solved

Get values from 3 tables into one matrix

I need to get the sum of three columns from two different tables and can't figure out why I'm struggling with it.

 

Tables are: Employees

EmployeeIDLocation
MINN0001Loc1
MINN0001Loc2
SMIT0001Loc1
JONE0001Loc1

 

Table 2: Amt Pd:

EmployeeIDLocationColorDateAmtPd
MINN0001Loc1Green12/31/215.00
SMIT0001Loc1Green12/31/215.00
MINN0001Loc1Blue12/31/2110.00
SMIT0001Loc1Blue12/31/218.00
JONE0001Loc1Green12/31/2112.00
MINN0001Loc2Blue12/31/217.00

 

Table3: Amt Earned

EmployeeIDLocationDateColorAmtEarnedAmtEr     
MINN0001Loc112/5/21Blue2.001.00     
MINN0001Loc112/17/21Blue3.001.00     
MINN0001Loc112/5/21Green7.005.00     
SMIT0001Loc112/17/21Blue3.001.00     
SMIT0001Loc112/5/21Green5.002.00     
JONE0001Loc112/5/21Blue05.00     
           

 

Result I need is a matrix: (Choosing Blue and Loc1)

EmployeeIDLocationDatePdEarnedEr
MINN0001Loc112/31/2110.005.002.00
SMIT0001Loc112/31/218.003.001.00
JONE0001Loc112/31/210.000.005.00

 

Result I need is a matrix: (Choosing Green and Loc1)

EmployeeIDLocationDatePdEarnedEr
MINN0001Loc112/31/215.007.005.00
SMIT0001Loc112/31/215.005.002.00
JONE0001Loc112/31/2112.000.000.00

 

I know I can need to get the end of the month from the paid column but for the life of me I can't figure out how to do the relationships to get the matrix options I need.

  • Hi kattlees 

     

    I add EmployeeLoc columns to all three tables by combining EmployeeID and Location columns. And build relationships on these new columns. Also I add dim tables for colors and locations. Download the attachment below to see details. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

2 Replies

  • smpa01's avatar
    smpa01
    Icon for Community Champion rankCommunity Champion

    kattlees  create separate dimension tables for Location and Color and model the data accordingly. Then bring slicers from those tables.

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi kattlees 

     

    I add EmployeeLoc columns to all three tables by combining EmployeeID and Location columns. And build relationships on these new columns. Also I add dim tables for colors and locations. Download the attachment below to see details. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.