<?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: Script only works when run step-by-step in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906379#M106480</link>
    <description>&lt;P&gt;I tried wait there.. I also tried it after Col_start = 5.&amp;nbsp; No luck.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Oct 2025 19:55:35 GMT</pubDate>
    <dc:creator>Phil_Nash</dc:creator>
    <dc:date>2025-10-07T19:55:35Z</dc:date>
    <item>
      <title>Script only works when run step-by-step</title>
      <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906367#M106478</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

Query = current data table();

Query_piv = (Data Table( "SO Query" ) &amp;lt;&amp;lt; Tabulate(
	Add Table(
		Column Table(
			Grouping Columns( :Year, :Week ),
			Analysis Columns( :QTY Ordered )
		),
		Row Table(
			Grouping Columns( :Item, :Item Description, :Channel, :Product Type )
		)
	)
));

Query_tab = Query_piv &amp;lt;&amp;lt; Make Into Data Table;

Query_piv &amp;lt;&amp;lt; close window;

Col_Start = 5;

Query_tab &amp;lt;&amp;lt; group columns("Weeks",column(Col_Start), N cols(Query_tab) - Col_Start + 1);
Col_group = Query_tab &amp;lt;&amp;lt; get column group ("Weeks");

Query_stack = Query_tab &amp;lt;&amp;lt; Stack(
	columns( Column Group( "Weeks" ) ),
	Output Table( "Stacked History" )
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have a set of data (weekly order volume) that I'm tabulating and then stacking.&amp;nbsp; This script works fine if I run it pieces at a time.&amp;nbsp; However, when I try to execute it as a whole I get the following error.&amp;nbsp; Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_Nash_0-1759866194395.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/84535i60F62021B5B0B9E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Phil_Nash_0-1759866194395.png" alt="Phil_Nash_0-1759866194395.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 19:48:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906367#M106478</guid>
      <dc:creator>Phil_Nash</dc:creator>
      <dc:date>2025-10-07T19:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script only works when run step-by-step</title>
      <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906378#M106479</link>
      <description>&lt;P&gt;try&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Query_tab = Query_piv &amp;lt;&amp;lt; Make Into Data Table;
wait(0);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The issue may be caused by JMP performing the grouping action before the data table has been populated.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 19:54:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906378#M106479</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-10-07T19:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script only works when run step-by-step</title>
      <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906379#M106480</link>
      <description>&lt;P&gt;I tried wait there.. I also tried it after Col_start = 5.&amp;nbsp; No luck.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 19:55:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906379#M106480</guid>
      <dc:creator>Phil_Nash</dc:creator>
      <dc:date>2025-10-07T19:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script only works when run step-by-step</title>
      <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906383#M106481</link>
      <description>&lt;P&gt;Hmm, I cannot reproduce the issue with some dummy data. It might be a timing issue, but why doesn't &lt;FONT face="courier new,courier"&gt;wait(0)&lt;/FONT&gt; work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could skip the grouping step and use the column references directly as input for &lt;FONT face="courier new,courier"&gt;Stack&lt;/FONT&gt;.&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Remove from()&lt;/FONT&gt; to start with column #5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Query_tab = obj &amp;lt;&amp;lt; Make Into Data Table;
cols = Query_tab  &amp;lt;&amp;lt; get column references;
Remove From( cols, 1, 4 );

Query_tab &amp;lt;&amp;lt; Stack( columns( cols ) ) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 20:08:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906383#M106481</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-10-07T20:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script only works when run step-by-step</title>
      <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906431#M106486</link>
      <description>&lt;P&gt;How big starting table you have? How big tabulate do you end up with? Does the script work properly if use values instead of variables with the group columns?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try adding data table reference to Column instead of relying on current data table, so use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column(Query_tab, Col_Start)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also if&amp;nbsp;Data Table("SO Query") is same as&amp;nbsp;Query = Current Data Table(), I would replace it with dt to make it more robust.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 04:49:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906431#M106486</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-10-08T04:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script only works when run step-by-step</title>
      <link>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906605#M106498</link>
      <description>&lt;P&gt;Adding the table reference solved the problem.&amp;nbsp; Thanks!!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 20:06:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-only-works-when-run-step-by-step/m-p/906605#M106498</guid>
      <dc:creator>Phil_Nash</dc:creator>
      <dc:date>2025-10-08T20:06:31Z</dc:date>
    </item>
  </channel>
</rss>

