Forum Discussion
Error (row index 1)
Hi, thanks again, the previous display was from the error page, and it relates to this table below. Where can i go to update the line "Added Index" = Table.AddIndexColumn(Source, "Row Number" ,1, 1)? sorry, do I go to error page to update?
let
Source = #"Table20191307 (OA)",
#"Appended Query" = Table.Combine({Source, #"Table20191307 (DA)", #"Table20191307 (CA)", #"Table20191307 (AGT-KCDCA)"}),
#"Added Conditional Column" = Table.AddColumn(#"Appended Query", "Country", each if [TYPE] = "OS" then [Ship Org] else if [TYPE] = "DS" then [Ship Dest] else [Ship Dest]),
#"Inserted Merged Column" = Table.AddColumn(#"Added Conditional Column", "Merged", each Text.Combine({[Year], "-1-1"}), type text),
#"Changed Type" = Table.TransformColumnTypes(#"Inserted Merged Column",{{"Merged", type date}}),
#"Extracted Year" = Table.TransformColumns(#"Changed Type",{{"Merged", Date.Year, Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Extracted Year",{{"Year", "Year (TEXT)"}, {"Merged", "Year"}}),
#"Replaced Value" = Table.ReplaceValue(#"Renamed Columns","DO NOT USE -THE MI","MOVERS INTERNATION",Replacer.ReplaceValue,{"Booker", "Partner"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","DO NOT USE - THE M","MOVERS INTERNATION",Replacer.ReplaceValue,{"Booker", "Partner"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","DO NOT USE-THE MI","MOVERS INTERNATION",Replacer.ReplaceText,{"Booker", "Partner"})
in
#"Replaced Value2"
PGAT you have to look at the queries that use addindexcolumn function, this particular query is not using that, what other tables you are getting error in Power Query, you have to check all those, without seeing the full picture, it is very hard to provide the appropriate solution. When you find the table which has the error, just update the syntax as provided.
- PGAT6 years agoHelper III
Thank you, Sir! Is there a possibility that i will not be able to find this? As in, if i have deleted it by mistake. I am not sure. I really hope to be able find that missing piece so that I can update it. The error shown relates to only this "Table20191307" but yet, I cannot locate addindexcolumn in the query. I understand it is difficult as you do not have view to all my queries. I really appreciate every possible step you are advising. Thanks.
- PGAT6 years agoHelper III
hi there, this issue is now fixed. The issue was oddly with a column where i had the year in TEXT. e.g. 2020. I then made a formula to combine TEXT with "-1-1" where I can then convert to date column, and to extract YEAR. This was working fine for me in this 1.5 year until now. Once I removed all the M code below, and kept the year as TEXT. I had no other errors. I still can't figure out why these steps below will trigger the issue. I got to know these issues as I was working to start from scratch again. Then it hit errors at this step.