Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Join Date
    Oct 2024
    Posts
    8
    Quote Originally Posted by madpiet View Post
    If your data is in Excel, fix it there. PowerQuery will run circles around anything you can do in Access. If you have dates as column headers, you likely need to unpivot your data so that you end up with something more like (category, date, amount). Takes like 2 seconds in PowerQuery
    I can not import it to Excel. It is in Access and working there but need it in Excel through Get Data, Access Database and then select the query. POwer query does not even see it..



    M.

  2. #17
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,823
    When I use Get Data in Excel the only query that displays for selection is "qryTotalSum"
    All other queries are not listed.

  3. #18
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    i would use Access as a source in Excel, and then when it prompts you for a table, select all of the ones you want. Then you can use the Wizardy Append query thing in PowerQuery to append all the data to a single table, and you're done. then import that into Access. But do it any way you want. I just found doing in Excel to be orders of magnitude quicker and easier than doing it in Access. But you do you.

  4. #19
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    In PowerQuery, you should be able to filter your table names for Starts With "MITCLI_TB_Non_Current_" and return just those tables.

  5. #20
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    All this for something like
    SELECT MonthYear, SUM([NumericColumn])
    FROM Chart_of_Accounts INNER JOIN MITCLI_TB ON Chart_Of_Acounts.[No] = MITCLI_TB.[No]
    WHERE Chart_Of_Acounts.Cat3='Deferred tax assets'
    GROUP BY MITCLI_TB.[No], MITCLI_TB.Name, Chart_Of_Acounts.Cat3

    ?
    This is why I've been restructuring. This design is crazy brittle and it's going to be a huge PITA to answer anything more than the most basic questions. I transformed it in PowerQuery/Excel (in spite of your protests) because PowerQuery/Excel just blow the doors of Access for doing this kind of thing. Maybe Database Design for Mere Mortals by Michael Hernandez would be a good place to start.

  6. #21
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,575
    I think beacuse your data is so not normalised, that Access will not show those queries?
    I tried a simple select of the NCA query and that still did not show up in Excel.

    I would learn PowerQuery and go with MadPiet's solution, else export the queries to Excel with some VBA.
    So you Push instead of Pull.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #22
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    You could change those two select queries (in Access) to make-table queries, create a macro to run them both then run that macro from Excel when you open your Excel file (in which you link to the new tables not the original select queries).
    https://stackoverflow.com/questions/...ros-from-excel

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #23
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    How about this... don't do any summary in Excel or Access or whatever.

    Put all the Excel files in the same folder (if the data is on different tabs, I think you have to use PowerQuery and loop over the tabs in Excel). But anyway... so they're NOT summarized at all.

    Append all those together (so no dates in column names), so you have one table with all the data.

    (Then if you don't need gory level detail, summarize that in PowerQuery... if you don't need super low level detail)
    Then import that into your database. Then summarize.

  9. #24
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    Are you basically trying to create a crosstab type report in Excel from this stuff?

    (similar to the crosstabs you have Non_current_assets, and Non_current_liabilities?)

    You'd do that in Excel maybe using a data model and DAX

    What questions are you trying to answer with this? Maybe that will make it easier to choose how to approach it.

  10. #25
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    I fixed tables problem. Now I have one table with all the Transactions. To what do [ID] and [No] refer? Are they join columns to another table?

    Code:
    SELECT [3_Entities_01_2024].ID, [3_Entities_01_2024].[No], [3_Entities_01_2024].Amount, [3_Entities_01_2024].Month, [3_Entities_01_2024].Year
    FROM 3_Entities_01_2024
    UNION ALL
    SELECT [3_Entities_02_2024].ID, [3_Entities_02_2024].[No], [3_Entities_02_2024].Amount, [3_Entities_02_2024].Month, [3_Entities_02_2024].Year
    FROM 3_Entities_02_2024
    UNION ALL
    SELECT [3_Entities_03_2024].ID, [3_Entities_03_2024].[No], [3_Entities_03_2024].Amount, [3_Entities_03_2024].Month, [3_Entities_03_2024].Year
    FROM 3_Entities_03_2024
    UNION ALL
    SELECT [3_Entities_04_2024].ID, [3_Entities_04_2024].[No], [3_Entities_04_2024].Amount, [3_Entities_04_2024].Month, [3_Entities_04_2024].Year
    FROM 3_Entities_04_2024
    UNION ALL
    SELECT [3_Entities_05_2024].ID, [3_Entities_05_2024].[No], [3_Entities_05_2024].Amount, [3_Entities_05_2024].Month, [3_Entities_05_2024].Year
    FROM 3_Entities_05_2024
    UNION ALL
    SELECT [3_Entities_06_2024].ID, [3_Entities_06_2024].[No], [3_Entities_06_2024].Amount, [3_Entities_06_2024].Month, [3_Entities_06_2024].Year
    FROM 3_Entities_06_2024
    UNION ALL
    SELECT [3_Entities_07_2024].ID, [3_Entities_07_2024].[No], [3_Entities_07_2024].Amount, [3_Entities_07_2024].Month, [3_Entities_07_2024].Year
    FROM 3_Entities_07_2024
    UNION ALL
    SELECT [3_Entities_08_2024].ID, [3_Entities_08_2024].[No], [3_Entities_08_2024].Amount, [3_Entities_08_2024].Month, [3_Entities_08_2024].Year
    FROM 3_Entities_08_2024
    UNION ALL
    SELECT [3_Entities_09_2024].ID, [3_Entities_09_2024].[No], [3_Entities_09_2024].Amount, [3_Entities_09_2024].Month, [3_Entities_09_2024].Year
    FROM 3_Entities_09_2024
    UNION ALL
    SELECT [3_Entities_10_2024].ID, [3_Entities_10_2024].[No], [3_Entities_10_2024].Amount, [3_Entities_10_2024].Month, [3_Entities_10_2024].Year
    FROM 3_Entities_10_2024
    UNION ALL
    SELECT [3_Entities_11_2024].ID, [3_Entities_11_2024].[No], [3_Entities_11_2024].Amount, [3_Entities_11_2024].Month, [3_Entities_11_2024].Year
    FROM 3_Entities_11_2024
    UNION ALL SELECT [3_Entities_12_2024].ID, [3_Entities_12_2024].[No], [3_Entities_12_2024].Amount, [3_Entities_12_2024].Month, [3_Entities_12_2024].Year
    FROM 3_Entities_12_2024;

  11. #26
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    I fixed tables problem. Now I have one table with all the Transactions. To what do [ID] and [No] refer? Are they join columns to another table?

    What are the base tables? I'm thinking this design needs to be normalized and rebuilt so that it works.

  12. #27
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    Oh, I used Excel to unpivot this into something super simple. (No, Value, Date). Then I assume that joins to the Accounts dimension.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-24-2019, 08:24 AM
  2. Replies: 2
    Last Post: 01-17-2018, 05:48 AM
  3. Replies: 3
    Last Post: 10-16-2016, 06:53 AM
  4. Replies: 7
    Last Post: 10-27-2012, 07:19 AM
  5. Queries and codes
    By alliandrina in forum Queries
    Replies: 2
    Last Post: 05-03-2012, 05:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums