If you modify the data table with new rows and a new column, I can get it to work in JMP 16. You need to create a new row for each combination of ingredients for each ingredient in the recipe. So for Bechamel which has Milk, Flour and Butter
it has to be expanded to
And here is a script that will generate the expanded data table
names default to here(1);
dt=current data table();
// Start the new table
dtOut = New Table( "Expanded",
New Column( "Recipe", Character ),
New Column( "Ingredient", Character ),
New Column( "Ingredients", Character )
);
// Find the different Recipies
summarize( dt, Recipies = By(:Recipe));
// Loop through the recipies
For Each( {rec}, Recipies,
// Find the ingredients for the current recipe
dt << select where(:Recipe == rec );
dtTemp = dt << subset( selected columns(0), selected rows(1));
summarize( dtTemp, ingre=by(:ingredient));
// Loop across each ingredient and add the rows to the data table
For Each( {item}, ingre,
dtTemp << New Column("Ingredients", character, set each value(item));
dtOut << concatenate( dtTemp, Append to First Table(1) );
dtTemp << delete columns(:Ingredients);
);
close( dtTemp, nosave );
);
Jim