<?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 Dynamic Reference Line in Variability chart based on value in reference table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/620846#M82003</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering how I can reference a value in a specific column based on a reference column. The concept is just like VLOOKUP in Excel. I have a data table with a name and there is a unique threshold value for that specific name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Variability Chart(
	Y( :Signal ),
	X( :Expected Outcome, :Sample Mix, :Consumable ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),
	Process Variation( 0 ),
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	Points Jittered( 1 ),
	Show Box Plot Whisker Bars( 0 ),
	Mean Diamonds( 0 ),
	By( :Description ),
	SendToReport(
		Dispatch(
			{"Variability Chart for Signal"},
			"2",
			ScaleBox,
			{Scale( "Log" ), Min( 0.01 ), Max( 1250 ), Inc( 1 ), Minor Ticks( 8 ), Add Ref Line( 0, Dotted, "Medium Light Gray" ),
			Add Ref Line( &lt;STRONG&gt;***[5/(I want this to be the value based on the By reference in the variability chart]***&lt;/STRONG&gt;, Dotted, "Black" ), Rotated Labels( "Horizontal" )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In my head it would be get the current value of :Description in the By grouping and then find the corresponding value of the threshold in the "Threshold (nA)" column. But I am unsure how to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simpler example is:&lt;/P&gt;&lt;P&gt;Example Data table:&lt;/P&gt;&lt;P&gt;A&amp;nbsp; B&amp;nbsp; C&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 2&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 4&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 6&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 7&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 4&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;4&amp;nbsp; 9&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My variability graph will be plotting B as the y axis but I want a horizontal line based on My By which in this case would be A so 1, 2, 3. So my three variability graphs will have 3, 5, and 4 as respective horizonal lines based on the value of A. As of now I am unsure how to get this value and plug it into the code above to get a dynamic horizonal line by description as my By grouping. Any help would be greatly appreciated. Thanks!&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 00:00:17 GMT</pubDate>
    <dc:creator>neelsrejan</dc:creator>
    <dc:date>2023-06-11T00:00:17Z</dc:date>
    <item>
      <title>Dynamic Reference Line in Variability chart based on value in reference table</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/620846#M82003</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering how I can reference a value in a specific column based on a reference column. The concept is just like VLOOKUP in Excel. I have a data table with a name and there is a unique threshold value for that specific name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Variability Chart(
	Y( :Signal ),
	X( :Expected Outcome, :Sample Mix, :Consumable ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),
	Process Variation( 0 ),
	Show Range Bars( 0 ),
	Show Cell Means( 0 ),
	Std Dev Chart( 0 ),
	Points Jittered( 1 ),
	Show Box Plot Whisker Bars( 0 ),
	Mean Diamonds( 0 ),
	By( :Description ),
	SendToReport(
		Dispatch(
			{"Variability Chart for Signal"},
			"2",
			ScaleBox,
			{Scale( "Log" ), Min( 0.01 ), Max( 1250 ), Inc( 1 ), Minor Ticks( 8 ), Add Ref Line( 0, Dotted, "Medium Light Gray" ),
			Add Ref Line( &lt;STRONG&gt;***[5/(I want this to be the value based on the By reference in the variability chart]***&lt;/STRONG&gt;, Dotted, "Black" ), Rotated Labels( "Horizontal" )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In my head it would be get the current value of :Description in the By grouping and then find the corresponding value of the threshold in the "Threshold (nA)" column. But I am unsure how to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simpler example is:&lt;/P&gt;&lt;P&gt;Example Data table:&lt;/P&gt;&lt;P&gt;A&amp;nbsp; B&amp;nbsp; C&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 2&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 4&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 6&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;2&amp;nbsp; 7&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; 4&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;4&amp;nbsp; 9&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My variability graph will be plotting B as the y axis but I want a horizontal line based on My By which in this case would be A so 1, 2, 3. So my three variability graphs will have 3, 5, and 4 as respective horizonal lines based on the value of A. As of now I am unsure how to get this value and plug it into the code above to get a dynamic horizonal line by description as my By grouping. Any help would be greatly appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 00:00:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/620846#M82003</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2023-06-11T00:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Reference Line in Variability chart based on value in reference table</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/620881#M82006</link>
      <description>&lt;P&gt;Here is a little example of one way to add the reference line based upon a separate column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

// Add a column that has the value for the reference line to be written
dt &amp;lt;&amp;lt; new column("Ref", set each value(If(:sex=="F", 60,65)));

vc = Variability Chart(
	Y( :height ),
	Model( "Main Effect" ),
	X( :age ),
	by( :sex )
);

summarize( dt, group = by( :sex), value = mean(:ref));

for each( {bygroup,i}, value,
	report(vc[i])[AxisBox(1)] &amp;lt;&amp;lt; add ref line(value[i],"solid","red", format(value[i], "fixed dec", 6,1))
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Apr 2023 11:06:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/620881#M82006</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-07T11:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Reference Line in Variability chart based on value in reference table</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/621189#M82032</link>
      <description>&lt;P&gt;Thanks txnelson,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't properly understand how to use the bygroup in a for each function. Thanks for the code snippet, this is exactly what I was hoping for. I appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Respectfully,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Neel Srejan&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 20:47:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-Reference-Line-in-Variability-chart-based-on-value-in/m-p/621189#M82032</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2023-04-07T20:47:38Z</dc:date>
    </item>
  </channel>
</rss>

