<?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>Given two datasubsets how do I intersect them</title><link>https://community.appian.com/discussions/f/data/13393/given-two-datasubsets-how-do-i-intersect-them</link><description>Given two datasubsets, is there a way for me to generate a third datasubset that is the intersection of their data?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Given two datasubsets how do I intersect them</title><link>https://community.appian.com/thread/60682?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 10:15:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6669370-7437-4126-87a0-d7c144259551</guid><dc:creator>sagarl511</dc:creator><description>You can use intersection function(casting might be required) - &lt;br /&gt;
&lt;br /&gt;
todatasubset(intersection(dataSubset1.data,dataSubset2.data))&lt;br /&gt;
&lt;br /&gt;
For e.g. - intersection({{a:1,b:1},{a:1,b:2}},{{a:1,b:2}})&lt;br /&gt;
&lt;br /&gt;
returns - {a:1,b:2}&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Given two datasubsets how do I intersect them</title><link>https://community.appian.com/thread/60593?ContentTypeID=1</link><pubDate>Sat, 22 Sep 2018 05:43:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3f7a68e5-b549-4c46-aff6-47a80b3422d1</guid><dc:creator>sandeepd</dc:creator><description>Hi  ,&lt;br /&gt;
&lt;br /&gt;
Yes, you can generate third datasubset with merging two datasubset.&lt;br /&gt;
Create expression with two local variables, that can store your datasubsets, like local!a and local!b. Merge their .data properties with Merge function.This will create another list for you and with the help of todatasubset function, you can create third datasubset.&lt;br /&gt;
&lt;br /&gt;
todatasubset(merge(local!a.data,local!b.data))).&lt;br /&gt;
&lt;br /&gt;
Suggestion: Do not use use merge function for huge data or list. You will observe performance issue in your code. This is not recommended. What you can do, create a view in database for this, and call that view in expression with query entity.&lt;br /&gt;
&lt;br /&gt;
Hope it helps you.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Sandeep&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Given two datasubsets how do I intersect them</title><link>https://community.appian.com/thread/60589?ContentTypeID=1</link><pubDate>Sat, 22 Sep 2018 03:21:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:993acdca-b278-439b-9821-d7b634363da6</guid><dc:creator>Swapna Chella</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
If the two data subsets of same type you can use merge and generate third data subset of same type. Suppose both are different data subsets then you need to construct dictionary to form the third data subset &lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Swapna&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>