Forum Discussion

Hansss's avatar
Hansss
Frequent Visitor
4 years ago

Products with combinations

Hi!

I run a webshop at www.drakfisken.se. It's based on Prestashop 1.7.

I'm a newbe trying to create some Power BI reports.

 

Let's say I sell a red T-shirt in my shop. Prestashop database has a structure with a Product-table (containing most product information such as prices, EAN and more).

But I sell this red T-shirt in S, M, L sizes. Prestashop also has a Product-attribute-table containing similar information as the product table. Some of the information here is unique but some is also related to the Product table. Such as the price for Size S = -1, Price for size L = +1 compared to product table.

 

My problem is that when I try to combine these two I get four combinations. I get:

1. Red shirt
2. Red shirt Size S
3. Red shirt Size M
4. Red shirt Size L

 

Any advice on how to combine/join these 2 dimensions in the best way? Or question so I can explain it in a better way?

 

//Hans

2 Replies

    • Hansss's avatar
      Hansss
      Frequent Visitor

      First you can see the product table. Product with id_product 1100 has no variants. The EAN and price is on the product level.

      Then you can see that id_product 1100 does not exist in the product attribute table since it has no variants.

      Product id_product 1102 exists in both product and product_attribute table since it has variants. The information such as price and EAN is stored on variant level in the product_attribute table. The information in the product table is useless when there are variants.

      What I would like to create is ONE table with products with and without variants.

      id_product id_product_attribute  ean13price
      1001null4260507580030188
      1102504260507580276312
      1102514260507580283524
      110228434260507580269172

       

      This information I would then be able to match in good way with the price lists with EAN13 from the suppliers.