Hello everyone...hope all is well....so I recently went from ACCESS to SQL in trying to accomplish my task. Problem is I never used SQL before and it's going very slow....I had help writing a query/script that solved my previous learning curve, but no need to figure it out in SQL and language/terms are a tad different. I still learning a bit everyday, but have a long road ahead of me.
I will do my best to explain steps and end result desired or you can view previous thread here...https://www.access-programmers.co.uk/forums/threads/facet-query-in-access.312597/
First the table below creates the price_facet field using the price field of each record. Using the price it looks up the price and returns the Description in the price_facet field.
MAPPING_PRICE_FACET
The configurable product type does not exist at first and is created after the simple product type (price_facet) is created.
Using the table above and a lookup function??? it would return the correct price_facet. that would be step one. Step two is to then create the configurable Product type using the SKU. SKU is primary key. Using grouping???? the first two parts of the SKU creates the configurable SKU and grouping all the various price_facets will give you the Price_facet configurable value.
So the configurable record doesn't exist in the table above in the beginning. It is created after the price_facet is created using the price field. A new record with product type configurable needs to be created and added to the table to distinguish it as the "Parent" record and the simple are all the "children" that belong to that parent. The first two parts of the SKU identifies which simple records are to be grouped.
I hope someone gets the concept. I hope someone can write the function in a basic SQL language so a beginner such as myself can look at it and decipher the steps/key words and steps to figure out this task.
Thanks
I will do my best to explain steps and end result desired or you can view previous thread here...https://www.access-programmers.co.uk/forums/threads/facet-query-in-access.312597/
First the table below creates the price_facet field using the price field of each record. Using the price it looks up the price and returns the Description in the price_facet field.
MAPPING_PRICE_FACET
ID | Min | Max | Description |
---|---|---|---|
1 | -999 | 99.99 | Under $100 |
2 | 100 | 249.99 | $100 - $250 |
3 | 250 | 499.99 | $250 - $500 |
4 | 500 | 749.99 | $500 - $750 |
5 | 750 | 999.99 | $750 - $1000 |
6 | 1000 | 999999999 | $1000 & Above |
The configurable product type does not exist at first and is created after the simple product type (price_facet) is created.
Using the table above and a lookup function??? it would return the correct price_facet. that would be step one. Step two is to then create the configurable Product type using the SKU. SKU is primary key. Using grouping???? the first two parts of the SKU creates the configurable SKU and grouping all the various price_facets will give you the Price_facet configurable value.
SKU | PRICE | PRICE_FACET | PRODUCT TYPE |
Z1009 A431 | 64.45 | Under $100|$100 - $250|$500 - $750|$250 - $500|$1000 & Above | configurable |
Z1009 A431 024036 EC | 64.45 | Under $100 | simple |
Z1009 A431 024060 EC | 85.8 | Under $100 | simple |
Z1009 A431 024072 EC | 99 | Under $100 | simple |
Z1009 A431 024096 EC | 130.35 | $100 - $250 | simple |
Z1009 A431 030120 EC | 214.5 | $100 - $250 | simple |
Z1009 A431 036060 EC | 173.25 | $100 - $250 | simple |
Z1009 A431 048072 EC | 207.9 | $100 - $250 | simple |
Z1009 A431 060096 EC | 334.95 | $250 - $500 | simple |
Z1009 A431 072108 EC | 460.35 | $250 - $500 | simple |
Z1009 A431 096120 EC | 660 | $500 - $750 | simple |
Z1009 A431 120168 EC | 1146.75 | $1000 & Above | simple |
So the configurable record doesn't exist in the table above in the beginning. It is created after the price_facet is created using the price field. A new record with product type configurable needs to be created and added to the table to distinguish it as the "Parent" record and the simple are all the "children" that belong to that parent. The first two parts of the SKU identifies which simple records are to be grouped.
I hope someone gets the concept. I hope someone can write the function in a basic SQL language so a beginner such as myself can look at it and decipher the steps/key words and steps to figure out this task.
Thanks