Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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!!

10 Replies
sunny_talwar

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?

maxgro
MVP
MVP

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)

Anonymous
Not applicable
Author

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

sunny_talwar

You can try what maxgro‌ gave below or this:

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

Anonymous
Not applicable
Author

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!!

sunny_talwar

This should work:

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

rupamjyotidas
Specialist
Specialist

This will also work

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

sunny_talwar

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

Anonymous
Not applicable
Author

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