I am trying to create permutations of data, but having trouble finding a way to do so… spent hours researching so far. I will explain with an example.
Let’s say I have 2 Data Types: Materials and Colors
In Materials, I have the following 3 “Things”: Polyester, Wool, Leather.
Each of these 3 Materials has a “list of things” field called Variations.
- For Polyester Variations, there is “polyester, polyester blend”.
- For Wool Variations, there is “wool, wool blend”.
- For Leather Variations, there is “bonded leather, leather, full grain leather”.
In Colors, I have the following 4 “Things”: Red, Blue, Purple, Pink
Each of these 4 Colors has a “list of things” field called Variations.
- For Red Variations, there is “Red, Maroon”
- For Blue Variations, there is “Light Blue, Royal Blue, Navy”
- For Purple Variations, there is “Purple, Lavender, Burgundy”
- For Pink Variations, there is “Light Pink, Magenta”
When a combination of Materials and Colors is specified, I would like to create combinations of the “Variation” fields from the Materials and Colors tables.
So let’s say the specified combination is {Color} x {Material}. I want to see all combinations of {Color} x {Material} where {Color} = Purple and {Material}= Wool.
In this example, the desired output would be:
- Purple Wool
- Purple Wool Blend
- Lavender Wool
- Lavender Wool Blend
- Burgundy Wool
- Burgundy Wool Blend
Any ideas on how to do this? Basically I’m trying to figure out a way to create combinations/permutations of text strings. It’s like an iterative version of a basic concatenation.