Forum Discussion
Power Query - Append columns
naveenskyline This question is intended to guage your Power Query skill level. I ask similar questions to candidates. If you want to really understand the answer it would be best for you to create some dummy data in Power Query which matches the scenario and then try to append the two columns, see what happens and what you need to do to make it work. It will not work in the state described by the scenario without transformations. I don't think the interviewer is looking for an answer that involves a relationship between the tables. Try to append the data from these two tables below. What do you have to do to make it work? I could tell you the answer but I think it would be best if you learn the answer by doing it.
Table1
// Table1
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Merchant Country" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Merchant Country", type text}})
in
#"Changed Type"
Table2
// Table2
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclGK1YlWcgWTbkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [MerchantCountry = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"MerchantCountry", type text}})
in
#"Changed Type"
- naveenskyline2 years agoRegular Visitor
jennratten - Thank you making me learn. I tried creating an example and replicated the interview question in the power query . what i got was - It created 2 columns seperately instead of appending and creating/ considering as a single column it created 2 columns (Merchant Country and MerchantCountry ) where MerchantCountry has NULL's .
- jennratten2 years agoSuper User
Great - Were you able to transform the data so that the two tables appended as expected instead of separately?
- naveenskyline2 years agoRegular Visitor
I did renamed the column by removing the space and then appended then it worked .
please let me know if you have any other transformation other than this . Thanks