How do I merge multiple Excel files with more than one tab in each file using PowerQuery?

Hello
I have 12 Excel (.xlsx) files and each file has three identically named and ordered tabs in them. 
I know how to merge multiple Excel files in a folder using M (those guides are all over the web) but how do I merge multiple Excel files with multiple (yet identically named and ordered) tabs? Surely it is possible? I just don't know how to do it in M.
Cheers
James

What Laurence says is correct, and probably the best thing to do when the sheets have differing structures. Here is an alternate approach that works well when the sheets all have the same structure.
When you first open the Excel file from Power Query, you can see its structure in the navigator at the right-hand-side of the screen. If you select the root (which is the filename itself) and click Edit, you'll see all the tabs in the sheet as a single table.
You can now do filtering based on the Name, Item and Kind values. When you've reduced the set of things down to the sheets you want, select the Data column and say "Remove Other Columns". If the sheets don't have any header rows, you can just click the expand
icon in the header and you'll be done.
Otherwise, if the sheets have headers or if some other kind of sheet-level transformation is required against each sheet before doing a merge, you'll have to write some M code manually. In the following example, each sheet has a header row consisting of
two columns: Foo and Bar. So the only step I need to perform before merging is to promote the first row into a header. This is done via the Table.TransformColumns operation.
let
    Source = Excel.Workbook(File.Contents("C:\Users\CurtH\Desktop\Test1.xlsx")),
    RemovedOtherColumns = Table.SelectColumns(Source,{"Data"}),
    PromotedHeaders = Table.TransformColumns(RemovedOtherColumns,{{"Data", each Table.PromoteHeaders(_)}}),
    ExpandData = Table.ExpandTableColumn(PromotedHeaders, "Data", {"Foo", "Bar"}, {"Data.Foo", "Data.Bar"})
in
    ExpandData

Similar Messages

  • Generating excel with more than one tab

    Hi,
    I would like to ask if anyone of you know how to generate excel file from Oracle Reports with more than one tab? Is it possible? If yes, can you provide me some references on how to do it. Thanks in advance.

    Hi,
    Do this:
    1. Create an Excel file, put some dummy data in 2 or more worksheets. Save as HTM. This will create one main HTM file, and some sub-files under a folder. One HTM sub-file will be created per worksheet. In addition, one XML sub-file (called filelist.xml) and some other sub-files will be created. (you have already done this)
    2. Open one of the HTM sub-files in reports builder, and follow the steps shown in the Excel Demo on OTN to insert data in this file at appropriate place, and save as JSP.
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/excel/index.html
    3. You can repeat this step for all worksheets. So finally you will get one JSP file per worksheet.
    5. Now open the main file in reports builder, and add the Excel contentType element at the top
         <%@ page contentType="application/vnd.ms-excel; charset=windows-1252" %>
    6. In this file, search for the following tag
         <x:WorksheetSource HRef="./filename_files/sheet001.htm"/>
    Note that instead of filename_files you will have your own file name
    Change this tag as following:
         <x:WorksheetSource HRef="./filename_files/sheet001.jsp?userid=scott/tiger@myDb"/>
    Note that in userid, you must provide your own DB connect string
    7. Additionally, change ALL references to sheet001.htm in this file to sheet001.jsp
    Do steps 6 and 7 for sheet002.htm, sheet003.htm, and so on (if needed).
    8. Open filelist.xml (you will find this file inside the folder that contains sub-files). Here, too, change all references to JSP instead of HTM
    9. Now place the main JSP file as well as the folder containing all sub-files inside your J2EE deployment folder. Run the main JSP file. This will run the associated JSP files (the worksheets).
    This will do the trick.
    If you are worried about placing the USERID information inside your JSP code, then you can use CGICMD.DAT file, and place the userid there.
    Navneet.

  • Post document to content library with more than one tab

    Hi
    In BPC 7.0 I have been trying to post an html file (converted from an excel file with several tabs) to the content library, but when previewing or trying to open the document it shows "The page cannot be found... HTTP error 404 - File or directory not found."
    Saving other files with just one tab or word documents is no problem.
    Thanks for any advice.
    Regards
    Melanie

    Hi Ulrike,
    If the problem only comes from Excel files having more than one tab, you should raise this to support, as it could represent a potential bug.
    When opening your message, do not forget to provide:
    - BPC version and Service pack
    - SQL server version and service pack and Cumulative update
    - Multi or single environment
    - Try to reproduce the same problem into ApShell, and attach a step-by-step document to the ticket. Support will always ask you for that.
    Kind Regards,
    Patrick

  • Open firefox with more than one tab?

    Can I open firefox with more than one tab?

    Several ways. Look at the tab line. do you see the '''+''' at the end? Also,
    '''''Firefox > New Tab > New Tab'''''
    or if you have the tool bar, '''''File > New Tab'''''.

  • With more than one tab open in private browsing, how do I leave private browsing all at once?

    Before the latest Firefox update I was able to close a private browsing session by selecting the STOP menu item and checking the appropriate selection in a pop up dialogue box. Now, when I have more than one tab open in private browsing, I can't end the session by selecting STOP. The dialogue box opens and offers a START option instead of a STOP option. The same is true using CONTROL+SHIFT+P. To work around the situation I need to close all but one tab and then stop the session. I want to go back to the way it was before the update and opt out of a private session entirely, regardless of how many windows or table are open, with the former two-step process.

    Create a new profile as a test to check if your current profile is causing the problems.
    See "Basic Troubleshooting: Make a new profile":
    *https://support.mozilla.com/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
    If that new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How can I search for files with more than one keyword?

    I´ve created some keywords, and some files in my folder are tagged with two, three or more keywords.
    Is there a way to search for files using more than one keyword on the search field?
    Thanks!

    Use the Find command (menu Edit) and in criteria at the right side is a plus sign to add another criteria and set it to your custom wishes.
    make a choice in results and you should be OK

  • Can not import excel spreadsheet with more than one spreadsheet from an email

    i get excel files sent to me all the time by email and have been able to open most of them.  Went to a apple store and was told i needed to install numbers app on my iphone 4 to open them up because their was more than likely two or more work sheets in that file. i am on the road and can't get to my imac.  I bought numbers did all the updates on the iphone and sync to itunes.  it still cant open the spreadsheets if they have more than one work sheet. it does ask do you want to open in numbers i answer the question it starts the import then get error message spreadsheet couldn't be imported.  the file format is invalid.
    this is frustrating to by an app that was suggested by apple for the solution and it doesn't work.
    by the way i have excel on the macbook pro and imac so that is not an issue need to be able to see on the phone while traveling.
    by the way it says microsoft excel 97-2004 worksheet 16 kb open in "numbers"
    Any suggestions

    Hi Caroline
    you should be able to apply the exact same principles to your multi query report. The XML will have a main root node and then the results of the queries underneath.
    So if you had 3 queries you'd get something like
    <REPORTNAME>
    <G_FIRST_QUERY>
    </G_FIRST_QUERY>
    <G_SECOND_QUERY>
    <G_SECOND_QUERY>
    <G_THIRD_QUERY>
    <G_THIRD_QUERY>
    </REPORTNAME>
    In the template you will be able to map on to the separate sections of the XML very easily.
    regards, Tim

  • Creating Interactive Files with more than one URL

    Hello, here's my problem: I want to create more than one button instance that go to different URL address's. From the Adobe Video Workshop, I got the code:
    interactive_test.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    This works fine with one button instance. When I copy and paste the code for another button instance, i.e:
    butn1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    butn2.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    I get 1021 duplicate function error. I think I understand in priciple what's wrong but don't know how to fix it. MyI knowledge of Action Script 3 is zero. What I need is sample code that works that I could copy and paste, with appropriate changes.
    Thanks in advance for your help, Richard

    use different function names or flash won't know which function to use:
    butn1.addEventListener(MouseEvent.CLICK, buttonClickHandler1);
    function buttonClickHandler1(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));
    butn2.addEventListener(MouseEvent.CLICK, buttonClickHandler2);
    function buttonClickHandler2(event:MouseEvent):void {
                    navigateToURL(new URLRequest("http://www.adobe.com"));

  • How to read a excel file with more than one worksheet.

    Hi,
    I wanna read a sheet (anyone of it,not the first) in a excel.Who can help me!
    best wishes,
    Grant Chen

    Dear All,
    Thank you all for your reply!
    I modified SAP FM ZALSM_EXCEL_TO_INTERNAL_TABLE.
    I add an IMPORTING parameter 'I_SHEET' 
    which stands for the sequence number of worksheet  in the FM.
    FUNCTION ZALSM_EXCEL_TO_INTERNAL_TABLE .
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(FILENAME) LIKE  RLGRAP-FILENAME
    *"     REFERENCE(I_SHEET) TYPE  I
    *"     VALUE(I_BEGIN_COL) TYPE  I
    *"     VALUE(I_BEGIN_ROW) TYPE  I
    *"     VALUE(I_END_COL) TYPE  I
    *"     VALUE(I_END_ROW) TYPE  I
    *"  TABLES
    *"      INTERN STRUCTURE  ALSMEX_TABLINE
    *"  EXCEPTIONS
    *"      INCONSISTENT_PARAMETERS
    *"      UPLOAD_OLE
    *{   INSERT         EC6K900099                                        1
      DATA: excel_tab     TYPE  ty_t_sender.
      DATA: ld_separator  TYPE  c.
      DATA: application   TYPE  ole2_object,
            workbook      TYPE  ole2_object,
            range         TYPE  ole2_object,
            worksheet     TYPE  ole2_object.
      DATA: h_cell        TYPE  ole2_object,
            h_cell1       TYPE  ole2_object.
      DATA:
        ld_rc             TYPE i.
    *   Rückgabewert der Methode "clipboard_export     "
    * Makro für Fehlerbehandlung der Methods
      DEFINE m_message.
        case sy-subrc.
          when 0.
          when 1.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          when others. raise upload_ole.
        endcase.
      END-OF-DEFINITION.
    * check parameters
      IF i_begin_row > i_end_row. RAISE inconsistent_parameters. ENDIF.
      IF i_begin_col > i_end_col. RAISE inconsistent_parameters. ENDIF.
    * Get TAB-sign for separation of fields
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      ld_separator = cl_abap_char_utilities=>horizontal_tab.
    * open file in Excel
      IF application-header = space OR application-handle = -1.
        CREATE OBJECT application 'Excel.Application'.
        m_message.
      ENDIF.
      CALL METHOD  OF application    'Workbooks' = workbook.
      m_message.
      CALL METHOD  OF workbook 'Open'    EXPORTING #1 = filename.
      m_message.
    *  set property of application 'Visible' = 1.
    *  m_message.
    ********************Modified by Grant 20080717************
      call METHOD of application 'Worksheets' = worksheet
      exporting
        #1 = I_SHEET.
      m_message.
      call method of worksheet 'Activate'.
    *  GET PROPERTY OF  application 'ACTIVESHEET' = worksheet.
      m_message.
    * mark whole spread sheet
      CALL METHOD OF worksheet 'Cells' = h_cell
          EXPORTING #1 = i_begin_row #2 = i_begin_col.
      m_message.
      CALL METHOD OF worksheet 'Cells' = h_cell1
          EXPORTING #1 = i_end_row #2 = i_end_col.
      m_message.
      CALL METHOD  OF worksheet 'RANGE' = range
                     EXPORTING #1 = h_cell #2 = h_cell1.
      m_message.
      CALL METHOD OF range 'SELECT'.
      m_message.
    * copy marked area (whole spread sheet) into Clippboard
      CALL METHOD OF range 'COPY'.
      m_message.
    * read clipboard into ABAP
      CALL METHOD cl_gui_frontend_services=>clipboard_import
        IMPORTING
          data                 = excel_tab
        EXCEPTIONS
          cntl_error           = 1
    *      ERROR_NO_GUI         = 2
    *      NOT_SUPPORTED_BY_GUI = 3
          OTHERS               = 4
      IF sy-subrc <> 0.
         MESSAGE a037(alsmex).
      ENDIF.
      PERFORM separated_to_intern_convert TABLES excel_tab intern
                                          USING  ld_separator.
    * clear clipboard
      REFRESH excel_tab.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
         IMPORTING
            data                 = excel_tab
         CHANGING
            rc                   = ld_rc
         EXCEPTIONS
            cntl_error           = 1
    *       ERROR_NO_GUI         = 2
    *       NOT_SUPPORTED_BY_GUI = 3
            OTHERS               = 4
    * quit Excel and free ABAP Object - unfortunately, this does not kill
    * the Excel process
      CALL METHOD OF application 'QUIT'.
      m_message.
    * >>>>> Begin of change note 575877
    * to kill the Excel process it's necessary to free all used objects
      FREE OBJECT h_cell.       m_message.
      FREE OBJECT h_cell1.      m_message.
      FREE OBJECT range.        m_message.
      FREE OBJECT worksheet.    m_message.
      FREE OBJECT workbook.     m_message.
      FREE OBJECT application.  m_message.
    * <<<<< End of change note 575877
    *}   INSERT
    ENDFUNCTION.
    Edited by: Grant Chen on Jul 17, 2008 7:45 AM
    Edited by: Grant Chen on Jul 17, 2008 7:46 AM

  • File with more than one texture

    Hello, I'm having a problem with an animation I am working on. I have a file that contains three sprites on one sheet. What I ususally do it load the sheet onto the stage, then I try and erase the two extra sprites until I need them. Everytime I try it just erases the black background on the previous layer. I've tried switching back to the layer the sprite was on and erasing; but, It still switches to the black background layer and erasies that. I have the sprite sheet in a psd file and I still can't edit it while within the program.

    It is not clear what you mean when you talk about sheets (?) and erasing things - why not just have separate sheets for each ? 
    If you have layers involved and things are on separate layers, then you should be able to lock any layer you do not want to affect.  So you should be able to lock the black background layer and any others except the one you wish to erase.

  • HT203433 How do I find out if I have more than one apple id

    How do I find out if I have more than one id

    You'll have to use your little gray cells on this one.  How can anyone know if an apple ID belongs to you?  There's no way to identify you.

  • How can I create multiple sales orders with reference to one contract?

    Hello Gurus,
    Can you please how can I create multiple sales orders with reference to one contract?
    thanks!
    Rakesh

    hi
    Lets consider example
    In your contract for line item 1 you have entered qty 100
    You careated sales order with 70 quantity, and now you want to creat another sales order for 30
    For this first you need to check what is your item category in contract (VA42)
    Goto VOV7
    SPRO - IMG  - Sales and distribution - Sales - Sales document item - Define item categories - Go to change mode
    Make the completion rule = B Item is completed after full quantity has been referenced

  • RegionRenderer encodeAll The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance.

    Hi,
    I am using JDEV 11.1.2.1.0
    I am getting the following error :-
    <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    Piece of code is for region is:-
       <f:facet name="second">
                                                <af:panelStretchLayout id="pa1"
                                                                       binding="#{backingBeanScope.Assign.pa1}">
                                                    <f:facet name="center">
                                                        <af:region value="#{bindings.tfdAssignGraph1.regionModel}" id="r1"
                                                                   binding="#{backingBeanScope.Assign.r1}"/>
                                                    </f:facet>
                                                </af:panelStretchLayout>
                                            </f:facet>
    How do I resolve it ?
    Thanks,

    Hi,
    I see at least 3 errors
    1. <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components.
    the page fragment should only have a single component under the jsp:root tag. If you see more than one, wrap them in e.g. an af:panelGroupLayout or af:group component
    2. SAPFunction.jspx/.xml" has an invalid character ".".
    check the document (you can open it in JDeveloper if the customization was a seeded one. Seems that editing this file smething has gone bad
    3. The expression "#{bindings..regionModel}" (that was specified for the RegionModel "value" attribute of the region component with id "pePanel") evaluated to null.
    "pageeditorpanel" does seem to be missing in the PageDef file of the page holding the region
    Frank

  • How can i use my iphone with more than one itunes

    how can i use my iphone with more than one itunes

    Sync iPod/iPad/iPhone with two computers
    Although it isn't possible to sync an Apple device with two different libraries it is possible to sync with the same logical library from multiple computers. Each library has an internal ID and when iTunes connects to your iPod/iPad/iPhone it compares the local ID with the one the device normally syncs with. If they are the same you can go ahead and sync...
    I have my library cloned to a small 1Tb USB drive which I can take between home & work. At either location I use SyncToy 2.1 to update the local copy with the external drive. Mac users should be able to find similar tools. I can open either of the local libraries or the one on the external drive and update the media content of my iPhone. The slight exception is Photos which normally connects to a specific folder on a specific machine, although that can easily be remapped to the current library if you create a "Photos" folder inside the iTunes Media folder so that syncing the iTunes folders keeps this up to date as well. I periodically sweep my library for new files & orphans with iTunes Folder Watch just in case I make changes at one location but then overwrite the library with a newer copy from the other. Again Mac users should be able to find similar tools.
    As long as your media is organised within an iTunes Music or Tunes Media folder, in turn held inside the main iTunes folder that has your library files (whether or not you let iTunes keep the media folder organised) each library can access items at the same relative path from the library folder so the library can be at different drives/paths on different machines. This solution ensures I always have adequate backups of my library and I can update my devices whenever I can connect to the same build of iTunes.
    When working with an iPhone earlier builds of iTunes would remove any file not physically present in the local library, even if there was an entry for it, making manual management practically redundant on the iPhone. This behaviour has been changed but it will still only permit manual management with a library that has the correct internal ID. If you don't want to sync your library between machines on a regular basis just copy the iTunes Library.itl file from the current "home" machine to any other you want to use, then clean out the library entries and import the local content you have on that box.
    tt2

  • Tables with more than one cell with a high number of rowspan (ej. 619). This cell can not be print in a page and it must be cut. But I don't know how  indesign can do this action.

    Tables with more than one cell with a high number of rowspan (ej. 619). This cell can not be print in a page and it must be cut. But I don’t know how  indesign can do this action.

    set the wake-on lan on the main computer
    The laptop's too far away from the router to be connected by ethernet. It's all wifi.
    No separate server app on the laptop, it's all samba
    The files are on a windows laptop and a hard drive hooked up to the windows laptop. The windows share server is pants, so I'd need some sort of third party server running. Maybe you weren't suggesting to use Samba to connect to the windows share though?
    I'm glad that you've all understood my ramblings and taken and interest, thanks The way I see it, I can't be the only netbook user these days looking for this kind of convenience, and I certainly won't be once chrome and moblin hit the market.
    Last edited by saft (2010-03-18 20:38:08)

Maybe you are looking for

  • IOS6 WiFi Problems, please help!

    I have the iPhone 4 and updated to the iOS6 today. Well after updating my wifi will not work.. The thing is I am at college and the wifi here you have to go to Safari and type in username and password everytime. Well when I go to do so, it will not l

  • Can i make a one-time transfer of money from my account to another itunes account

    How do i make a one-time transfer of money from my itunes account to another itunes account ?

  • Attaching PDF to Email Issue

    When I attach certain PDF files to an email, sometimes the first page is viewable in the email. How do I eliminate this?

  • Error when install NI-DAQ 7.4

    When I install NI-DAQ 7.4 I got this message : ''Developer Erorr :The following errors where found in your ini file : 1. Specified file not found: [MsiEngine] Win9xPath = suppfiles\instmsia.exe 2. Specified file not found: [MsiEngine] WinNTPath = sup

  • After installing os-5 camera doesnt zoom

    I installed the new iOS-5 software and found that the zoom feature on my I-phone 4 was missing. Should I reintall the software (probably will) but wonder if I need to toggle a setting or somthing simple. I hate losing my access to vmail every time I