cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lcpaul41
Level I

How to connect check boxes to data output with dashboard?

Wondering how I can filter which data gets plotted based on Checkboxes in a dashboard? 

For example below, selected options would result in the chart displaying Apple and Orange data, and omit anything with Banana or Pear.

lcpaul41_1-1678120392391.png

 

lcpaul41_0-1678120267875.png

 

1 REPLY 1
jthi
Super User

Re: How to connect check boxes to data output with dashboard?

There are quite a few options depending on your application, below are few:

Easiest option would most likely be to use Data Filter

jthi_0-1678135176124.png

 

Other option could be to use << Set Function which you could script to Hide and Exclude correct rows in your data table

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Summarize(dt, uniq_names = by(:Name));

nw = New Window("",
	h list box(
		Check Box(
			uniq_names,
			<< Set Function(function({this},
				sel_names = (this << get selected);
				// row state 6 is hide and exclude
				rows_to_hide = dt << Get Rows Where(Contains(sel_names, :name));
				m = J(1, NRows(dt), 6);
				m[rows_to_hide] = 0;
				dt << Set Row States(m);
			))
		),
		gb = Graph Builder(
			Size(528, 456),
			Show Control Panel(0),
			Variables(X(:weight), Y(:height)),
			Elements(Points(X, Y, Legend(5)), Smoother(X, Y, Legend(6)))
		)
	)
);
-Jarmo