<?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 How to use variable in a dataset script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/30842#M19569</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;I am using jsl script to analyse data, by generating small dataset which contains only a speciifc type of parameter with several&lt;/P&gt;
&lt;P&gt;"calculation" based on these parameters ( some information extracted from parameter name and some calculation on parameter&lt;BR /&gt;values). My main analysis script adds then several scripts to the dataset to be able to plot scatter plot between variable, run OneWay&lt;/P&gt;
&lt;P&gt;test, distribution.&lt;/P&gt;
&lt;P&gt;Below is some extract of the distribution script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; NewTableScript("Distribution",
Survival(
SendToByGroup( {:Meas_Type == "SHORT"} ),
Y( :Current ),
Grouping( :Split ),
Failure Plot( 1 ),
Show Points( 1 ),
Survival Plot( 0 ),
By( :Meas_Type ),
SendToByGroup(
{:Meas_Type == "SHORT"},
SendToReport(
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"1",
ScaleBox,
{Scale( "Log" ), Format( "Scientific", 10 ), Min( 0.0000000000001 ),
Max( 0.001 ), Inc( 1 ), Minor Ticks( 1 ),
Add Ref Line( 0.000000001, Solid, {255, 0, 0}, "USL", 2 )}
),
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"2",
ScaleBox,
{Min( -0.03 ), Max( 1.03 ), Inc( 0.2 ), Minor Ticks( 1 )}
),
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"Fail Plot",
FrameBox,
{Row Legend(
Split,
Color( 1 ),
Color Theme( "JMP Dark" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
),
SendToByGroup(
{:Meas_Type == "OPEN"},
etc.....&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Until then the graph show limits lines ( generally the usual 3 LSL, USL and Target). The limits values are hard coded in the script, in other word, I have the number like 5.16 e-5 in the code: Add Ref Line( 0.0000516, Solid, {0, 0, 255}, "TGT", 2 ) .&lt;/P&gt;
&lt;P&gt;So not easy to maintain for any limit change.....&lt;/P&gt;
&lt;P&gt;I was wondering if there is a way to have this value defined by a variable that I can managed the value of this variable in my main&lt;/P&gt;
&lt;P&gt;analysis script ?&lt;BR /&gt;And use something like that Add Ref Line( Target_parm_1, Solid, {0, 0, 255}, "TGT", 2 ), in the script added to the dataset.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2016 19:08:45 GMT</pubDate>
    <dc:creator>r23426</dc:creator>
    <dc:date>2016-11-29T19:08:45Z</dc:date>
    <item>
      <title>How to use variable in a dataset script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/30842#M19569</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I am using jsl script to analyse data, by generating small dataset which contains only a speciifc type of parameter with several&lt;/P&gt;
&lt;P&gt;"calculation" based on these parameters ( some information extracted from parameter name and some calculation on parameter&lt;BR /&gt;values). My main analysis script adds then several scripts to the dataset to be able to plot scatter plot between variable, run OneWay&lt;/P&gt;
&lt;P&gt;test, distribution.&lt;/P&gt;
&lt;P&gt;Below is some extract of the distribution script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; NewTableScript("Distribution",
Survival(
SendToByGroup( {:Meas_Type == "SHORT"} ),
Y( :Current ),
Grouping( :Split ),
Failure Plot( 1 ),
Show Points( 1 ),
Survival Plot( 0 ),
By( :Meas_Type ),
SendToByGroup(
{:Meas_Type == "SHORT"},
SendToReport(
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"1",
ScaleBox,
{Scale( "Log" ), Format( "Scientific", 10 ), Min( 0.0000000000001 ),
Max( 0.001 ), Inc( 1 ), Minor Ticks( 1 ),
Add Ref Line( 0.000000001, Solid, {255, 0, 0}, "USL", 2 )}
),
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"2",
ScaleBox,
{Min( -0.03 ), Max( 1.03 ), Inc( 0.2 ), Minor Ticks( 1 )}
),
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"Fail Plot",
FrameBox,
{Row Legend(
Split,
Color( 1 ),
Color Theme( "JMP Dark" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
),
SendToByGroup(
{:Meas_Type == "OPEN"},
etc.....&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Until then the graph show limits lines ( generally the usual 3 LSL, USL and Target). The limits values are hard coded in the script, in other word, I have the number like 5.16 e-5 in the code: Add Ref Line( 0.0000516, Solid, {0, 0, 255}, "TGT", 2 ) .&lt;/P&gt;
&lt;P&gt;So not easy to maintain for any limit change.....&lt;/P&gt;
&lt;P&gt;I was wondering if there is a way to have this value defined by a variable that I can managed the value of this variable in my main&lt;/P&gt;
&lt;P&gt;analysis script ?&lt;BR /&gt;And use something like that Add Ref Line( Target_parm_1, Solid, {0, 0, 255}, "TGT", 2 ), in the script added to the dataset.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 19:08:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/30842#M19569</guid>
      <dc:creator>r23426</dc:creator>
      <dc:date>2016-11-29T19:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variable in a dataset script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/30862#M19575</link>
      <description>&lt;P&gt;You can define the second argument to this function as an expression: &lt;STRONG&gt;distribution expr = Expr( Survival( ... )&lt;/STRONG&gt; in which you replace the specific values with placeholders. For example, &lt;STRONG&gt;LSL( LLL )&lt;/STRONG&gt;. Use the &lt;STRONG&gt;Substitute()&lt;/STRONG&gt; function to replace the placeholders (e.g., &lt;STRONG&gt;LLL&lt;/STRONG&gt;) with the desired value.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 22:21:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/30862#M19575</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-11-29T22:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variable in a dataset script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/31152#M19721</link>
      <description>Hi, It works well.&lt;BR /&gt;&lt;BR /&gt;and I use teh same approach to pass the variable value in adding column with formula.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 04 Dec 2016 23:42:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-variable-in-a-dataset-script/m-p/31152#M19721</guid>
      <dc:creator>r23426</dc:creator>
      <dc:date>2016-12-04T23:42:46Z</dc:date>
    </item>
  </channel>
</rss>

