itsnotaboutthecell

Power Query M - ASCII Character Codes, Character.ToNumber

Feb 3rd, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. /*
  2. Original Post: https://www.reddit.com/r/excel/comments/7sh5cn/power_query_to_create_custom_column_which_assigns/
  3. Created By: Alex Powers
  4. Website: http://www.itsnotaboutthecell.com
  5. */
  6.  
  7. let
  8. Source = Excel.CurrentWorkbook(){[Name="SupervisorTable"]}[Content],
  9. #"Changed Type" = Table.TransformColumnTypes(Source,{{"Employee Number", Int64.Type}, {"Last Name Start", type text}, {"Last Name End", type text}, {"First Name", type text}, {"Last Name", type text}}),
  10. #"Custom: Last Name Start Char" = Table.AddColumn(#"Changed Type", "Last Name Start Char", each Character.ToNumber([Last Name Start])),
  11. #"Custom: Last Name End Char" = Table.AddColumn(#"Custom: Last Name Start Char", "Last Name End Char", each Character.ToNumber([Last Name End])),
  12. #"Array: Start Char..End Char" = Table.AddColumn(#"Custom: Last Name End Char", "Character Code Range", each {[Last Name Start Char]..[Last Name End Char]}),
  13. #"Expand: Char Range" = Table.ExpandListColumn(#"Array: Start Char..End Char", "Character Code Range")
  14. in
  15. #"Expand: Char Range"
Add Comment
Please, Sign In to add comment