Forum Discussion

koukou-cell's avatar
koukou-cell
New Member
3 years ago
Solved

fill null data from an other table

hi ,

i need your help as soon as possible please.

 

i have two tables ,the first one has a missed data. the colonnes name are  ( facturenum , dates, type) , some data in the colone type are null. 

the second one contain the missed data , it has attributes as ( fact,type)

i need to fill the missed data in table one from the first table.

 

i tried all merge type , with no result ,

 

any solution please

  • Hi koukou-cell ,

    According to your description, here's my sample and solution. Please copy-paste the two queries in two blank quries.

    Table (2):

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YGRTkikMxLpAiNjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}})
    in
        #"Changed Type"

     

    Table:

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWAhPOCKarUmwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
        #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Column1"}, #"Table (2)", {"Column1"}, "Table (2)", JoinKind.FullOuter),
        #"Expanded Table (2)" = Table.ExpandTableColumn(#"Merged Queries", "Table (2)", {"Column1"}, {"Table (2).Column1"}),
        #"Added Custom" = Table.AddColumn(#"Expanded Table (2)", "Custom", each if [Column1]=null then [#"Table (2).Column1"] else[Column1]),
        #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Table (2).Column1", "Column1"}),
        #"Removed Duplicates" = Table.Distinct(#"Removed Columns"),
        #"Removed Blank Rows" = Table.SelectRows(#"Removed Duplicates", each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
    in
        #"Removed Blank Rows"

     

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Hi koukou-cell ,

    According to your description, here's my sample and solution. Please copy-paste the two queries in two blank quries.

    Table (2):

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YGRTkikMxLpAiNjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}})
    in
        #"Changed Type"

     

    Table:

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWAhPOCKarUmwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
        #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Column1"}, #"Table (2)", {"Column1"}, "Table (2)", JoinKind.FullOuter),
        #"Expanded Table (2)" = Table.ExpandTableColumn(#"Merged Queries", "Table (2)", {"Column1"}, {"Table (2).Column1"}),
        #"Added Custom" = Table.AddColumn(#"Expanded Table (2)", "Custom", each if [Column1]=null then [#"Table (2).Column1"] else[Column1]),
        #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Table (2).Column1", "Column1"}),
        #"Removed Duplicates" = Table.Distinct(#"Removed Columns"),
        #"Removed Blank Rows" = Table.SelectRows(#"Removed Duplicates", each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
    in
        #"Removed Blank Rows"

     

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.