<?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 refresh data in a new table within JSL script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58151#M32283</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Hello -&lt;/P&gt;&lt;P class="p1"&gt;I am currently writing a script that will ultimately display a report for me. I can get all preceding tables/graphs to refresh accordingly when the data source's data is updated, but I'm not sure why the final table in the script doesn't update (labeled /* FINAL REPORT */). Am I missing a line so I can pull in data from the data source? Thank you in advance!&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

CumulativeData = Open(
	"/Users/NAME/Desktop/JMP/Customer1_Data_05232018.xlsx",
	Worksheets( "Cumulative_Data_Customer1" ),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 2 ),
		Data Starts on Column( 1 ),ho
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		Replicated Spanned Rows( 1 ),
		Replicated Spanned Headers( 0 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 1 ),
		Suppress Empty Columns( 1 ),
		Treat as Hierarchy( 0 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "-" )
	)
);

FitLineGraph = CumulativeData &amp;lt;&amp;lt; Bivariate(
	Y( :Cumulative ),
	X( :Day of year ),
	Fit Where(
		:Customer == "Customer1",
		Fit Line( {Line Color( {212, 73, 88} )} )
	)
);


CombinedTable = platform = Data Table( "Cumulative_Data_Customer1" ) &amp;lt;&amp;lt;
Bivariate(
	Y( :Cumulative ),
	X( :Day of year ),
	Fit Where(
		:Customer == "Customer1",
		Fit Line( {Line Color( {212, 73, 88} )} )
	)
);
Wait( 0 );
Report( platform )[Outline Box( "Bivariate Fit of Cumulative By Day of year" )][
Outline Box( "Linear Fit Customer==\!"Customer1\!"" )][
Outline Box( "Parameter Estimates" )][Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;
Report( platform ) &amp;lt;&amp;lt; Close Window;


/* FINAL REPORT */
CampaignFulfillment = New Table( "Campaign Fulfillment",
	Add Rows( 1 ),
	New Script(
		"Source",
		Data Table( CombinedTable ) &amp;lt;&amp;lt; Split(
			Split By( :Term ),
			Split( :Estimate ),
			Sort by Column Property
		)
	),
	New Script(
		"Make Combined Data Table",
		Names Default To Here( 1 );
		platform = Data Table( "Cumulative_Data_Customer1" ) &amp;lt;&amp;lt;
		Bivariate(
			Y( :Cumulative ),
			X( :Data per day ),
			Fit Where(
				:Customer == "Customer1",
				Fit Line( {Line Color( {212, 73, 88} )} )
			)
		);
		Wait( 0 );
		Report( platform )[Outline Box( "Bivariate Fit of Cumulative By Day of year"
		)][Outline Box( "Linear Fit Customer==\!"Customer1\!"" )][
		Outline Box( "Parameter Estimates" )][Table Box( 1 )] &amp;lt;&amp;lt;
		Make Combined Data Table;
		Report( platform ) &amp;lt;&amp;lt; Close Window;
	),
	New Column( "Customer", Character, "Nominal", Set Values( {"Customer1"} ) ),
	New Column( "Data Guarantee",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Set Values( [3600] )
	),
	New Column( "Program Length Target",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Set Values( [365] )
	),
	New Column( "Data per day",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [9.90692146417355] )
	),
	New Column( "X",
		Character,
		"Nominal",
		Hide,
		Exclude,
		Set Values( {"Day of year"} )
	),
	New Column( "Y",
		Character,
		"Nominal",
		Hide,
		Exclude,
		Set Values( {"Cumulative"} )
	),
	New Column( "~Bias", Character, "Nominal", Hide, Exclude, Set Values( {""} ) ),
	New Column( "Std Error",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Hide,
		Exclude,
		Set Values( [0.0596952471880355] )
	),
	New Column( "t Ratio",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 2 ),
		Hide,
		Exclude,
		Set Values( [165.958295355868] )
	),
	New Column( "Prob&amp;gt;|t|",
		Numeric,
		"Continuous",
		Format( "PValue", 12 ),
		Hide,
		Exclude,
		Set Values( [4.75743232959739e-156] )
	),
	New Column( "Intercept",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Hide,
		Exclude,
		Set Values( [-96.5323780670815] )
	),
	New Column( "Estimated # at Target Date",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Formula( :Data per day * :Program Length Target )
	),
	New Column( "Delta to Target",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Formula( :Estimated # at Target Date - :Data Guarantee )
	),
	New Column( "Percent Deviation",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Formula( (:Delta to Target / :Data Guarantee) * 100 ),
		Set Property(
			"Color Gradient",
			{{"Variance Evaluation", 16387, {{252, 0, 7}, {235, 255, 10}, {33, 224,
			9}, {255, 248, 16}, {12, 108, 255}}, {0.00797872340425532,
			0.247340425531915, 0.502659574468085, 0.726063829787234, 1}},
			Range( {-10, 10, 0} )}
		),
		Color Cell by Value,
		Set Selected
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 May 2018 21:27:22 GMT</pubDate>
    <dc:creator>JMPer08</dc:creator>
    <dc:date>2018-05-24T21:27:22Z</dc:date>
    <item>
      <title>How to refresh data in a new table within JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58151#M32283</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Hello -&lt;/P&gt;&lt;P class="p1"&gt;I am currently writing a script that will ultimately display a report for me. I can get all preceding tables/graphs to refresh accordingly when the data source's data is updated, but I'm not sure why the final table in the script doesn't update (labeled /* FINAL REPORT */). Am I missing a line so I can pull in data from the data source? Thank you in advance!&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

CumulativeData = Open(
	"/Users/NAME/Desktop/JMP/Customer1_Data_05232018.xlsx",
	Worksheets( "Cumulative_Data_Customer1" ),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 2 ),
		Data Starts on Column( 1 ),ho
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		Replicated Spanned Rows( 1 ),
		Replicated Spanned Headers( 0 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 1 ),
		Suppress Empty Columns( 1 ),
		Treat as Hierarchy( 0 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "-" )
	)
);

FitLineGraph = CumulativeData &amp;lt;&amp;lt; Bivariate(
	Y( :Cumulative ),
	X( :Day of year ),
	Fit Where(
		:Customer == "Customer1",
		Fit Line( {Line Color( {212, 73, 88} )} )
	)
);


CombinedTable = platform = Data Table( "Cumulative_Data_Customer1" ) &amp;lt;&amp;lt;
Bivariate(
	Y( :Cumulative ),
	X( :Day of year ),
	Fit Where(
		:Customer == "Customer1",
		Fit Line( {Line Color( {212, 73, 88} )} )
	)
);
Wait( 0 );
Report( platform )[Outline Box( "Bivariate Fit of Cumulative By Day of year" )][
Outline Box( "Linear Fit Customer==\!"Customer1\!"" )][
Outline Box( "Parameter Estimates" )][Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;
Report( platform ) &amp;lt;&amp;lt; Close Window;


/* FINAL REPORT */
CampaignFulfillment = New Table( "Campaign Fulfillment",
	Add Rows( 1 ),
	New Script(
		"Source",
		Data Table( CombinedTable ) &amp;lt;&amp;lt; Split(
			Split By( :Term ),
			Split( :Estimate ),
			Sort by Column Property
		)
	),
	New Script(
		"Make Combined Data Table",
		Names Default To Here( 1 );
		platform = Data Table( "Cumulative_Data_Customer1" ) &amp;lt;&amp;lt;
		Bivariate(
			Y( :Cumulative ),
			X( :Data per day ),
			Fit Where(
				:Customer == "Customer1",
				Fit Line( {Line Color( {212, 73, 88} )} )
			)
		);
		Wait( 0 );
		Report( platform )[Outline Box( "Bivariate Fit of Cumulative By Day of year"
		)][Outline Box( "Linear Fit Customer==\!"Customer1\!"" )][
		Outline Box( "Parameter Estimates" )][Table Box( 1 )] &amp;lt;&amp;lt;
		Make Combined Data Table;
		Report( platform ) &amp;lt;&amp;lt; Close Window;
	),
	New Column( "Customer", Character, "Nominal", Set Values( {"Customer1"} ) ),
	New Column( "Data Guarantee",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Set Values( [3600] )
	),
	New Column( "Program Length Target",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Set Values( [365] )
	),
	New Column( "Data per day",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [9.90692146417355] )
	),
	New Column( "X",
		Character,
		"Nominal",
		Hide,
		Exclude,
		Set Values( {"Day of year"} )
	),
	New Column( "Y",
		Character,
		"Nominal",
		Hide,
		Exclude,
		Set Values( {"Cumulative"} )
	),
	New Column( "~Bias", Character, "Nominal", Hide, Exclude, Set Values( {""} ) ),
	New Column( "Std Error",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Hide,
		Exclude,
		Set Values( [0.0596952471880355] )
	),
	New Column( "t Ratio",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 2 ),
		Hide,
		Exclude,
		Set Values( [165.958295355868] )
	),
	New Column( "Prob&amp;gt;|t|",
		Numeric,
		"Continuous",
		Format( "PValue", 12 ),
		Hide,
		Exclude,
		Set Values( [4.75743232959739e-156] )
	),
	New Column( "Intercept",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Hide,
		Exclude,
		Set Values( [-96.5323780670815] )
	),
	New Column( "Estimated # at Target Date",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Formula( :Data per day * :Program Length Target )
	),
	New Column( "Delta to Target",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Formula( :Estimated # at Target Date - :Data Guarantee )
	),
	New Column( "Percent Deviation",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 0 ),
		Formula( (:Delta to Target / :Data Guarantee) * 100 ),
		Set Property(
			"Color Gradient",
			{{"Variance Evaluation", 16387, {{252, 0, 7}, {235, 255, 10}, {33, 224,
			9}, {255, 248, 16}, {12, 108, 255}}, {0.00797872340425532,
			0.247340425531915, 0.502659574468085, 0.726063829787234, 1}},
			Range( {-10, 10, 0} )}
		),
		Color Cell by Value,
		Set Selected
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 21:27:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58151#M32283</guid>
      <dc:creator>JMPer08</dc:creator>
      <dc:date>2018-05-24T21:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to refresh data in a new table within JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58169#M32294</link>
      <description>&lt;P&gt;You have an error in your script.&amp;nbsp; I believe you want this definition of CombinedTable.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; CombinedTable=Report(platform).... &amp;lt;&amp;lt;Make Combined Data Table;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Since the data table you are creating has this portion of JSL as a table script, it will need to be fixed as well.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Also, you have defined only one row in data table CampaignFulfilment, with fixed values. I see no JSL code to add data or make that table dynamic.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Please describe what you expect the script to do.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;platform = Data Table( "Cumulative_Data_Customer1" ) &amp;lt;&amp;lt;
Bivariate(
	Y( :Cumulative ),
	X( :Day of year ),
	Fit Where(
		:Customer == "Customer1",
		Fit Line( {Line Color( {212, 73, 88} )} )
	)
);
Wait( 0 );
CombinedTable =Report( platform )[Outline Box( "Bivariate Fit of Cumulative By Day of year" )][
Outline Box( "Linear Fit Customer==\!"Customer1\!"" )][
Outline Box( "Parameter Estimates" )][Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;
Report( platform ) &amp;lt;&amp;lt; Close Window;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 05:06:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58169#M32294</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-05-25T05:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to refresh data in a new table within JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58172#M32297</link>
      <description>&lt;P&gt;I'm not sure how to make my table dynamic and would like to make that happen.&amp;nbsp;My goal is to have the CampaignFulfillment table, the split table, to auto&amp;nbsp;refresh when the data source updates. The "Data by day" number in CampaginFulfillment is pulled from CombinedTable and that number is created when a fit line is added to the graph I created.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached images of what everything looks like.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 05:26:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-refresh-data-in-a-new-table-within-JSL-script/m-p/58172#M32297</guid>
      <dc:creator>JMPer08</dc:creator>
      <dc:date>2018-05-25T05:26:22Z</dc:date>
    </item>
  </channel>
</rss>

