<?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: Referencing columns extracted from parsing Datafilter select where in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/611113#M81167</link>
    <description>&lt;P&gt;Thanks for the suggestion, but i would need to use the whole clause including the conditions (&amp;gt;10 or =="F").&lt;/P&gt;&lt;P&gt;and do something to the columns based on the selection.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 12:25:20 GMT</pubDate>
    <dc:creator>peri_a</dc:creator>
    <dc:date>2023-03-13T12:25:20Z</dc:date>
    <item>
      <title>Referencing columns extracted from parsing Datafilter select where</title>
      <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609520#M81054</link>
      <description>&lt;P&gt;I want to use a data filter interface for a different use.&lt;/P&gt;&lt;P&gt;Then i need to parse the "select where" clause and use the info in there.&lt;/P&gt;&lt;P&gt;I am able to parse the Where clause and identify the different column in the expression&lt;/P&gt;&lt;P&gt;but not reference them&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DFClause=Currentdatafilter &amp;lt;&amp;lt; get where clause();&lt;BR /&gt;SelectInnerExpr=Arg(parse(DFClause),1);&lt;BR /&gt;// let assume for a second this will always return an expression of this type to simplify the example &lt;BR /&gt;SelectInnerExpr= expr(:study_owner == "name" &amp;amp; :Is Electr. == 1);&lt;BR /&gt;&lt;BR /&gt;//so i can parse it with a simple for loop
for(iA=1,iA&amp;lt;=NArg(SelectInnerExpr),iA++,
	TestColExp=Arg(Arg(SelectInnerExpr,iA),1); // here i can get the column as i need but as :ColumName
	TestCol=eval(TestColExp); // so this does not really retun the column reference&lt;BR /&gt;	colname=&amp;nbsp;TestCol&amp;lt;&amp;lt; Get Name;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;however i get the column as :ColumName&lt;/P&gt;&lt;P&gt;how do i now get the column reference to then continue with the script?&lt;/P&gt;&lt;P&gt;colname=&amp;nbsp;&lt;CODE class=" language-jsl"&gt;TestCol&lt;/CODE&gt;&amp;lt;&amp;lt; Get Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 14:45:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609520#M81054</guid>
      <dc:creator>peri_a</dc:creator>
      <dc:date>2023-06-08T14:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing columns extracted from parsing Datafilter select where</title>
      <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609617#M81066</link>
      <description>&lt;P&gt;Is this what you're looking for? I modified your For() loop to put the first bit into a char, then pulled out and parsed the first word. Full script attached. There are also likely more elegant ways to do this that others may add.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( iA = 1, iA &amp;lt;= N Arg( SelectInnerExpr ), iA++,
	TestColExp = Char( Arg( Arg( SelectInnerExpr, iA ), 1 ) ); // put all into a char()
	TestCol = Parse( Word( 1, TestColExp ) ); //now returns test col
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2023 15:52:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609617#M81066</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2023-03-08T15:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing columns extracted from parsing Datafilter select where</title>
      <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609849#M81089</link>
      <description>&lt;P&gt;This also seems to work, but in the not-that-unusual case of having an open paren in the column name, will fail. You'd have to trap for that if it is a concern.&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\Car Physical Data.jmp");
gb  = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 526, 668 ),
	Show Control Panel( 0 ),
	Variables( X( :Turning Circle ), Y( :Horsepower ) ),
	Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) ),
	Local Data Filter(
		Show Histograms and Bars( 0 ),
		Add Filter( columns( :Country, :Type ), Display( :Type, N Items( 5 ) ) ),
		Add Filter( columns( :Weight ), Display( :Weight, Height( 20 ) ) )
	)
);
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//////////// processing here

ob = (report(gb) &amp;lt;&amp;lt; parent)[outlinebox(1)];
lis = (ob &amp;lt;&amp;lt; xpath( "//TabPageBox" )) &amp;lt;&amp;lt; get title;
colnames = Transform Each( {v, i}, lis[2 :: (N Items( lis ) - 1)],
	Trim Whitespace( Items( [1 1], v, "(" )[1] )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2023 21:54:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609849#M81089</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2023-03-08T21:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing columns extracted from parsing Datafilter select where</title>
      <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609852#M81090</link>
      <description>&lt;P&gt;I should add that it isn't getting the where clause, but rather the columns used in the filter... so that may not suit your needs.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 21:57:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/609852#M81090</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2023-03-08T21:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing columns extracted from parsing Datafilter select where</title>
      <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/611112#M81166</link>
      <description>&lt;P&gt;Looking at your suggestion i realizes that&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="jsl"&gt;TestColExp &lt;/LI-CODE&gt;&lt;P&gt;Is already the reference to the column i was looking for.&lt;/P&gt;&lt;P&gt;the "eval" in my script was not necessary...&amp;nbsp;&lt;/P&gt;&lt;P&gt;i could just use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TestColExp &amp;lt;&amp;lt; Get Data Type&lt;/LI-CODE&gt;&lt;P&gt;for example&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 12:19:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/611112#M81166</guid>
      <dc:creator>peri_a</dc:creator>
      <dc:date>2023-03-13T12:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing columns extracted from parsing Datafilter select where</title>
      <link>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/611113#M81167</link>
      <description>&lt;P&gt;Thanks for the suggestion, but i would need to use the whole clause including the conditions (&amp;gt;10 or =="F").&lt;/P&gt;&lt;P&gt;and do something to the columns based on the selection.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 12:25:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Referencing-columns-extracted-from-parsing-Datafilter-select/m-p/611113#M81167</guid>
      <dc:creator>peri_a</dc:creator>
      <dc:date>2023-03-13T12:25:20Z</dc:date>
    </item>
  </channel>
</rss>

