Forum Discussion
MJEnnis
Resolver III
4 years agoReplace date.time values in one column conditioned upon ID in another column
Due to a human data entry error that cannot be corrected at the source, I have to add one year to a date/time stamp for a about 10 events among 25,000. Fortunately, the events in question have a uniq...
- 4 years ago
Change your Replacer.ReplaceText with Replacer.ReplaceValue.
(I didn't test your duration addition)
= Table.ReplaceValue(#"Renamed Columns1", each [Date], each if [ID] = 36 then [Date] + #duration(365,0,0,0) else [Date], Replacer.ReplaceValue,{"Date"})You will still run into issues with all of the types being reset to 'Any' with this method which is why I prefer the add column method.
See this post...
MJEnnis
Resolver III
4 years agoAlso, can you think of any reason why the code I tried isn't working?
KNP
Super User
4 years agoChange your Replacer.ReplaceText with Replacer.ReplaceValue.
(I didn't test your duration addition)
= Table.ReplaceValue(#"Renamed Columns1", each [Date], each if [ID] = 36 then [Date] + #duration(365,0,0,0) else [Date], Replacer.ReplaceValue,{"Date"})
You will still run into issues with all of the types being reset to 'Any' with this method which is why I prefer the add column method.
See this post...