Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?Hi,
I'm looking for help in the Graphic Builder. I am using JMP 16.2.0.
I will use a table with two columns (Recipe, Ingredient) as an example. A recipe is composed of multiple ingredient, and an ingredient can be use in multiple recipes. The table is provided in Attachments.
In the Graph Builder, I put Recipe in Group X, Ingredient in X and choose a Pie Plot to see what ingredient is used in which recipe.

What I would like to do is to select an ingredient and it will keep the pie plots of all the recipes that use the ingredient. The pie plots should show all their ingredients .
For example, I want to see all the recipes that use Milk. If I add a local data filter on the recipe, the pie plot won't display all the ingredients for the Bechamel and Pancake.

What I would like to have as an output is something like this :

Is there an easy way to do that, without writing some JSL ? We can modify the table or work with the Graph Builder.
Thank you !
Data Exploration and VisualizationRe: Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?I'm not sure if you can do this in JMP16 (I'm using JMP18), but you can create multiple response column of your Ingredients


Table attached with table script
Re: Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?Thank you for the reply, this is a great solution indeed.
Unfortunately, it does not work in JMP 16.

I guess we'll need to update to a more recent version !
Re: Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?Scripting is also an option but you said you wish to avoid it, so here is maybe an option which might work in JMP16 (it can be a bit clunky to use due to utilizing selection row state). If you can use Data filter instead of local data filter, you can do something like this
Create formula column like

Col Sum(Selected(), :Recipe) >= 1
Create Data filter (NOT LOCAL DATA FILTER) with ingredient

Create your graph WITH local data filter using your newly created formula column and set the value to 1

You can then collapse the local data filter and organize the windows side by side

One a bit annoying thing here is that there will be a selection and it will mess up if something is selected from the table / outside of data filter.
Re: Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?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 );
);Re: Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?GraphBuilder + Multiple Response : VERY (!) useful!
it got available with JMP17: New in JMP 17 and JMP Pro 17 - Some Highlights ORIGINAL ENGLISH VERSION
the upgrade is free of charge. Maybe take 2 steps and get all the great features of JMP18?
Re: Graph Builder, Pie plot : How to keep all the elements of a group when filtering on groups that have a specific element ?Thank you both @jthi @txnelson for your creative solutions, I will adapt the script to my real data and execute it when needed.
@hogi I will push for a JMP update !
Have a great week !