One way is to mimic the desired local data filters using local column transforms, i.e. use a formula to conditionally exclude data. And then apply the column switcher to the "transformed" columns.
Example (JMP 14):
Data Table("jmp question 2.jmp") << Graph Builder(
Size(542, 442),
Show Control Panel(0),
Variables(
X(:Name("Time (hr)")),
Y(:Name("Impurity (pg)")),
Overlay(
Transform Column(
"pH at Temp=23°C",
Formula(If(:Name("Temperature (°C)") == 23, :pH))
)
)
),
Elements(Points(X, Y, Legend(15)), Line(X, Y, Legend(16))),
Column Switcher(
Transform Column(
"pH at Temp=23°C",
Formula(If(:Name("Temperature (°C)") == 23, :pH))
),
{Transform Column(
"pH at Temp=23°C",
Formula(If(:Name("Temperature (°C)") == 23, :pH))
), Transform Column(
"Conc at Temp=37°C",
Formula(
If(:Name("Temperature (°C)") == 37,
:Name("Concentration (U/mL)")
)
)
), Transform Column(
"Temp at pH=8 & Conc=90 U/ml",
Formula(
If(:pH == 8 & :Name("Concentration (U/mL)") == 90,
:Name("Temperature (°C)")
)
)
)}
),
SendToReport(
Dispatch(
{},
"Time (hr)",
ScaleBox,
{Min(-1), Max(35), Inc(5), Minor Ticks(0)}
),
Dispatch(
{},
"Impurity (pg)",
ScaleBox,
{Scale("Log"), Format("Scientific", 12), Min(5), Max(800000), Inc(1),
Minor Ticks(1)}
),
Dispatch({}, "Graph Builder", FrameBox, {Marker Size(6)})
)
);