+ Reply to Thread
Results 1 to 11 of 11

Custom columns in Power query(uniqe ID )

  1. #1
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Custom columns in Power query(uniqe ID )

    Hi All,

    i am new to Power query . Is there a way i can create a Two custom columns which are hilighted in Yelow columns Q and R from sample file attached, can the same be create in power Query using custome columns?. if so how can i do please . any advice ?

    enclosed sample file for your use.

    Thanks & regards,
    Hudson.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Custom columns in Power query(uniqe ID )

    Please update your profile with your current version of Excel.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Custom columns in Power query(uniqe ID )

    Hi

    bring in your source to PQ Editor, Create custom column, [Account]&[Document Number], Group by this custom column, New Column name as Data,
    operation select All rows. Then create another custom column

    Table.AddIndexColumn([Data],"Index",1,1)

    The same concat Account&Document will have Index 1,2,3........... encap side the table, expand and extract all the original fields and the last two colmns




    Please Login or Register  to view this content.
    Christopher Yap

  4. #4
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Custom columns in Power query(uniqe ID )

    Hey Christopher ,

    Thanks for your help on this , i tried and it is not easy as it looked , can you try to helpme in detail please.

    Can you send me PQ file please .. i am sorry if i am asking toomuch

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Custom columns in Power query(uniqe ID )

    Andrew - please update your profile with your current version of Excel.

  6. #6
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Custom columns in Power query(uniqe ID )

    Hi Andrew,

    Step1: place your cursor in the data area, goto Data (Get and Transform) > From Table > Select Range A2:P39244,
    Step2: In Power Query Editor, goto home > Advanced Editor, cut and paste the code to replace
    you can understand the code look at the applied steps at the right-hand side Query Settings



    I got problem in uploading xlsb (2.7MB), xlsx(7.5MB) yesterday, attached is the first 100 rows of your records, you can just cut and paste
    your 39244 records and refresh 2nd tab Power query result
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Custom columns in Power query(uniqe ID )

    Hi Ali,

    I have updated it to 2010/2013 Excel products ...

    Is that ok ?...

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Custom columns in Power query(uniqe ID )

    At last! Thanks.

  9. #9
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Custom columns in Power query(uniqe ID )

    This is very useful and i followed steps as mentioned and i few questions and would you be kind enough to clarify those please .

    1) How does "Grouping" helps and my 4 GB file took so much time to transform to grouping ? do we have something easier step ?
    2)Rename step ?. can not we directly name the columns to ""Uniqe ID", "Unique position" ?. rather then rename the columns ?.
    3) Index ; does it works like countif ?.

  10. #10
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Custom columns in Power query(uniqe ID )

    Hi Andrew,

    1) so far only 30K records and it should not take more than 1 minute, I even process few millions records
    2) Yes, you can name directly in the custom column
    3) Index column in Power query use for many other scenarios like ranking, running total, extract previous column fields etc, sumif, sumifs, countif, countifs are Group by in Power query, it is quite powerful, can be used for extracting aggregation (sum, count, max, min, average) etc

    I suggest you google PQ related video, website to learn slowly ( I did it some route), if not can pay for elearning PQ courses to expedite your learning

    However, it is individual preference, you can still use native excel command to achieve the same results, and if the datasets are huge (near 1 millions, you will still encounter slowest, I use PQ because it can handle more than 1 million records ( and it is not that slow as laptop is not a server) using in memory technology, and I only need to load the result (output summary) to excel and not the entire source files ( anyway > 1 mil also can't load to excel), and the file size is quite small

    so for your case, probably only load those column that your require, another method will be open a new workbook, data>New query> from Sheet > ..... and bring into PQ and transform inside the PQ Editor, load only the results, then the file will be very small and processing will be much more faster

    Cheers
    Last edited by bluesky63; 08-06-2020 at 05:56 AM.

  11. #11
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Custom columns in Power query(uniqe ID )

    thanks for your help it really helped !. i have added repuation ..hope that makes you happy more knowledge to you mate

+ 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. [SOLVED] Power Query Custom Column syntax help
    By L.J. in forum Excel General
    Replies: 6
    Last Post: 11-12-2019, 03:45 PM
  2. Add custom rows and columns in Power Query
    By Shao85 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2019, 06:02 AM
  3. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  4. [SOLVED] Power Query Custom Column Formula
    By whiskeybravo91 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-06-2018, 11:10 AM
  5. Power Query Custom Column Formula
    By whiskeybravo91 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2018, 09:57 AM
  6. [SOLVED] Power Query Custom Column: If number in columns a or b are less than 1 then 0 else 1
    By jekeith in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-15-2018, 10:31 AM
  7. Power Query - Invoke Custom Function
    By leukep in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2017, 02:18 PM

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