+ Reply to Thread
Results 1 to 11 of 11

power query question

  1. #1
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    office 365
    Posts
    18

    power query question

    Hi excel people,

    Hope I’m in the right place here because I can’t find a powerquery section.

    I’m doing a powerquery course but I’m way not finished yet.
    Now I have an issue that I have to deal with at work very often and I'm pretty sure it can be resolved with powerquery. But I have no clue how at the moment.

    Check the attached sheet. I exported 2 reports into excel from my accounting software.
    (data is adjusted and numbers, totals and subtotals are incorrect.)

    My accounting program exports data in this way constantly.
    I exported 2 reports into excel from my accounting software.
    (data is confidential but the numbers are all altered/way incorrect… so don’t mind the balances… they’re incorrect)

    1. sheet is a general ledger export
    2. is a paylist export

    I need to change this data into a proper dbase.
    1. get rid of the rows mentioning 'subtotaal'
    2. adding a column and copy the 'cust# - customer name' on the records below that name. 3. deleting the original 'cust# - customer name' line (I reckon that's the same like #1)

    Especially #2 I don't have a clue how to do that. That’s the tricky one for me.
    Eternal grace to the one who can tell me how to resolve this. ;p

    Much obliged,

    Grts Jo
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,872

    Re: power query question

    Here is the PQ solution for the GL only. Use this example to do the AP

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    office 365
    Posts
    18

    Re: power query question

    Alansidman,

    That looks perfect!
    Hooray... thx a lot. You're a life savier!

    Dumb question I reckon (but I'm pretty new to this powerquery)
    How do I apply these steps to the AP table?

    So for now much obliged.

    I can close the thread I reckon... but if you could answer this question it would be perfect!

    grts Jo

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,872

    Re: power query question

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    office 365
    Posts
    18

    Re: power query question

    Hi Alansidman,

    I see what you did here... you've changed the AP and the GL into a proper dbase.
    But I don't have a clue how you did that.

    I've tried to copy & paste your code into the commandline of "changed type" several times... but that doesn't work at all.

    - Could you please point out the menu path for instance to add new unprocessed records to the sheet where power query performs the tasks at hand?
    - explain into a bit more details what to do with the code? Like paste it into the commandline of "changed type"? That seems to be the idea but I only generate mess and error code if I do t
    - What are the menu-paths to 'generate this query myself'... where for instance can I find this "filter rows" or "Add Conditional Colum" or "= Table.FillDown(#"Added Custom",{"Custom"})" ?

    Hope I'm not a to much of a 'pain in the ***'... ;p

    grts Jo

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,872

    Re: power query question

    Step by Step for the AP Query

    1. In Excel, highlight the range of data.
    2. On the Ribbon, select Data-->Get and Transform-->From Range/table
    3. When prompted for Contains Headers, be sure the checkbox is checked
    4. In the PQ Editor, in the right window, delete Change Type (we will deal with this later)
    5. Highlight the Factuur column of data
    6. In the header, click on the drop down arrow and deselect Subtotal
    7. Click on the Add Column item in the menu
    8. In the window type = Text.Contains([Datum],null) then [Factuur] else null
    9. Highlight the new column which is called Custom
    10. Right click on the column and select Fill-->Down
    11. Right click on the custom column and select Move-->To Beginning
    12. Highlight the Datum column and select the drop down arrow
    13. Deselect null
    14. Highlight the Datum column and right click.
    15. Select Change Type and select Date
    16. On the Home tab, select Close and Load.

    Hope this helps you. If you are interested in further expanding your pq abilities, get a copy of Ken Puls and Miguel Escobars book
    https://www.amazon.com/Master-Your-D.../dp/1615470581

  7. #7
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    office 365
    Posts
    18

    Re: power query question

    Alansidman,

    I've got the powerquery course from xelplus: https://courses.xelplus.com/p/excel-power-query
    But lack of time prevented me from getting completely through it up till now.
    But like I mentioned... dealing with these moronic exports from the finance system that would be great to resolve asap.

    Your last reply is getting me a lot further though.
    I'm getting stuck at #8 though: In the window type = Text.Contains([Datum],null) then [Factuur] else null

    Isn't there nr. missing between 7 and 8 cause you didn't mention which button to use in the 'add column' menu... I reckon it's "invoke custome function" because it puts the new column in the front but I don't know how to get the formula in...

    New column name = Custom
    function query = Text.Contains([Datum],null) then [Factuur] else null.... I reckon but it doesn't late me paste there...


    :o)

  8. #8
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    office 365
    Posts
    18

    Re: power query question

    Aha... via the prior file I found out that # 6,5 should be: click button "add conditional column"
    let's see where that gets me... ;p

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,872

    Re: power query question

    If you look at the file I uploaded and click on any of the steps in the right window in the PQ editor, you can see exactly the steps taken.

  10. #10
    Registered User
    Join Date
    12-16-2020
    Location
    Amsterdam
    MS-Off Ver
    office 365
    Posts
    18

    Re: power query question

    Allright allright allright Alansidman! (to quote Mr. McConaughey ;p)

    Figured it out! Hooray!
    Haha... the "add conditional column" and the "filter down" where the cool actions!
    Thx to your help! Couldn't have pulled it off without you.
    I'd proudly would like to show you my version but since the thread is closed I can't upload a file anymore aparently...

    Remains one issue though...
    How do I get new data into the query?
    Tomorrow I want to generate a new query without going through the same steps... how do I pull that of? (allthough it will be a good exercise to repeat the steps a couple of times).

    Already tried to delete the output and alter the input table... and run the query... no good.
    So what's the trick here?

    grts Jo

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,872

    Re: power query question

    So long as the existing file is linked to the query, whenever you add additional information to the source table and click on the Refresh All Icon on the Ribbon it should update the Query output.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. power query question
    By shj92922 in forum Excel General
    Replies: 2
    Last Post: 03-19-2022, 12:31 AM
  2. [SOLVED] Advance Power Query Editor Question
    By cvici in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2021, 04:39 AM
  3. Power Query Import Question
    By Zandor435 in forum Excel General
    Replies: 1
    Last Post: 01-20-2020, 06:07 AM
  4. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  5. [SOLVED] Power Query - Filtering question
    By orhanceliloglu in forum Excel General
    Replies: 4
    Last Post: 12-05-2017, 04:37 AM
  6. Power query question
    By BORUCH in forum Excel General
    Replies: 13
    Last Post: 10-26-2017, 09:09 AM
  7. Power Query question
    By BamBamMoneyBags in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-08-2016, 02:43 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1