<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Selecting data points across plots created from different tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270389#M52642</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;small typo?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(nrows(dtMat)&amp;gt;0  == 0,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(nrows(dtMat)&amp;gt;0 ,&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Jun 2020 07:23:09 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2020-06-03T07:23:09Z</dc:date>
    <item>
      <title>Selecting data points across plots created from different tables</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270362#M52638</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I generate two plots -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Variability plot from a stacked data table (B) [&lt;STRONG&gt;&lt;EM&gt;B is created from a parent table (A)&lt;/EM&gt;&lt;/STRONG&gt;]&lt;/P&gt;&lt;P&gt;2) Bivariate plot created from parent table (A)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These two plots are generated as a report in tabs. The problem I face right now is that since these plots are generated from different tables, points selected on either of the plots do not get selected on the other plot. Is there a way to link these two plots/tables so we can select points from one graph to reflect on the other?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example JSL to do this will help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:01:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270362#M52638</guid>
      <dc:creator>psundar6</dc:creator>
      <dc:date>2023-06-11T11:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data points across plots created from different tables</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270366#M52639</link>
      <description>&lt;P&gt;Here is a way to get one of the charts(the bivariate), to select the values in both charts, but applying the same logic to both charts creates a timing issue.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=current data table("$SAMPLE_DATA/blood pressure.jmp");
dt&amp;lt;&amp;lt;new column("Row",formula(row()));
dt:row&amp;lt;&amp;lt;delete formula;

dtStack = dt &amp;lt;&amp;lt; Stack(
	columns( :BP 8M, :BP 12M ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" )
);


biv = dt &amp;lt;&amp;lt; Bivariate( Y( :BP 8M ), X( :BP 12M ) );



vc = dtStack &amp;lt;&amp;lt; Variability Chart( Y( :Data ), X( :Label ) );

report(biv)[FrameBox(1)] &amp;lt;&amp;lt; add graphics script(
	dtMat = dt &amp;lt;&amp;lt; get selected rows;
	If(nrows(dtMat)&amp;gt;0  == 0,
		
		dtStack &amp;lt;&amp;lt; select where(dtStack:row==dt:row[dtmat[1]]);
		for(i=2,i&amp;lt;=n rows(dtMat),i++,
			dtStack &amp;lt;&amp;lt; select where(dtStack:row==dt:row[dtmat[i]], current selection("extend"));
		);
		
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2020 02:45:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270366#M52639</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-03T02:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data points across plots created from different tables</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270389#M52642</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;small typo?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(nrows(dtMat)&amp;gt;0  == 0,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(nrows(dtMat)&amp;gt;0 ,&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2020 07:23:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270389#M52642</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-06-03T07:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data points across plots created from different tables</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270397#M52644</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14978"&gt;@psundar6&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Another approach to your problem is to update table selections using table row state handler functions. Using&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;example, the script below creates these handlers.&amp;nbsp; Then any graph you create from this two tables will have linked selection states, unless a local data filter is deployed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/blood pressure.jmp");
dt&amp;lt;&amp;lt;new column("Row",formula(row()));
dt:row&amp;lt;&amp;lt;delete formula;

dtStack = dt &amp;lt;&amp;lt; Stack(
	columns( :BP 8M, :BP 12M ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" )
);

//Create functions to handle row state changes
//if dt selected row state is changed, change dtStack selected state

f1 = Function({a}, {dtr1={}},
      if(Is Scriptable(dtStack),
     	dtr1 = AsList(dt &amp;lt;&amp;lt; get selected rows);
		If(nitems(dtr1)&amp;gt;0,	
			dtStack &amp;lt;&amp;lt; select where(contains(dtr1,dtStack:row) ),
		   nitems(dtr1)==0,
			dtStack &amp;lt;&amp;lt; clear select 	
		);
      ); //end if
	);	
		
//if dtStack selected row state is changed, change dt selected state

f2 = Function({a}, {dtr2={}},
      If( Is Scriptable(dt),
     	dtr2 =  Associative Array(AsList(dtStack:row[dtStack &amp;lt;&amp;lt; get selected rows])) &amp;lt;&amp;lt;get keys;
		If(nitems(dtr2)&amp;gt;0,	
			dt &amp;lt;&amp;lt; select rows(dtr2) ,
		   nitems(dtr2)==0,
			dt &amp;lt;&amp;lt; clear select 	
		);	
	); //end if	
);

//create the row state handlers
rs1 = dt &amp;lt;&amp;lt; Make Row State Handler(f1);
rs2 = dtStack &amp;lt;&amp;lt; Make Row State Handler(f2);

 //any graph created from these two tables will be linked, unless a local filter is deployed
nw = new window("", HListBox(
    biv = dt &amp;lt;&amp;lt; Bivariate( Y( :BP 8M ), X( :BP 12M ) ),
    vc = dtStack &amp;lt;&amp;lt; Variability Chart( Y( :Data ), X( :Label ) )
   )// end Hlist Box 
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2020 10:02:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-data-points-across-plots-created-from-different-tables/m-p/270397#M52644</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-06-03T10:02:14Z</dc:date>
    </item>
  </channel>
</rss>

