Forum Discussion
JonSwed
Advocate II
6 years agoUsing LEN, need some help altering the length of string it returns
Hi all!
I have a formula I'm using to create a new column where the first letter of a string is made upper case.
Looks like this:
Region rewrite =
(
(UPPER( left([Website region],1) ))
&
(right ( ('Site appearance'[Website region]), LEN( ('Site appearance'[Website region]) ) ) )
)
But this returns 'Jjordan'. What I need is 'Jordan'. I've been trying to use -1 to alter the LEN function but without success, any help much appreciated thanks!
Try this
Region rewrite = ( ( UPPER ( LEFT ( [Website region], 1 ) ) ) & ( MID( ( 'Site appearance'[Website region] ),2, LEN ( ( 'Site appearance'[Website region] ) )-1 ) ) )
2 Replies
- amitchandak
Super User
JonSwed , Try like
Region rewrite =
(
(UPPER( left([Website region],1) ))
&
(right ( ('Site appearance'[Website region]), (LEN('Site appearance'[Website region]) -1) ) ))
- nandukrishnavs
Community Champion
Try this
Region rewrite = ( ( UPPER ( LEFT ( [Website region], 1 ) ) ) & ( MID( ( 'Site appearance'[Website region] ),2, LEN ( ( 'Site appearance'[Website region] ) )-1 ) ) )