# Expression Question for Removing Portion of Part Number

**URL:** <https://forum.inductiveautomation.com/t/expression-question-for-removing-portion-of-part-number/9567>\
**Category:** Ignition\
**Created:** [January 19, 2015, 6:41pm UTC](https://forum.inductiveautomation.com/t/expression-question-for-removing-portion-of-part-number/9567 "2015-01-19T18:41:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pknox](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pknox](https://forum.inductiveautomation.com/u/pknox)\
**Post date:** [January 19, 2015, 6:41pm UTC](https://forum.inductiveautomation.com/t/expression-question-for-removing-portion-of-part-number/9567/1 "2015-01-19T18:41:25Z")

</div>

We have a query that returns part number CC830750-000395-849 inside a label. We have another label and only want to display the CC830750. The part # CC830750-000395-849 is contained in {Root Container.Label 2.text}  
Is there a way to only display the base part code in that second label by writing an expression or something?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 19, 2015, 6:55pm UTC](https://forum.inductiveautomation.com/t/expression-question-for-removing-portion-of-part-number/9567/2 "2015-01-19T18:55:17Z")

</div>

If the format stays the same (using the dash separator), you can try this:

```auto
left({Root Container.Label 2.text},indexOf({Root Container.Label 2.text},"-"))
```

---

<div class="post-metadata">

**Author:** ![pknox](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pknox](https://forum.inductiveautomation.com/u/pknox)\
**Post date:** [January 19, 2015, 7:02pm UTC](https://forum.inductiveautomation.com/t/expression-question-for-removing-portion-of-part-number/9567/3 "2015-01-19T19:02:19Z")

</div>

Perfect! Thanks for the help.
