Forum Discussion
joshua1990
3 years agoPost Prodigy
Add Leading Zeros within String
Hi experts!
I have a column with year and week information in this format:
Year-Week
2022-01
2023-03
2023-3
2023-5
As you can see for the week number the...
- 3 years ago
Insert this statement
= Table.ReplaceValue(Source, each [#"Year-Week"], each if Text.Length(Text.AfterDelimiter([#"Year-Week"],"-"))=1 then Text.ReplaceRange([#"Year-Week"],5,1,Text.PadStart(Text.End([#"Year-Week"],1),2,"0")) else [#"Year-Week"], Replacer.ReplaceValue,{"Year-Week"})
Vijay_A_Verma
3 years agoMost Valuable Professional
Insert this statement
= Table.ReplaceValue(Source, each [#"Year-Week"], each if Text.Length(Text.AfterDelimiter([#"Year-Week"],"-"))=1 then Text.ReplaceRange([#"Year-Week"],5,1,Text.PadStart(Text.End([#"Year-Week"],1),2,"0")) else [#"Year-Week"], Replacer.ReplaceValue,{"Year-Week"})