<?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>Question Re: Distinct Value Extractor using Xpath to filter in Product Lifecycle Management Q&amp;A</title>
    <link>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448926#M10128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd also add a Transaction Input named "MatchColumnName", to make it completely flexible.  In this way, you could build a reusable transaction that could be leveraged from within other transactions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2007 15:17:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-20T15:17:23Z</dc:date>
    <item>
      <title>Distinct Value Extractor using Xpath to filter</title>
      <link>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaq-p/2448923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using a distinct value extractor and XPath to filter the results of a SQL query.  basically taking the dataset returned from SQL and filtering based on a ID.&lt;/P&gt;&lt;P&gt;the xpath looks similar to this&lt;/P&gt;&lt;P&gt;SQLQuery.Results{/Rowsets/Rowset/Row[(IDFIeld = '#Transaction.pID#')]/DescriptionField}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do, is filter based on a comma delimited list using an "In" statement simlar to SQL...example Select * from table where ID in (1,2,3) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible in Xpath?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW&lt;/P&gt;&lt;P&gt;I know I could do this at the DB/SQL level, but I am filtering the SQL dataset multiple times throughout the BL and am using Xpath to minimize the amount of data sent between XMII and the DB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 13:54:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaq-p/2448923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T13:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Value Extractor using Xpath to filter</title>
      <link>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448924#M10126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An expression like [(IDFIeld = '#Transaction.pID#') OR IDFled='&amp;lt;value2&amp;gt;' OR IDFled='&amp;lt;value3&amp;gt;'.......&amp;lt;valueN&amp;gt;] should work for you.&lt;/P&gt;&lt;P&gt;Only thing you need to figure out prior to using the DistinctValue action is reading the comma separated string where StringListToXML action would help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:05:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448924#M10126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Value Extractor using Xpath to filter</title>
      <link>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448925#M10127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jeff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can have composite conditions in XPath, as in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQLQuery.Results{/Rowsets/Rowset/Row[IDFIeld = '1' or IDFIeld = '2' or IDFIeld = '3']/DescriptionField}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would do is create a Local String property called "MatchExpression", and use the following for your Distinct selection expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQLQuery.Results{/Rowsets/Rowset/Row[#Local.MatchExpression#]/DescriptionField}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I would add logic to build the MatchExpression based on the list of items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way I would do this is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0) Assign empty string to Local.MatchExpression&lt;/P&gt;&lt;P&gt;1) Use StringListToXmlConverter on your comma separated list&lt;/P&gt;&lt;P&gt;2) Repeat for each item in the output&lt;/P&gt;&lt;P&gt;3) If not first item (Repeater.CurrentItem &amp;gt; 1), append " or " to Local.MatchExpression by assigning Local.MatchExpression &amp;amp; " or " to Local.MatchExpression&lt;/P&gt;&lt;P&gt;4) Append the delimited value (include the single quotes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, it is completely flexible and dynamic - you just pass in a comma-separated list and it all magically works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:08:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448925#M10127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Value Extractor using Xpath to filter</title>
      <link>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448926#M10128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd also add a Transaction Input named "MatchColumnName", to make it completely flexible.  In this way, you could build a reusable transaction that could be leveraged from within other transactions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:17:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448926#M10128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Value Extractor using Xpath to filter</title>
      <link>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448927#M10129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to both of you for your help.    I was able to add your logic to my app and it works great... Using a seperate transcation to modularize the application, was a great idea for reuse.   Next thing I know, your going to be showing me Inheritance and Polymorphism in Business logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 19:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/product-lifecycle-management-q-a/distinct-value-extractor-using-xpath-to-filter/qaa-p/2448927#M10129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T19:01:21Z</dc:date>
    </item>
  </channel>
</rss>

