sandy666
05-09-2020, 09:16 PM
From trash to 1NF
NumberDateOn HoldTotalCompanyNumberDateOn HoldTotal
Currency:AME03 AMERICAN EXPRESSER_AMEX_2019-2020_72/25/2020N
13691.4
AME03 AMERICAN EXPRESSAME03 AMERICAN EXPRESSER_AMEX_2019-2020_83/25/2020N
6360.78
ER_AMEX_2019-2020_72/25/2020N
13,691.40AMG01 AMERIGAS PROPANE
8046351133/30/2020N
179.25
ER_AMEX_2019-2020_83/25/2020N
6,360.78
20,052.18
6,725.00
0
0
AMG01 AMERIGAS PROPANE
8046351133/30/2020N
179.25
179.25
179.25
0
0
let
Source = Excel.CurrentWorkbook(){[Name="Table13"]}[Content],
IF = Table.AddColumn(Source, "Company", each if [Date] = null then [Number] else null),
Fill = Table.FillDown(IF,{"Company"}),
Filter = Table.SelectRows(Fill, each ([Date] <> null) and ([On Hold] = "N")),
TSC = Table.SelectColumns(Filter,{"Company", "Number", "Date", "On Hold", "Total"})
in
TSC
NumberDateOn HoldTotalCompanyNumberDateOn HoldTotal
Currency:AME03 AMERICAN EXPRESSER_AMEX_2019-2020_72/25/2020N
13691.4
AME03 AMERICAN EXPRESSAME03 AMERICAN EXPRESSER_AMEX_2019-2020_83/25/2020N
6360.78
ER_AMEX_2019-2020_72/25/2020N
13,691.40AMG01 AMERIGAS PROPANE
8046351133/30/2020N
179.25
ER_AMEX_2019-2020_83/25/2020N
6,360.78
20,052.18
6,725.00
0
0
AMG01 AMERIGAS PROPANE
8046351133/30/2020N
179.25
179.25
179.25
0
0
let
Source = Excel.CurrentWorkbook(){[Name="Table13"]}[Content],
IF = Table.AddColumn(Source, "Company", each if [Date] = null then [Number] else null),
Fill = Table.FillDown(IF,{"Company"}),
Filter = Table.SelectRows(Fill, each ([Date] <> null) and ([On Hold] = "N")),
TSC = Table.SelectColumns(Filter,{"Company", "Number", "Date", "On Hold", "Total"})
in
TSC