bvanstarkenburg
New Member
- Joined
- Jun 28, 2017
- Messages
- 1
At my work I have two databases with the same products. The first database contains all the products with all possible combinations (in this istance the database consists of motor exhausts, which are available in different colors and materials). The second database only contains the base product. The product ID of the combinations correspondences with the ID of the base products. The database with the base products also contains a lot of information about the products.
Sample data combinations
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">- Product ID - Reference number
1.12012 E3A02ET7
2.12012 E3A02EN7
3.12013 E3A02ES6
4.12014 E9A03ES
5.12014 E9A03EN
</code>Sample data base
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">- Product ID - Name - Price - Reference number
1.12012 Gilera Fuoco €363 E3A02ET
2.12013 Gilera Nexus €363 E3A02ES
3.12014 Gilera Runner €363 E9A03EN
</code>Prefered output
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">- Product ID - Name - Price - Reference number
1.12012 Gilera Fuoco €363 E3A02ET7
2.12012 Gilera Fuoco €363 E3A02EN7
3.12013 Gilera Nexus €363 E3A02ES6
4.12014 Gilera Runner €363 E9A03ES
5.12014 Gilera Runner €363 E9A03EN
</code>Since I want to upload every product to my webshop, I need to format the combinations database in the same way as the base product database, with all the useful information. The way I want to do this, is to use a macro that only copies the combinations product reference number, with the entire base product row, if the combinations product's ID matches the base product's ID. Since a lot of combinations products match the same base product's ID, the macro needs to copy the data multiple times. Also, the combinations database has information about the exhaust's material and color in another colon (I exluded it to make my sample database less messy.). If it's possible, I want to add this information to the product name.
Much obliged,
B. van Starkenburg
(Cross-linked from stack overflow.)
Sample data combinations
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">- Product ID - Reference number
1.12012 E3A02ET7
2.12012 E3A02EN7
3.12013 E3A02ES6
4.12014 E9A03ES
5.12014 E9A03EN
</code>Sample data base
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">- Product ID - Name - Price - Reference number
1.12012 Gilera Fuoco €363 E3A02ET
2.12013 Gilera Nexus €363 E3A02ES
3.12014 Gilera Runner €363 E9A03EN
</code>Prefered output
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">- Product ID - Name - Price - Reference number
1.12012 Gilera Fuoco €363 E3A02ET7
2.12012 Gilera Fuoco €363 E3A02EN7
3.12013 Gilera Nexus €363 E3A02ES6
4.12014 Gilera Runner €363 E9A03ES
5.12014 Gilera Runner €363 E9A03EN
</code>Since I want to upload every product to my webshop, I need to format the combinations database in the same way as the base product database, with all the useful information. The way I want to do this, is to use a macro that only copies the combinations product reference number, with the entire base product row, if the combinations product's ID matches the base product's ID. Since a lot of combinations products match the same base product's ID, the macro needs to copy the data multiple times. Also, the combinations database has information about the exhaust's material and color in another colon (I exluded it to make my sample database less messy.). If it's possible, I want to add this information to the product name.
Much obliged,
B. van Starkenburg
(Cross-linked from stack overflow.)