<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/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>How can I extract values with duplicate criteriaCode? (Remove one item and leave other)</title><link>https://community.appian.com/discussions/f/general/35465/how-can-i-extract-values-with-duplicate-criteriacode-remove-one-item-and-leave-other</link><description>Local variables show there is two items with the same criteriaCode. How can I remove one item and leave the other with the same code?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can I extract values with duplicate criteriaCode? (Remove one item and leave other)</title><link>https://community.appian.com/thread/138167?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 14:52:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0f402d3e-7d1e-458f-a05c-3bfdcd8125b7</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;A working code example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: {
    a!map(id:1, crit: &amp;quot;a&amp;quot;),
    a!map(id:2, crit: &amp;quot;a&amp;quot;),
    a!map(id:3, crit: &amp;quot;b&amp;quot;),
    a!map(id:4, crit: &amp;quot;b&amp;quot;),
    a!map(id:5, crit: &amp;quot;b&amp;quot;),
  },
  a!forEach(
    items: union(local!data.crit, local!data.crit),
    expression: displayvalue(fv!item, local!data.crit, local!data, {})
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I extract values with duplicate criteriaCode? (Remove one item and leave other)</title><link>https://community.appian.com/thread/138165?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 14:48:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e31de301-e9de-477a-9203-17f6c36e6260</guid><dc:creator>venkatrea696188</dc:creator><description>&lt;p&gt;I saw your data Only code is repeating remaining things are changing for example criteriacode :C020 had 3 rows in which cdeCall is different , are you sure you call them duplicates??.&amp;nbsp;&lt;/p&gt;
[quote userid="274702" url="~/discussions/f/general/35465/how-can-i-extract-values-with-duplicate-criteriacode-remove-one-item-and-leave-other/138157"]Question is, how do you decide which item to pick?[/quote]
&lt;p&gt;Union will work but ,I too have this question...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I extract values with duplicate criteriaCode? (Remove one item and leave other)</title><link>https://community.appian.com/thread/138157?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 13:30:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e57fdb6a-11c8-415c-96ee-c3f5e5218b9d</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Using union() and count() you can detect any duplicates. Then, for each item in the union, you can just pick a single item from the list. displayvalue() comes to my mind.&lt;/p&gt;
&lt;p&gt;Question is, how do you decide which item to pick?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I extract values with duplicate criteriaCode? (Remove one item and leave other)</title><link>https://community.appian.com/thread/138150?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 12:20:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d05bdc6-e737-4fc6-b27c-1c4c32496338</guid><dc:creator>dkovacevic</dc:creator><description>&lt;p&gt;The requirement is to remove one of the duplicate items from the local!combinedCriteriaResults&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1721132439457v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I extract values with duplicate criteriaCode? (Remove one item and leave other)</title><link>https://community.appian.com/thread/138149?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 12:06:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f1fcce0c-6f1f-4714-8dbe-11d48f66ee8d</guid><dc:creator>venkatrea696188</dc:creator><description>&lt;p&gt;You can use &lt;strong&gt;union()&amp;nbsp;&lt;/strong&gt; Function, but can you tell me more about requirement .&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!test1:{1,2,3,4},
  local!test2:{1,2,3,4,5,6},
  local!combined:a!flatten({local!test1,local!test2}),
  union(local!combined,local!combined)
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>