Forum Discussion
Grouping Column
- Anonymous2 years ago
Hi FJS
This error indicates that you are trying to convert a text type value into Number type. This usually happens in the Changed type step. Please check whether the value "FC0001" appears in "PCI" column. If so, change its column type to text instead.
Change below step from
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"PCI", Int64.Type}, {"PCI Name", type text}, {"PCI Name_1", type text}, {"SiteIn", type text}, {"SiteIn_2", type text}}),
to
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"PCI", type text}, {"PCI Name", type text}, {"PCI Name_1", type text}, {"SiteIn", type text}, {"SiteIn_2", type text}}),
Hi Anonymous m_dekorte ,
I tried pasting code in my file but it is giving me error. IT looks like i have the number in the name column.
Below is the code and snippet of the error.
Error snippet
Code:
let
Source = Excel.CurrentWorkbook(){[Name="Table7"]}[Content],
#"Removed Columns" = Table.RemoveColumns(Source,{"Column4", "Column5", "Column6", "Column7", "Column10", "Column11", "Column12", "Column13", "Column14"}),
#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Column1", "Column2", "Column8", "Column3", "Column9"}),
#"Removed Top Rows" = Table.Skip(#"Reordered Columns",1),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"PCI", Int64.Type}, {"PCI Name", type text}, {"PCI Name_1", type text}, {"SiteIn", type text}, {"SiteIn_2", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"PCI Name", "Old PCM Name"}, {"PCI Name_1", "New PCM Name"}, {"SiteIn", "Old SiteM"}, {"SiteIn_2", "New SiteM"}}),
UnpivotOthers = Table.UnpivotOtherColumns(#"Renamed Columns", {"PCI"}, "Attribute", "Value"),
SplitByDelimiter = Table.SplitColumn(UnpivotOthers, "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Attribute.1", "Attribute.2"}),
MergeColumns = Table.CombineColumns(SplitByDelimiter,{"PC", "Attribute.2"},Combiner.CombineTextByDelimiter("|", QuoteStyle.None),"Merged"),
PivotColumn = Table.Pivot(MergeColumns, List.Distinct(MergeColumns[Attribute.1]), "Attribute.1", "Value"),
SplitColumn = Table.SplitColumn(PivotColumn, "Merged", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"City", "Change Type"})
in
SplitColumn
Hi FJS
This error indicates that you are trying to convert a text type value into Number type. This usually happens in the Changed type step. Please check whether the value "FC0001" appears in "PCI" column. If so, change its column type to text instead.
Change below step from
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"PCI", Int64.Type}, {"PCI Name", type text}, {"PCI Name_1", type text}, {"SiteIn", type text}, {"SiteIn_2", type text}}),
to
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"PCI", type text}, {"PCI Name", type text}, {"PCI Name_1", type text}, {"SiteIn", type text}, {"SiteIn_2", type text}}),