Forum Discussion

s_kula's avatar
s_kula
Helper I
3 years ago

Modeling and relation

Hello, I have a problem with the dimensions. navigate the product ID more precisely.
I have product databases in different structures.
The warehouse program groups products according to the order number, e.g. 256, 452, 526, etc.
Unfortunately, I also have products that have variants, e.g.
125-1, 125-2, 125-3.

The product table connects to various fact tables (e.g. cost tables), which show data for SKU 125 without dividing them into variants.
How to properly build the model so that the data is shown in the variant dimension.

I have a relationship at the moment

product table(sku with variant) -> cost table(sku without variant)

Unfortunately, as a result of this, the costs are not correctly overwritten to all skus.

How to solve this problem, first of all how to build relationships correctly? Can the problem of attributing costs to SKUs be attributed proportionally using a measure?

3 Replies

    • s_kula's avatar
      s_kula
      Helper I

      Thank you for the information, I have read the guidelines but I still do not understand exactly how to create an association key to be able to link products with costs.
      If I create a column sku2 in the product table and link it with the sku from the cost table in which there will be items without variants, the relation will have a many-to-many condition, and this will not be good.

       

      product table

      sku    sku2

      1018-11018
      1018-21018
      1018-31018
      1019-11019
      1019-21019
      1019-31019
      1037-11037
      1037-21037
      106-1106
      106-2106
      106-3106
      106-4106
      106-5106
      1079-11079
      1079-21079
      1088-21088
      1154-11154
      1154-21154
      116-1116
      116-2116
      116-3116
      116-4116
      116-5116
      116-6116
      117-1117
      1179-11179
      1179-21179
      1179-31179
      1179-41179
      1184-11184
      1184-21184
      1184-31184
      1203-11203
      1203-21203
      1204-11204
      1204-21204
      1205-11205
      1205-21205
      1205-31205
      1205-41205
      1209-11209
      1209-21209
      1223-11223
      1223-21223
      1223-31223
      1225-11225
      1225-21225
      1225-31225
      1233-11233
      1238-11238
      1238-21238
      1238-31238
      124-1124
      124-2124
      125-1125
      126-1126
      1267-11267
      1267-21267
      1267-31267
      1268-11268
      1268-21268
      1270-11270
      1270-21270
      1270-31270
      127-1127
      128-1128
      129-1129
      1302-11302
      1302-21302
      133-1133
      133-2133
      133-3133
      1337-11337
      1337-21337
      1337-31337
      1337-41337
      1337-51337
      1338-11338
      1338-101338
      1338-21338
      134-1134
      134-2134
      134-3134
      1343-11343
      1343-21343
      1343-31343
      1345-11345
      1345-21345
      1348-11348
      1348-21348
      1348-31348
      1349-11349
      1349-21349
      1349-31349
      1349-41349
      1349-51349
      135-1135
      135-10135
      135-11135
      135-12135
      135-13135
      135-14135
      135-15135
      135-16135
      135-2135
      135-3135
      135-4135
      135-5135
      135-6135
      135-7135
      135-8135
      135-9135
      1374-11374
      1374-21374
      1374-31374
      1379-11379
      1379-21379
      138-1138
      138-3138
      138-4138
      138-5138
      138-6138
      1402-11402
      1402-21402
      142-1142
      142-2142
      142-3142
      143-1143
      143-2143

       

      cost table

      sku  cost

      1060,93
      1060,59
      1060,19
      10790,71
      10790,58
      10880,64
      11540,27
      11540,4
      1160,31
      1160,76
      1160,94
      1160,24
      1160,95
      1160,35
      1170,4
      11790,84
      11790,82
      11790,15
      11790,16
      11840,86
      11840,28
      11840,42
      12030,96
      12030,44
      12040,21
      12040
      12050,39
      12050,64
      12050,04
      12050,58
      11790,16
      11790,87
      11840,41
      11840,63
      11840,63
      12030,39
      12030,31
      12040,02
      12040,24
      12050,26
      12050,96
      12050,42
      12050,53
      12090,18
      12090,21
      12230,84
      12230,03

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    You have mutiple of the same values in both tables so it won't connect this way . You could make all the SKU's like 1018-1 and 1018-2 because they will identify all the 1018 SKU different. You should look at creating a key column like the first SKU column to identify each row different.