ilcaa
New member
- Joined
- Jun 15, 2018
- Messages
- 10
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- 2016
i have 6 tables, the Date field is all in Column 1, i created a transform on this date field since it comes in as Text. I want to apply the same transform on the other 5 tables since the 1st column is exactly the same. The transformation works on the other tables EXCEPT the last step, which is the reordering of the date field as the first column. This last step fails since there are slightly different column names
i tried using wildcards or leaving the other columns names out in the last step but it doenst work (moves to first column). Any ideas?
i tried using wildcards or leaving the other columns names out in the last step but it doenst work (moves to first column). Any ideas?
Code:
let
Source = Sql.Databases("SL01P"),
Validation = Source{[Name="Validation"]}[Data],
dbo_ValidationReport_AccountHierarchy = Wallet_Validation{[Schema="dbo",Item="ValidationReport_AccountHierarchy"]}[Data],
#"Split Column by Position" = Table.SplitColumn(Table.TransformColumnTypes(dbo_ValidationReport_AccountHierarchy, {{"PeriodID", type text}}, "en-US"), "PeriodID", Splitter.SplitTextByPositions({0, 4}, false), {"PeriodID.1", "PeriodID.2"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Position",{{"PeriodID.1", Int64.Type}, {"PeriodID.2", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date", each Number.ToText([PeriodID.2])&"/"&Number.ToText([PeriodID.1])),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Date", type date}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"PeriodID.1", "PeriodID.2"}),
[B] #[/B] [B] #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Date", "BankID", "Open_Accounts", "New_Open_Accounts", "Existing_Open_Accounts"})[/B]
in
#"Reordered Columns"