Hi All,
Though I have a previous thread similar to the current one. the only difference is each school has more 3 columns added to each school KG, Cycle1, Cycle2 and Cycle3 with Bus Assistant Name,ID and Mobile number.
The code above from a respected member works fine but what should I do with the added 3 columns to each school.
Please help me solve this.
here is the same workbook with 3 more columns added to each school: https://drive.google.com/file/d/0B9uKuwzDH_rQWW9GMXNKZVNuMkk/view?usp=sharing
Though I have a previous thread similar to the current one. the only difference is each school has more 3 columns added to each school KG, Cycle1, Cycle2 and Cycle3 with Bus Assistant Name,ID and Mobile number.
Code:
[COLOR=#333333]let[/COLOR] Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"Driver Name", "Driver ID", "Bus Number", "Bus Capacity"}, "Attribute", "Value"),
#"Added Conditional Column" = Table.AddColumn(#"Unpivoted Columns", "Custom", each if Text.Contains([Attribute], "Students") then [Value] else null ),
#"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "Custom.1", each if [Custom] = null then [Value] else null ),
#"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column1",{"Value"}),
#"Filled Down" = Table.FillDown(#"Removed Columns",{"Custom.1"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Custom] <> null)),
#"Replaced Value" = Table.ReplaceValue(#"Filtered Rows"," Students","",Replacer.ReplaceText,{"Attribute"}),
#"Renamed Columns" = Table.RenameColumns(#"Replaced Value",{{"Attribute", "School Type"}, {"Custom.1", "School Name"}}),
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns",{"Driver Name", "Driver ID", "Bus Number", "Bus Capacity", "School Type", "School Name", "Custom"}),
Finish = Table.RenameColumns(#"Reordered Columns",{{"Custom", "Total Students"}})
in [COLOR=#333333] Finish[/COLOR]
The code above from a respected member works fine but what should I do with the added 3 columns to each school.
Please help me solve this.
here is the same workbook with 3 more columns added to each school: https://drive.google.com/file/d/0B9uKuwzDH_rQWW9GMXNKZVNuMkk/view?usp=sharing
Last edited: