Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
deepanshu_chamo1
New Contributor

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

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?

MVP
MVP

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)

deepanshu_chamo1
New Contributor

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')

deepanshu_chamo1
New Contributor

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', '_')

rupamjyotidas
Valued Contributor

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.

filip_duchateau
Contributor II

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 ?

Community Browser