<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Filtering Cascading Dropdowns Filters Too Much Out</title><link>https://www.infopathdev.com:443/forums/thread/42577.aspx</link><pubDate>Sun, 07 Jun 2009 16:36:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:42577</guid><dc:creator>Shanty</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/42577.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=42577</wfw:commentRss><description>&lt;p&gt;I am trying to get 3 cascading dropdowns to display unique values filtered on a previous dropdown.&amp;nbsp;&amp;nbsp;Although I can get it to EITHER display a complete list of unique values OR display filtered (but duplicate) values based on a selection&amp;nbsp;in a previous dropdown, when I combine the 2 filters, the values ARE unique and ARE explicit to the filter BUT there are values now&amp;nbsp;missing.&amp;nbsp; The dropdowns are populated from a Secondary Data Source (a SQL query).&lt;/p&gt;
&lt;p&gt;I have 3 tables that are used in&amp;nbsp;the SQL query. Below I show the tables and the pertinent fields used in the query from each table with the &lt;strong&gt;KEY of the table&lt;/strong&gt;&amp;nbsp;bolded&amp;nbsp;and the &lt;em&gt;JOIN&lt;/em&gt; field italicized (where there is one).&amp;nbsp; Because each of the first three tables listed have many to many relationships (i.e. - within each&amp;nbsp;&amp;quot;Location&amp;quot; can be many &amp;quot;Company&amp;quot; and each &amp;quot;Company&amp;quot; can be located at many &amp;quot;Location&amp;quot;), the 4th table was created to mitigate issues and contains only key and join fields.&amp;nbsp; As you can see, the Join fields of the fourth table are similarly named to that of the KEY fields in the main tables.&lt;/p&gt;
&lt;p&gt;TABLES&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Location - &lt;strong&gt;LocID&lt;/strong&gt;, Location&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Company - &lt;strong&gt;CompanyID&lt;/strong&gt;, CoyName&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Department - &lt;strong&gt;DeptID&lt;/strong&gt;, DeptName&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;LocationCompanyDept - &lt;strong&gt;LCDID, &lt;/strong&gt;&lt;em&gt;Loc_ID, Company_ID, Dept_ID&lt;/em&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;QUERY&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Combines all tables above and pulls all data for the fields listed in the above tables.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;FORM&amp;nbsp;DROPDOWNS&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Loc - displays the name of the Location.&amp;nbsp;&amp;nbsp;The XPath statement used here effectively displays unique values of the various locations:&amp;nbsp; not(.=../preceding::*/@Loc)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;CompanyName - &lt;strong&gt;not(.=../preceding-sibling::*/@CompanyName)&lt;/strong&gt; AND&amp;nbsp;&lt;strong&gt;Loc = Location&lt;/strong&gt; (filters on the Location of the form being the same as the Location in the query).&amp;nbsp; This is the one where, after combining the filters, the values displayed are incomplete.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Dept - this dropdown will filter on both Loc and CompanyName values as it too has a many-to-many relationship with the other two dropdowns.&amp;nbsp; I have not completed this one as I am pretty sure that once I get the CompanyName dropdown figured out, this one will follow suit.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I have tried various methods including: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;adjusting the SQL query to place the filter inside of it.&amp;nbsp; Not a very efficient or subsequently useful idea.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;modifying the XPath -&amp;nbsp;but my understanding of XPath is limited so this is mostly guess work&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;spliting the query into multiple ones -&amp;nbsp;but this slows down the form too much with the additional data connections.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Any help I can get on this would be greatly appreciated as this will be the template for several forms used by our company and completion of those is pending this one.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks all, &lt;/p&gt;
&lt;p&gt;- Shanty&lt;/p&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></item></channel></rss>