# Easy Way to get the Set Difference between datasets?

**URL:** <https://forum.inductiveautomation.com/t/easy-way-to-get-the-set-difference-between-datasets/21214>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [December 4, 2018, 4:22pm UTC](https://forum.inductiveautomation.com/t/easy-way-to-get-the-set-difference-between-datasets/21214 "2018-12-04T16:22:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nick.schuetz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick.schuetz/32/6160_2.png) [@nick.schuetz](https://forum.inductiveautomation.com/u/nick.schuetz)\
**Post date:** [December 4, 2018, 4:50pm UTC](https://forum.inductiveautomation.com/t/easy-way-to-get-the-set-difference-between-datasets/21214/2 "2018-12-04T16:50:51Z")

</div>

If you put the ids from each dataset into a list, you could use set intersection() functions found [here](https://www.programiz.com/python-programming/methods/set/intersection)  
So still a couple loops, but get the intersection pretty simply.  
Though I do wonder why you don’t perform this at the database level with different joins?

Edit for Clarity:  
I think the arguments intersection expects are called sets, you can find an example from the forum [here](http://forum.inductiveautomation.com/t/switching-user-to-another-user-source/17051)

---

_[View the full topic](https://forum.inductiveautomation.com/t/easy-way-to-get-the-set-difference-between-datasets/21214)._
