<?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 Exclude rows in Col Quantile Calculation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/272335#M52964</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was trying to get Col Quantile( :height, 0.5, :class) but it looks like the calculation would still take the excluded rows into consideration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to reject the excluded rows into&amp;nbsp;Col Quantile calculation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Midori&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:28:57 GMT</pubDate>
    <dc:creator>midori555</dc:creator>
    <dc:date>2023-06-09T23:28:57Z</dc:date>
    <item>
      <title>Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/272335#M52964</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was trying to get Col Quantile( :height, 0.5, :class) but it looks like the calculation would still take the excluded rows into consideration.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to reject the excluded rows into&amp;nbsp;Col Quantile calculation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Midori&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:28:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/272335#M52964</guid>
      <dc:creator>midori555</dc:creator>
      <dc:date>2023-06-09T23:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/272355#M52972</link>
      <description>&lt;P&gt;You can check for the row being excluded within the Col Quantile() function.&amp;nbsp; Below is an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; New Column( "Col Quantile Height by Age",
	numeric,
	continuous,
	formula( Col Quantile(If(excluded(rowstate(Row())),., :height), 0.5, :age ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Whenever the excluded rowstate changes for the rows in the data table, the formula will calculate new values&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 09:51:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/272355#M52972</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-12T09:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737456#M91860</link>
      <description>&lt;P&gt;I tried to create a loop to collect the 50th percentile of many parameters using the following code, but both elements in "test_list" are the same (they are both 50% of weight). However, if I run the lines manually, it will work. Can I not use the Col Quantile() function in the for loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Names Default To Here( 1 );&lt;/DIV&gt;&lt;DIV&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;plot_param={&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;height,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;weight};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;test_list={};&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;for(plotcnt=1, plotcnt&amp;lt;=nitems(plot_param), plotcnt++,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pct_50=Col Quantile( If(excluded(rowstate(Row())),., column(plot_param[plotcnt])), 0.5);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;test_list[plotcnt]=pct_50;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Mar 2024 23:02:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737456#M91860</guid>
      <dc:creator>LatentDataTiger</dc:creator>
      <dc:date>2024-03-21T23:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737457#M91861</link>
      <description>&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I tried to create a loop to collect the 50th percentile of many parameters using the following code, but both elements in "test_list" are the same (they are both 50% of weight). However, if I run the lines manually, it will work. Can I not use the Col Quantile() function in the for loop?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

plot_param={
	
	height,
	weight};

test_list={};

for(plotcnt=1, plotcnt&amp;lt;=nitems(plot_param), plotcnt++,

	pct_50=Col Quantile( If(excluded(rowstate(Row())),., column(plot_param[plotcnt])), 0.5);
	test_list[plotcnt]=pct_50;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Mar 2024 23:04:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737457#M91861</guid>
      <dc:creator>LatentDataTiger</dc:creator>
      <dc:date>2024-03-21T23:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737878#M91912</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param={
	height,
	weight};
test_list={};

for(plotcnt=1, plotcnt&amp;lt;=nitems(plot_param), plotcnt++,

	Eval (Substitute (Expr(pct_50=Col Quantile( If(excluded(rowstate(Row())),., _col_), 0.5)), Expr(_col_), column(plot_param[plotcnt])));
	test_list[plotcnt]=pct_50;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 15:22:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737878#M91912</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-03-22T15:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737894#M91913</link>
      <description>&lt;P&gt;Due to a typo, I just noticed that Eval (substitute()) is enough, even if you substitute 1 with 1:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param = {height, weight};
test_list = {};
For( plotcnt = 1, plotcnt &amp;lt;= N Items( plot_param ), plotcnt++, 

	pct_50 = Eval( Substitute( Expr( Col Quantile( If( Excluded( Row State( Row() ) ), ., Column( plot_param[plotcnt] ) ), 0.5 ) ), 1, 1 ) );
	test_list[plotcnt] = pct_50;
);
show(test_list);&lt;/CODE&gt;&lt;/PRE&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="hogi_0-1711121159394.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62532iD3CA9FC262926228/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1711121159394.png" alt="hogi_0-1711121159394.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 15:56:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/737894#M91913</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-03-22T15:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/748230#M92825</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/54010"&gt;@LatentDataTiger&lt;/a&gt;&amp;nbsp;, feedback from JMP Support (TS-00139301)&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Yes, this is a bug.&amp;nbsp; The developers have verified it is a caching issue with Col Quantile [&amp;amp; Col Median] specifically.&amp;nbsp; The other Col functions do not have the issue.&amp;nbsp; Using Substitute makes a new expression with each iteration of the loop so that caching does not get used improperly.&amp;nbsp; Thanks for reporting this and I will file a bug report.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, under the line, it's not &lt;FONT face="courier new,courier"&gt;Substitute&lt;/FONT&gt;, but the protection via &lt;FONT face="courier new,courier"&gt;Eval(Expr())&lt;/FONT&gt; which fixes the bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;nice example from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/48523"&gt;@Arn_Cota&lt;/a&gt;&amp;nbsp;[adapted version] illustrating the effect:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param = {height, weight};
test_list = {};
For( plotcnt = 1, plotcnt &amp;lt;= N Items( plot_param ), plotcnt++, 
// Without Exclude, returns correct values
	pct_50_v0 = Col Quantile( Column( plot_param[plotcnt] ), 0.5 );

// With Exclude, returns the Quantile for height
	pct_50_v1 = Col Quantile(
		If( Excluded( Row State( Row() ) ),
			.,
			Column( plot_param[plotcnt] )
		),
		0.5
	);

// With Eval and Substitute, returns correct values
	pct_50_v2 = Eval(
		Substitute(
				Expr(
					Col Quantile(
						If( Excluded( Row State( Row() ) ),
							.,
							Column( plot_param[plotcnt] )
						),
						0.5
					)
				),
			1, 1
		)
	);
 
 // use Eval(Expr() to protect the expression against inappropriate caching
 	pct_50_v3 = Eval(Expr(Col Quantile(
		If( Excluded( Row State( Row() ) ),
			.,
			Column( plot_param[plotcnt] )
		),
		0.5
	)));

        // Show different versions
	Show(
		plotcnt,
		Column( plot_param[plotcnt] ),
		pct_50_v0,
		pct_50_v1,
		pct_50_v2,
		pct_50_v3
	);
	test_list[plotcnt] = pct_50_v3;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Sat, 20 Apr 2024 16:05:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/748230#M92825</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-04-20T16:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude rows in Col Quantile Calculation</title>
      <link>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/748308#M92847</link>
      <description>&lt;P&gt;example/workaround added to&amp;nbsp;&lt;LI-MESSAGE title="Expression Handling in JMP: Tipps and Trapdoors" uid="747728" url="https://community.jmp.com/t5/Discussions/Expression-Handling-in-JMP-Tipps-and-Trapdoors/m-p/747728#U747728" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2024 16:07:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Exclude-rows-in-Col-Quantile-Calculation/m-p/748308#M92847</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-04-20T16:07:33Z</dc:date>
    </item>
  </channel>
</rss>

