Forum Discussion

elliee's avatar
elliee
Frequent Visitor
3 years ago

values duplicated in a join

I'd like to create a KPI chart by joining two tables together (1-* relationship) through an unique identifier that is created based on concatenation of 3 column values. however, when i try to pull both the revenue (from table 1) and targets (from table 2) into the same visual, the targets are being duplicated across all the categories. How can i resolve this?

 

Table 1:

CategoryRevenue Period
Shopping1002022Q4
Travel2002022Q4
Dining3002022Q4

 

Table 2:

CategoryTargetPeriod
Shopping20002022Q4
Travel30002022Q4
Dining40002022Q4
Travel10002022Q3
Dining10002022Q3

 

Expected Outcome:

CategoryRevenue TargetPeriod
Shopping10020002022Q4
Travel20030002022Q4
Dining30040002022Q4

 

What my report is showing now:

CategoryRevenue TargetPeriod
Shopping100110002022Q4
Travel200110002022Q4
Dining300110002022Q4

Error: it is summing up all the targets across all categories and period. how can i prevent this?

2 Replies

  • Hello elliee ,

     

    Try making a seperate table that has the categories only, make a relationship between it and each of the two tables throught the category field.

    Then use this field in the new table to show to show the data in the visuals.

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

     

    Follow me on Linkedin

    • elliee's avatar
      elliee
      Frequent Visitor

      Hi Idrissshatila , I'm using more than just category in the relationship.

       

      For example:

      CategorySub CategoryCustomerRevenue TargetPeriod
      ShoppingAAlice10020002022Q4
      TravelBBen20030002022Q4
      DiningACharlotte30040002022Q4

       

      I'm creating the relationship based on a concatenated field that joins Period, Category, Sub Category and Customer together. I will need the flexibility to report the performance at the different levels.

       

      The option to add as new query is not available when i select all the dimensions used in the relationship. how can i achieve this report please?