+ Reply to Thread
Results 1 to 10 of 10

Power Query insert Rows at change in value using record

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Power Query insert Rows at change in value using record

    Hello, this is a theory question regarding the anser to inserting blank rows and change in value , the response by alies sx

    https://www.excelforum.com/office-36...ml#post5947311

    I would like some help in understanding this ;

    Please Login or Register  to view this content.

    the part i do not understand is "x[c][Item] = c[Item] " , so c = recs {i}[Item] and x[c][Item] = current "item", so is "c[Item]" the
    previous or what in an accumulation would be the state?


    I have re written this to try and understand how it works to;

    Please Login or Register  to view this content.

    which works but I don't think is as well, I have attached a workbook with both examples 'gen' and 'gen_mine' and also some other solutions,

    if anyone can help or share blog or post with more information on this subject please let me know.
    lastly if anyone replies I may not be able to respond for a day or 2 ,
    Richard.
    Attached Files Attached Files
    Last edited by Dicken; 08-31-2024 at 12:02 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,009

    Re: Power Query insert Rows at chacen in vlaue using recordd

    Yes, c[Item] is the previous row's Item
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Re: Power Query insert Rows at chacen in vlaue using recordd

    I do find this a bit confusing ; compare ;

    Please Login or Register  to view this content.

    z = y results in all the same but z = [y] = 1 less [x = 4, y = 4, z = 3] , I'm trying to think of [] as the state in accumulation, which helps , a bit.
    RD

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,009

    Re: Power Query insert Rows at chacen in vlaue using recordd

    z = [y] is z = _[y] so yes it's the value of the record as it is currently, not the value you are changing it to.

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Re: Power Query insert Rows at chacen in vlaue using recordd

    Thanks, I have not been able to find a lot of information on this;
    as far the original insert blank row, and my version ( when tried over 50K + rows) is not that much slower than the other,

    i'll leave this open for a bit longer to see if anything more is added, thanks for your help.

    Richard.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Power Query insert Rows at chacen in value using record

    Richard, please update your title to correct the typo. I made couple of fixes but can't for the life of me figure out what "chacen" is supposed to be.

    I also removed the CODE tags from your link so it is clickable.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  7. #7
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Re: Power Query insert Rows at chacen in value using record

    done change, sorry,

  8. #8
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Re: Power Query insert Rows at chacen in value using record

    Last word before closing;
    I made up these four examples as to the differences in referring to records x as x ,x as [x], z as y, z as [y]

    Please Login or Register  to view this content.
    [

  9. #9
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Re: Power Query insert Rows at change in value using record

    This will hopefully be my last comment on this, but found this interesting in illustrating the point


    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    779

    Re: Power Query insert Rows at change in value using record

    I have attached a sheet with the above as a function and an insert at interval function ;


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

+ 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 Insert Rows at uneven intervals
    By Dicken in forum Office 365
    Replies: 5
    Last Post: 05-06-2024, 09:18 AM
  2. Replies: 1
    Last Post: 07-14-2023, 10:15 AM
  3. [SOLVED] Power Query insert row
    By Len Silva in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2023, 06:00 AM
  4. Replies: 2
    Last Post: 02-12-2020, 09:34 AM
  5. 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
  6. [SOLVED] Insert a date value as a Custom Column in Power Query
    By heytherejem in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-28-2018, 12:42 PM
  7. Choose max vlaue in a range and insert data
    By jazbath in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 06:00 PM

Tags for this Thread

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