Skip to main content
Solved

DQS - camel case

  • September 12, 2023
  • 4 replies
  • 53 views

Forum|alt.badge.img+1

Is there a function or custom ways to convert strings into camel case on DQS - Data Quality services?

Best answer by AKislyakov

Hi @sgilla,

for such case there is an optional parameterĀ leaveExcsAsTheyAre inĀ capitalizeWithException(stringĀ srcStr [,Ā booleanĀ leaveExcsAsTheyAre=false] [,Ā stringĀ exc]...)
Ā 

If the parameter leaveExcsAsTheyAre is set to true, the transformation leaves words from exc as they are in the string srcStr, i.e. without any change.

Ā 

So, you want something likeĀ 
capitalizeWithException(upper(pur_city), true, 'BLVD')

4 replies

Forum|alt.badge.img+2
  • Ataccamer
  • September 13, 2023

There is capitilize function with following description
Ā 

Transforms all words in the string srcStr in the following manner: The first character of each word to upper case and all following characters to lower case. A word consists of alphabetic characters (letters). All other characters are considered separators.

Ā 

Ā 


Forum|alt.badge.img+1
  • Author
  • Data Pioneer
  • September 13, 2023

Thank you.


Forum|alt.badge.img+1
  • Author
  • Data Pioneer
  • September 13, 2023

The CapitalizewithException() does the same but convers exceptions into lower caseĀ 

example:Ā 

capitalizeWithException(upper(out_name),'BLVD')

out_name:’123 capital BLVD’

returns: ’123 Capital blvd’

Is there a function I can use along with this, which would keep ā€˜BLVD’ as is @AKislyakovĀ ?


Forum|alt.badge.img+2
  • Ataccamer
  • Answer
  • October 1, 2023

Hi @sgilla,

for such case there is an optional parameterĀ leaveExcsAsTheyAre inĀ capitalizeWithException(stringĀ srcStr [,Ā booleanĀ leaveExcsAsTheyAre=false] [,Ā stringĀ exc]...)
Ā 

If the parameter leaveExcsAsTheyAre is set to true, the transformation leaves words from exc as they are in the string srcStr, i.e. without any change.

Ā 

So, you want something likeĀ 
capitalizeWithException(upper(pur_city), true, 'BLVD')