Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

data model help needed

 I have 3 tables,  customer,  customer_transaction_details,   vendor  

 

customer  - > customer_transaction_details    --- 1 to many  on  customer_ID 

customer  -> vendor     --  1 to many    on customer_ID 

customer_transaction_details  ->  vendor   -- many to many on   - customer id  columns

 

i want to build a report with dimensuon slicers as   vendorId, customer id, 

how do i build data model for this?  

3 Replies

  • Daniel29195's avatar
    Daniel29195
    Community Champion

    Anonymous 

    im confused . 

    shouldn't you have vendor id in the fact transaction table ? 

     

    thus your model should be : 

    vendor to transaction details --> 1 to many 

    customer to transaction details --> 1 to many .

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      vendor_id is not in the transcation_details table, because transcarion is at the customer level only.

  • Daniel29195's avatar
    Daniel29195
    Community Champion

    Anonymous 

    im not aware of your model in total , but 1 possible solution is : 

    customer -- >  1 to many to transaction table 

    customer -->  1 to many to vendor .

    activate bi directional filter on the relation between customer and vendor  (  i would suggest reading about bi directtional filter before going through this solution , to know if it suits your model and wont introduce ambiguity later ) . 

    this way, filter from vendor propagates toward transaction details via the customer table .

     

     

    so example, 

    if you have vendor  1 linked to c1,c2,c3,c4 

    if you filter on v1,  the vendor table filter willl propagate towards the customer table and filters customer on 

    c1,c2,c3,c4

    then customer table's filter will propagate towards transaction and thus you can get the transactions per these 4 customers which are linked to the vendor 1 . 

     

     

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up πŸ‘ and mark it as the solution βœ…
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! πŸ€