Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

hammermill21
Contributor II

Removing Underscores & Making Everything Caps in Data

Hello,

I'm pulling in data that looks like this:

briggs_stration_8kw_

I want to remove the underscores and just have spaces along with Putting everything caps. How can I go about doing this in the backend?

Thank you!!

1 Solution

Accepted Solutions

Re: Removing Underscores & Making Everything Caps in Data

In addition to ogster1974‌'s response, you may want to use Capitalize() instead of Upper() if you only want the first letter of each word capitalized.  You may also want to use Trim() to get rid of any leading or trailing spaces:

Trim(Capitalize(Replace(YourField, '_', ' ')))

8 Replies
ogster1974
Honored Contributor II

Re: Removing Underscores & Making Everything Caps in Data

Upper(Replace('fieldname','_',' '))

Re: Removing Underscores & Making Everything Caps in Data

In addition to ogster1974‌'s response, you may want to use Capitalize() instead of Upper() if you only want the first letter of each word capitalized.  You may also want to use Trim() to get rid of any leading or trailing spaces:

Trim(Capitalize(Replace(YourField, '_', ' ')))

hammermill21
Contributor II

Re: Removing Underscores & Making Everything Caps in Data

What if I want to do if for multiple ones?

ogster1974
Honored Contributor II

Re: Removing Underscores & Making Everything Caps in Data

Upper() will force all letters to be capitals.

ramasaisaksoft
Valued Contributor III

Re: Removing Underscores & Making Everything Caps in Data

Syn:-PurgeChar(<feildname>, '[chars to remove]')


Upper(purgechar(FieldName,'_')) as Fieldname1

else

=upper(PurgeChar ('briggs_stration_8kw_','_'))


hammermill21
Contributor II

Re: Removing Underscores & Making Everything Caps in Data

Hi Nicole,

Thank you!

What if I want to do this change to multiple items like,

 

spectrum__1250ds4
caterpillar__300
onan__dfej5745347_
ford_15kw

So it's not just for one item I need to do this for a few different ones.

Thank you!

OmarBenSalem
Esteemed Contributor

Re: Removing Underscores & Making Everything Caps in Data

all the above methods, will change every value of ur field..

one advice though: please try the proposed solutions before wondering if they would work

hammermill21
Contributor II

Re: Removing Underscores & Making Everything Caps in Data

Thanks Omar, I did but when trying to do it for more than one I was getting errors... But thanks....

Community Browser