# Custom code needed to subtract line item

**URL:** <https://community.hubspot.com/t/custom-code-needed-to-subtract-line-item/50658>\
**Category:** Data Hub\
**Created:** [February 1, 2022, 1:38am UTC](https://community.hubspot.com/t/custom-code-needed-to-subtract-line-item/50658 "2022-02-01T01:38:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erica11](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/erica11/32/82448_2.png) [@erica11](https://community.hubspot.com/u/erica11)\
**Post date:** [February 1, 2022, 1:38am UTC](https://community.hubspot.com/t/custom-code-needed-to-subtract-line-item/50658/1 "2022-02-01T01:38:18Z")

</div>

I am needing help with some custom code for Operations Hub.

I would like to subtract the net price of a line item with a SKU of PROFESSIONAL from the total deal amount and set a new property with this amount.

So the calculation would be:

Total deal amount - net price of PROFESSIONAL = The company property I would like to set which is called ‘Professional Packages Deal Amount’.

Hoping someone can help me as I have no knowledge of code. Thank you!

---

<div class="post-metadata">

**Author:** ![JenWeiss](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jenweiss/32/93582_2.png) [@JenWeiss](https://community.hubspot.com/u/JenWeiss)\
**Post date:** [February 1, 2022, 7:26pm UTC](https://community.hubspot.com/t/custom-code-needed-to-subtract-line-item/50658/2 "2022-02-01T19:26:55Z")

</div>

Hi @erica11 ,

Thank you for reaching out! I would like to tag our experts in on this [@Drew\_Cohen](https://community.hubspot.com/t5/user/viewprofilepage/user-id/16801) , @JenBergren , and @warrendavey . They would be able to give a bit more insight on this.

Best,

@JenWeiss
