Knowledge Drop

Use Table Calculations to Capitalize First Letter of String (INITCAP)

  • 7 July 2021
  • 0 replies
  • 122 views

Userlevel 4

Last tested: Dec 13, 2019
 

Most SQL Dialects have a function like INITCAP() that automatically capitalizes the first character of a string. See:

https://docs.aws.amazon.com/redshift/latest/dg/r_INITCAP.html
https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions065.htm

We can do this using Table Calcs with an example like:

 

concat(upper(substring(${Dimension},1,1)),substring(${Dimension},2,length(${Dimension})))

 

We use concat to combine to substring functions.

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply