Forum Discussion
Mlemmers
Helper I
2 years agoProper Case function with exception of prepositions in M
Hello smart people, I'd like to have a function that turns my column headers into proper case with the exception of prepositions. So far I tried this but it still capitalises prepositions. At t...
- 2 years ago
Hi,
Step1 = Table.TransformColumnNames(
Source,
each Text.Combine(
List.ReplaceMatchingItems(
List.Transform(Text.Split(_,"_"), Text.Proper),
{{"In","in"}, {"To", "to"}, {"For", "for"}}),
" ")),
Step2 = Table.TransformColumnNames(
Step1,
each if Text.EndsWith(_,"id")
then Text.BeforeDelimiter(_,"id",RelativePosition.FromEnd)&" ID"
else _)Stéphane
slorin
Super User
2 years agoHi,
Step1 = Table.TransformColumnNames(
Source,
each Text.Combine(
List.ReplaceMatchingItems(
List.Transform(Text.Split(_,"_"), Text.Proper),
{{"In","in"}, {"To", "to"}, {"For", "for"}}),
" ")),
Step2 = Table.TransformColumnNames(
Step1,
each if Text.EndsWith(_,"id")
then Text.BeforeDelimiter(_,"id",RelativePosition.FromEnd)&" ID"
else _)
Stéphane
- Mlemmers2 years ago
Helper I
I get a We cannot convert the value to type Table error