# Subtract List A from List B to create List C

**URL:** <https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686>\
**Category:** Packages\
**Created:** [October 30, 2014, 8:10pm UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686 "2014-10-30T20:10:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wulfrum](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@Wulfrum](https://forum.dynamobim.com/u/Wulfrum)\
**Post date:** [October 30, 2014, 8:10pm UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/1 "2014-10-30T20:10:54Z")

</div>

I need help guys, I’m still learning all the nodes functions I have no idea how to do this. Now, I’ve been cracking my head since yesterday trying to find out how to do a simple operation like this on lists. I have a couple of Lists, **List A** (0,1,2,3,4,5) and **List B** (1,2,3,4,5,6). I want to combine these lists into **List C** and while doing so I would also like to do a simple operation like \<span\>Subtract\</span\> List A from List B. I tried using the operations function **“x-y”** but it doesn’t seem to work for arrays. An elaborate explanation with the solution would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c550ed42453f927febfd2bb94d4388fbcf36b9a6.png) [@system](https://forum.dynamobim.com/u/system)\
**Post date:** [October 30, 2014, 8:53pm UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/2 "2014-10-30T20:53:45Z")

</div>

You mean something like this?

![List A- List B](http://dynamobim.org/wp-content/uploads/forum-assets/scdaitscdaarchitects-com/10/31/List-A-List-B-170x300.jpg)

---

<div class="post-metadata">

**Author:** ![Wulfrum](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@Wulfrum](https://forum.dynamobim.com/u/Wulfrum)\
**Post date:** [October 30, 2014, 9:27pm UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/3 "2014-10-30T21:27:07Z")

</div>

Yes! but I’m trying to do it from a List of selected Revit Elements that has its own set of parameters. and it doesn’t seem to work from those.

The selected Revit Element has Parameters A & B… i want to generate Parameter C from them using Dynamo so that I can export the results to excel.  
\<span style=“color: #3366ff;”\> _--\> List A has parameter A (length)_\</span\>

\<span style=“color: #3366ff;”\>_– **Revit Element** – --\> Subtract List A from List B to generate List C with the difference of A-B = C (length)_\</span\>

\<span style=“color: #3366ff;”\> _--\> List B has parameter B (length)_\</span\>

&nbsp;

I need to Subtract **Parameter A** from **Parameter B** to get **Parameter C.**

&nbsp;

---

<div class="post-metadata">

**Author:** ![Wulfrum](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@Wulfrum](https://forum.dynamobim.com/u/Wulfrum)\
**Post date:** [October 30, 2014, 9:28pm UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/4 "2014-10-30T21:28:38Z")

</div>

Yes! but I’m trying to do it from a List of selected Revit Elements that has its own set of parameters. and it doesn’t seem to work from those.

The selected Revit Element has Parameters A & B… i want to generate Parameter C from them using Dynamo so that I can export the results to excel.

![Capture](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/4/44bb9cbbe2a06fa2a0e2a16e0c1adf1118f15f12.png)

&nbsp;

I need to Subtract **Parameter A** from **Parameter B** to get **Parameter C.**

&nbsp;

&nbsp;

Edit: Sorry for the double post I don’t know how to delete my previous post…

---

<div class="post-metadata">

**Author:** ![Ritesh\_Chandawar](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Ritesh\_Chandawar](https://forum.dynamobim.com/u/Ritesh_Chandawar)\
**Post date:** [October 31, 2014, 12:31am UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/5 "2014-10-31T00:31:57Z")

</div>

Hello [Wulfrum](http://dynamobim.org/forums/users/edrick-paguiogmail-com/ "View Wulfrum's profile"),

As I don’t have your graph but I am guessing, the value which you are getting for Parameter is must be with units mention in it.

Generally after getting Parameter value, we need to extract Number from it, if we are going to pass that value to another Node.

See attached graph for more details.

Do let me know if this doesn’t solve your problem.

Thanks,

Ritesh

![ParameterValueInNumber](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/f/f2dbd0434bc4b74047ce753a565a8dc423fdcfed.png)

---

<div class="post-metadata">

**Author:** ![Wulfrum](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@Wulfrum](https://forum.dynamobim.com/u/Wulfrum)\
**Post date:** [October 31, 2014, 12:37am UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/6 "2014-10-31T00:37:21Z")

</div>

Thanks Ritesh! this solves my problem 😃

---

<div class="post-metadata">

**Author:** ![Wulfrum](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@Wulfrum](https://forum.dynamobim.com/u/Wulfrum)\
**Post date:** [November 3, 2014, 8:11pm UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/7 "2014-11-03T20:11:41Z")

</div>

Hi Ritesh

Now I have another problem, I’m trying to multiply **List A** with **List B.** However, the SIUnit.Value does not seem to help me this time.

I keep getting this error.

![Error](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/a/aff13a4af1f6a5e0d4794e7dfb5b6865d5311b70.png)

---

<div class="post-metadata">

**Author:** ![Colin\_McCrone](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@Colin\_McCrone](https://forum.dynamobim.com/u/Colin_McCrone)\
**Post date:** [November 4, 2014, 1:51am UTC](https://forum.dynamobim.com/t/subtract-list-a-from-list-b-to-create-list-c/686/8 "2014-11-04T01:51:58Z")

</div>

Hi Wulfrum, check your list structure. At least one of your lists is not flat. The \* operator works just like you would expect it to, but it needs to be on a flat list. Use the \* node and map it to nested lists if you want to keep an existing structure.
