10 Replies Latest reply: Oct 13, 2016 11:00 AM by Rupam Das

# Subfield Function

Hello Everyone

I need your help in Subfield function. I have name For E.g.

AR_b_Business_bQPT . I need the name as AR_Business_QPT

I just the subfield function and concatenate the various parts but still finding the issues

Please help

Thanks!!

• ###### Re: Subfield Function

So you want to remove b? but how do you even decide which b's to remove? Can you add more values so that we can see the logic clearly?

• ###### Re: Subfield Function

Sir, I have two b's. I want to get the specific part.Can it is possible to get the below result

AR_b_Business_bQPT = AR_Business_QPT

Please suggest

• ###### Re: Subfield Function

You can try what maxgro gave below or this:

Replace(Replace('AR_b_Business_bQPT', '_b_', '_'), 'bQPT', 'QPT')

• ###### Re: Subfield Function

Could you post some other test data?

=subfield('AR_b_Business_bQPT', '_', 1)

& '_' & subfield('AR_b_Business_bQPT', '_', -2)

& '_' & subfield('AR_b_Business_bQPT', '_b', -1)

• ###### Re: Subfield Function

Thanks Sunny and Maxgro..

The above formula works well.. if the value is like that

AR_b_Business_bQPT = AR_Business_QPT_QPT

AR_bFS_b_Business_bQPT = AR_FS_Business_QPT

Can is it possible to make it dynamic so that it works on every part.

Thanks!!

• ###### Re: Subfield Function

This should work:

Replace(Replace('AR_b_Business_bQPT', '_b_', '_'), '_b', '_')

• ###### Re: Subfield Function

This will also work

Replace(Replace('AR_bFS_b_Business_bQPT', 'b', ''),'__','_')

• ###### Re: Subfield Function

Problem with replacing b is that what if have b used elsewhere. So I won't really touch b alone.

• ###### Re: Subfield Function

Oops. Point noted.  Yep you are right :-)

• ###### Re: Subfield Function

Do you mean that you need some kind of a 'wild card', so you can replace '_b' with '_' for every possible text ?