gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I am trying to pull the first character and then the first character after a delimitator - then concatenate those two. Is there a better more efficient way then doing all these steps? This is Power Query
let
Source = CostSourceData,
#"Removed Other Columns" = Table.SelectColumns(Source,{"ID", "Vendor", "[MF] Created by"}),
#"Duplicated Column" = Table.DuplicateColumn(#"Removed Other Columns", "[MF] Created by", "[MF] Created by - Copy"),
#"Inserted First Characters" = Table.AddColumn(#"Duplicated Column", "First Characters", each Text.Start([#"[MF] Created by - Copy"], 1), type text),
#"Inserted Text After Delimiter" = Table.AddColumn(#"Inserted First Characters", "Text After Delimiter", each Text.AfterDelimiter([#"[MF] Created by - Copy"], "."), type text),
#"Inserted First Characters1" = Table.AddColumn(#"Inserted Text After Delimiter", "First Characters.1", each Text.Start([Text After Delimiter], 1), type text),
#"Added Custom1" = Table.AddColumn(#"Inserted First Characters1", "UserID", each [First Characters]&[First Characters.1]),
#"Added Custom" = Table.AddColumn(#"Added Custom1", "File Name", each [ID] &"-"&[Vendor]&"-"&[UserID]),
#"Removed Other Columns1" = Table.SelectColumns(#"Added Custom",{"File Name"}),
#"Removed Duplicates" = Table.Distinct(#"Removed Other Columns1")
in
#"Removed Duplicates"
#"Removed Duplicates"
let
Source = CostSourceData,
#"Removed Other Columns" = Table.SelectColumns(Source,{"ID", "Vendor", "[MF] Created by"}),
#"Duplicated Column" = Table.DuplicateColumn(#"Removed Other Columns", "[MF] Created by", "[MF] Created by - Copy"),
#"Inserted First Characters" = Table.AddColumn(#"Duplicated Column", "First Characters", each Text.Start([#"[MF] Created by - Copy"], 1), type text),
#"Inserted Text After Delimiter" = Table.AddColumn(#"Inserted First Characters", "Text After Delimiter", each Text.AfterDelimiter([#"[MF] Created by - Copy"], "."), type text),
#"Inserted First Characters1" = Table.AddColumn(#"Inserted Text After Delimiter", "First Characters.1", each Text.Start([Text After Delimiter], 1), type text),
#"Added Custom1" = Table.AddColumn(#"Inserted First Characters1", "UserID", each [First Characters]&[First Characters.1]),
#"Added Custom" = Table.AddColumn(#"Added Custom1", "File Name", each [ID] &"-"&[Vendor]&"-"&[UserID]),
#"Removed Other Columns1" = Table.SelectColumns(#"Added Custom",{"File Name"}),
#"Removed Duplicates" = Table.Distinct(#"Removed Other Columns1")
in
#"Removed Duplicates"
#"Removed Duplicates"