<?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: Where Clause in graph loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365360#M61476</link>
    <description>&lt;P&gt;You can remove them for example with this in the end of script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;whereTb = w &amp;lt;&amp;lt; XPath("//TextBox[contains(text(), 'Where(:sex == Gender_List[j])')]");
whereTb &amp;lt;&amp;lt; Delete;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But in this case I would guess it won't help because Lineup seems those Where textboxes as elements and the window gets messed up before you delete them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 06:15:19 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-03-05T06:15:19Z</dc:date>
    <item>
      <title>Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365150#M61452</link>
      <description>&lt;P&gt;I have some code that is designed to build a report based on some filtering.&amp;nbsp; It will be fed two lists, the first will determine which materials get pulled (in this example that will be Gender_List), the second determining which properties get graphed (In this example that will be Property_List).&amp;nbsp; &amp;nbsp;The idea being that there will be a loop through each Gender that will create a matrix of graphs for all selected properties.&amp;nbsp; &amp;nbsp;There is also an over-arching, unfiltered graph at the top of the report&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two ways to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first with intrinsic where clauses in the graphs.&amp;nbsp; I've mostly gotten this to work, except that the Where clause ends up taking up a position in the line up box. Also for some reason in the mockup I have below I have a bug that I don't entirely understand (my full version does not have that bug, but would still be curious if someone knows how to fix it).&amp;nbsp; Here is the mockup code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );


Gender_List = {"M","F"};

age_list = {12,13,14,15};

Property_List = {"Age", "Height", "Weight"};

w= new window("test",

	VLB = V List Box ("A",
		dt&amp;lt;&amp;lt;Distribution( Nominal Distribution( Column( :age ) ) );
		
	);
	
	
	
);


for (j=1, j&amp;lt;= N Items (Gender_List), j++,

	VLB &amp;lt;&amp;lt; Append (Text Box(Gender_List[j]);
	
	LB = LB = Lineup Box(n col (2), spacing(10));
	
	for (i = 1, i &amp;lt;= N Items (Property_List), i++,
	
	LB&amp;lt;&amp;lt;Append(
		gb = dt&amp;lt;&amp;lt; Distribution( Continuous Distribution( Column( Property_List[i] ) ),
					where (:Sex == Gender_List[j])
				
				)

		);
		
		VLB &amp;lt;&amp;lt;Append(LB)
		
	);
);
);&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;The second is with data filter context boxes that wrap each iteration of the loop of graphs.&amp;nbsp; That one I haven't been able to get to work.&amp;nbsp; &amp;nbsp;If I can get the where version above to work I don't think I'll need to worry too much about the data filter context box/wrap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyways, any thoughts on how to clean up the code above to remove those Where clauses from the line up box?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:07:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365150#M61452</guid>
      <dc:creator>Evan_Morris</dc:creator>
      <dc:date>2023-06-09T22:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365184#M61456</link>
      <description>&lt;P&gt;I reworked your script a bit.&amp;nbsp; You had some recursive Appends in your code that were not working.&amp;nbsp; See if this gets you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Gender_List = {"M", "F"};
age_list = {12, 13, 14, 15};
Property_List = {"Age", "Height", "Weight"};

w = New Window( "test", VLB = V List Box( Text Box( "A" ), dt &amp;lt;&amp;lt; Distribution( Nominal Distribution( Column( :age ) ) ) ) );

For( j = 1, j &amp;lt;= N Items( Gender_List ), j++,
	VLB &amp;lt;&amp;lt; Append( Text Box( Gender_List[j] ) );
	VLB &amp;lt;&amp;lt; Append(
		LB = LB = Lineup Box( N Col( 2 ), spacing( 10 ),
			For( i = 1, i &amp;lt;= N Items( Property_List ), i++,
				gb = dt &amp;lt;&amp;lt; Distribution( Continuous Distribution( Column( Property_List[i] ) ), where( :Sex == Gender_List[j] ) )
			)
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Mar 2021 16:56:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365184#M61456</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-03-04T16:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365256#M61461</link>
      <description>Definitely a major improvement, but it looks like I still have that hanging "where( :Sex == Gender_List[j]" clause showing up in the lineup box. Any idea how to kill that?</description>
      <pubDate>Thu, 04 Mar 2021 20:10:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365256#M61461</guid>
      <dc:creator>Evan_Morris</dc:creator>
      <dc:date>2021-03-04T20:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365360#M61476</link>
      <description>&lt;P&gt;You can remove them for example with this in the end of script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;whereTb = w &amp;lt;&amp;lt; XPath("//TextBox[contains(text(), 'Where(:sex == Gender_List[j])')]");
whereTb &amp;lt;&amp;lt; Delete;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But in this case I would guess it won't help because Lineup seems those Where textboxes as elements and the window gets messed up before you delete them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 06:15:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365360#M61476</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-05T06:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365368#M61478</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Gender_List = {"M", "F"};
age_list = {12, 13, 14, 15};
Property_List = {"Age", "Height", "Weight"};

w = New Window( "test", VLB = V List Box( Text Box( "A" ), dt &amp;lt;&amp;lt; Distribution( Nominal Distribution( Column( :age ) ) ) ) );

For( j = 1, j &amp;lt;= N Items( Gender_List ), j++,
	VLB &amp;lt;&amp;lt; Append( Text Box( Gender_List[j] ) );
	VLB &amp;lt;&amp;lt; Append(
		LB = Lineup Box( N Col( 2 ), spacing( 10 ),
			For( i = 1, i &amp;lt;= N Items( Property_List ), i++,
				eval(substitute(
					expr(dt &amp;lt;&amp;lt; Distribution( Continuous Distribution( Column( _col_ ) ), where( :Sex == _select_) )),
					expr(_col_),Property_List[i],
					expr(_select_), Gender_List[j]
				))
			);
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Mar 2021 07:58:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/365368#M61478</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-03-05T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/366064#M61571</link>
      <description>&lt;P&gt;Still can't seem to figure out how to get rid of that "where" clause in the lineup box.&amp;nbsp; I switched it over to a graph builder object to see if header/footer preferences would remove it, but didn't seem to do it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to re-write this a data filter wrapping the LB.&amp;nbsp; That has some advantages anyways as it allows some customization by the user.&amp;nbsp; This&amp;nbsp;&lt;EM&gt;seems&lt;/EM&gt; to work, however, as you can see it looks a little wonky because the Data Filter is incredibly collapsed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Gender_List = {"M", "F"};
age_list = {12, 13, 14, 15};
Property_List = {"Age", "Height", "Weight"};

w = New Window( "test", VLB = V List Box( Text Box( "A" ), 

dt &amp;lt;&amp;lt; Graph Builder(Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ) ),
	Elements( Histogram( X, Legend( 6 ) ) )
	)
	)
	
);

For( j = 1, j &amp;lt;= N Items( Gender_List ), j++,
	VLB &amp;lt;&amp;lt; Append( Text Box( Gender_List[j] ) );
	VLB &amp;lt;&amp;lt; Append(
		
		data filter context box(
		
		LB = LB = Lineup Box( N Col( 2 ), spacing( 10 ),
			For( i = 1, i &amp;lt;= N Items( Property_List ), i++,
			
				
				gb = dt &amp;lt;&amp;lt; Graph Builder(
					Size( 534, 450 ),
					Show Control Panel(0 ),
					Variables( X(Column( Property_List[i] ) )),
					Elements( Histogram( X, Legend( 6 ) ) ),
					/*Where( :Sex == Gender_List[j] ) ),*/
			),
				
			)
		),
		
		dt&amp;lt;&amp;lt;Data Filter (local,
		add filter(
			columns(:sex),
			Where (:Sex == Gender_List[j])
		)
			
		)
		)
	);
);


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried loading the data filter at the top of the LB but that did not seem to work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts on how to clean this up?&amp;nbsp; This technically works but looks a little junky.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 14:17:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/366064#M61571</guid>
      <dc:creator>Evan_Morris</dc:creator>
      <dc:date>2021-03-08T14:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/366128#M61579</link>
      <description>&lt;P&gt;If you add&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;code to the code I provided, it will give you what you want&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="flus.PNG" style="width: 567px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31100iDBE7CAEB0E023915/image-size/large?v=v2&amp;amp;px=999" role="button" title="flus.PNG" alt="flus.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Gender_List = {"M", "F"};
age_list = {12, 13, 14, 15};
Property_List = {"Age", "Height", "Weight"};

w = New Window( "test", VLB = V List Box( Text Box( "A" ), dt &amp;lt;&amp;lt; Distribution( Nominal Distribution( Column( :age ) ) ) ) );

For( j = 1, j &amp;lt;= N Items( Gender_List ), j++,
	VLB &amp;lt;&amp;lt; Append( Text Box( Gender_List[j] ) );
	VLB &amp;lt;&amp;lt; Append(
		LB = LB = Lineup Box( N Col( 2 ), spacing( 10 ),
			For( i = 1, i &amp;lt;= N Items( Property_List ), i++,
				gb = dt &amp;lt;&amp;lt; Distribution( Continuous Distribution( Column( Property_List[i] ) ), where( :Sex == Gender_List[j] ) )
			)
		)
	);
);

whereTb = w &amp;lt;&amp;lt; XPath("//TextBox[contains(text(), 'Where(:sex == Gender_List[j])')]");
whereTb &amp;lt;&amp;lt; Delete;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Mar 2021 15:35:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/366128#M61579</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-03-08T15:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/366246#M61596</link>
      <description>&lt;P&gt;Nice, thanks.&amp;nbsp; I tried putting it in the script and didn't get it to work but it looks like it was in the wrong location.&amp;nbsp; I'm also noticing some significant performance issues with the local data filter wrapping so I'm thinking this will be the route we want to go down.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks to all for the help on this one.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 20:29:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/366246#M61596</guid>
      <dc:creator>Evan_Morris</dc:creator>
      <dc:date>2021-03-08T20:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Where Clause in graph loop</title>
      <link>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/369572#M61924</link>
      <description>&lt;P&gt;In case anyone comes past this in the future, I was able to sort out the problem with the data filter version.&amp;nbsp; Problem was that the data filter context box needed to have a single object it was wrapping.&amp;nbsp; In the way I had presented it above the box wrapped both the Lineup Box and the Data Filter.&amp;nbsp; This resulted in the weird behavior.&amp;nbsp; By wrapping the LineupBox and the Data filter into the same object (an HListBox) that appeared to fix the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Gender_List = {"M", "F"};
age_list = {12, 13, 14, 15};
Property_List = {"Age", "Height", "Weight"};

w = New Window( "test", VLB = V List Box( Text Box( "A" ), 

dt &amp;lt;&amp;lt; Graph Builder(Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ) ),
	Elements( Histogram( X, Legend( 6 ) ) )
	)
	)
	
);

For( j = 1, j &amp;lt;= N Items( Gender_List ), j++,
	VLB &amp;lt;&amp;lt; Append( Text Box( Gender_List[j] ) );
	VLB &amp;lt;&amp;lt; Append(
		
		data filter context box(
		
		HLB = HlistBox(
		
		LB = Lineup Box( N Col( 2 ), spacing( 10 ),
			For( i = 1, i &amp;lt;= N Items( Property_List ), i++,
			
				
				gb = dt &amp;lt;&amp;lt; Graph Builder(
					Size( 534, 450 ),
					Show Control Panel(0 ),
					Show Legend(0),
					Variables( X(Column( Property_List[i] ) )),
					Elements( Histogram( X, Legend( 6 ) ) ),
					/*Where( :Sex == Gender_List[j] ) ),*/
					SendToReport(
					Dispatch(
					{},
					"Graph Builder",
					OutlineBox,
					{Set Title( Property_List[i] ), Image Export Display( Normal )}
		)
	)
			),
				
			)
		),
		
		dt&amp;lt;&amp;lt;Data Filter (local,
		add filter(
			
			columns(:sex),
			Where (:Sex == Gender_List[j])
		)
			
		)
		)
		)
	);
);


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Mar 2021 12:16:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Where-Clause-in-graph-loop/m-p/369572#M61924</guid>
      <dc:creator>Evan_Morris</dc:creator>
      <dc:date>2021-03-19T12:16:27Z</dc:date>
    </item>
  </channel>
</rss>

