Skip to main content

I'm trying to extract all unique combinations of a given datamodel. 

 

For example:

Table 1.

FRUIT	COLOR	TYPE
Apple Green Kanzi
Yellow Jonagold
Red Elstar
Golden Fuji
Pink Golden Delicious
Royal Gala

With this given datamodel, I can make 30 unique combinations.

Like this:

Table 2.

FRUIT	COLOR	TYPE
Apple Green Kanzi
Apple Green Jonagold
Apple Green Elstar
Apple Green Fuji
Apple Green Golden Delicious
Apple Green Royal Gala
Apple Yellow Kanzi
Apple Yellow Jonagold
Apple Yellow Elstar
Apple Yellow Fuji
Apple Yellow Golden Delicious
Apple Yellow Royal Gala
Apple Red Kanzi
Apple Red Jonagold
Apple Red Elstar
Apple Red Fuji
Apple Red Golden Delicious
Apple Red Royal Gala
Apple Golden Kanzi
Apple Golden Jonagold
Apple Golden Elstar
Apple Golden Fuji
Apple Golden Golden Delicious
Apple Golden Royal Gala
Apple Pink Kanzi
Apple Pink Jonagold
Apple Pink Elstar
Apple Pink Fuji
Apple Pink Golden Delicious
Apple Pink Royal Gala

I made table 2 in excel with copy and pasting. The real dataset that I have has alot more columns and values. Therefore I would like to automate this proces in FME.

 

How can I transform table 1 to table 2?

Whilst it's probably possible to do this in FME with your example, I'm not sure it would scale up very well. You might be able to do something with the inline querier, itertools in a pythoncaller is probably the way to go though


A simple example based on your sample input

 Capture


A simple example based on your sample input

 Capture

Amazing, will try this out! Thanks alot!


@wereldbol​  if, like me, you're not a strong python developer, you should be able to accomplish thi with a couple of FeatureJoiners. Not nearly as elegant or flexible as @ebygomm​ 's python.


Reply