Created
November 19, 2019 07:45
-
-
Save ImkeF/aa8b9f066be1defb9275773c680cc59d to your computer and use it in GitHub Desktop.
Transforms and converts a <code>date</code> field to YYYYMMDD - text field.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let func = | |
(DateToTransform as date) as text => | |
Text.From(Date.Year(DateToTransform)) | |
& Text.PadStart(Text.From(Date.Month(DateToTransform)),2,"0") | |
& Text.PadStart(Text.From(Date.Day(DateToTransform)),2,"0") , | |
documentation = [ | |
Documentation.Name = " Date.ToDateKey ", | |
Documentation.Description = " Transforms and converts a <code>date</code> field to YYYYMMDD - text field. ", | |
Documentation.LongDescription = " Transforms and converts a <code>date</code> field to YYYYMMDD - text field. ", | |
Documentation.Category = " Date ", | |
Documentation.Source = " www.TheBIccountant.com . ", | |
Documentation.Version = " 1.0 ", | |
Documentation.Author = " Imke Feldmann: www.TheBIccountant.com. ", | |
Documentation.Examples = {[Description = " ", | |
Code = " Date.ToDateKey(#date(2019,1,1) ", | |
Result = " ""20190101"" "]}] | |
in | |
Value.ReplaceType(func, Value.ReplaceMetadata(Value.Type(func), documentation)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment