BAQ add column with part number prefixes

I am very, very new to BAQ. I want to create a column in the BAQ that is populated with the suffixes of our part numbers. Our part numbers begin with a three-letter suffix + hyphen + five-digit number. Like these…
ASO-12345
MSO-12345
WSO-12345
I need a column of just the suffixes, i.e., ASO, MSO, WSO, etc. I assume I would create a calculated field, but have no idea what the code would be. I’ve searched for answers and found nothing close to what I need. Thank you in advance for your consideration.

Good Afternoon

You could use
substring(EnterYourFieldHere,1 ,3) to find the Prefix. ( Prefix being the first 3 characters)

Dean

1 Like

Prefix of course…sorry.
I entered: Substring(Part_PartNum,1,3) and get 'invalid column name ‘part_partnum’. So, I enter the column label: SHOP ORDER NUMBER and get 'incorrect syntax near the keyword ‘ORDER’. So, then I tried SHOP_ORDER_NUMBER and get 'invalid column name ‘SHOP_ORDER_NUMBER’.

UPDATE: I figured it out, I needed to enter: Substring(Part.PartNum,1,3).

Dean, thank you so very much!

If the dash is not always the 4th character, you can use Charindex(‘-’, PartNum) to find it (make an int field, DashPos perhaps, defined as that). Then use Substring(PartNum, (DashPos + 1), Len(PartNum) - DashPos) to get the rest. I don’t remember if charindex is in the BAQ UI, but substring definitely is.

I appreciate your response. While you responded, I found a solution. I need to use Part.PartNum not Part_PartNum.