Results 1 to 3 of 3

Thread: Combine two tables vertical

  1. #1
    Neophyte 4ndreas's Avatar
    Join Date
    Jan 2020
    Posts
    2
    Articles
    0
    Excel Version
    2013

    Combine two tables vertical



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi,
    I have two web-queries:
    1. Query:
    Code:
    let    Quelle = Web.Page(Web.Contents("https://www.ariva.de/henkel_vz-aktie/bilanz-guv?page=6")),
        Data10 = Quelle{10}[Data]
    in
        Data10
    2. Query:
    Code:
    let    Quelle = Web.Page(Web.Contents("https://www.ariva.de/henkel_vz-aktie/bilanz-guv?page=0")),
        Data10 = Quelle{10}[Data]
    in
        Data10
    From the first query I get a table with values from the years 2008 to 2013. The second query gives me the values from 2014 to 2019.
    (How) can I combine the table columns vertical to get all years (2008 to 2019) in one table?

    Thanks
    Andreas

  2. #2
    Neophyte 4ndreas's Avatar
    Join Date
    Jan 2020
    Posts
    2
    Articles
    0
    Excel Version
    2013
    I could solve it with the following approach:
    Code:
    let    Quelle = #"Table 1",
        #"Zusammenführte Abfragen" = Table.NestedJoin(Quelle,{"Column1"},#"Table 2",{"Column1"},"Table 2",JoinKind.LeftOuter),
        #"Erweiterte Table 2" = Table.ExpandTableColumn(#"Zusammenführte Abfragen", "Table 2", {"Column2", "Column3", "Column4", "Column5", "Column6", "Column7"}, {"Column2.1", "Column3.1", "Column4.1", "Column5.1", "Column6.1", "Column7.1"})
    in
        #"Erweiterte Table 2"
    Thanks

  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,353
    Articles
    56
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Hi 4ndreas,

    I believe you chose the Merge option. That's for horizontal joins, not vertical ones. The option you want is actually the Append option.

    Right click your first query, choose Append (instead of Merge), choose the second query and you should be good to go.
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •