+ Reply to Thread
Results 1 to 5 of 5

Power Query List insert range at irregular intervals

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

    Power Query List insert range at irregular intervals

    Hi, I've pretty much got what I wanted , to insert a range at each change in list value, I did not want to group, and this is sort of grouping but not quite.

    My problem is the last step i end up with a blank at bottom, witch is easy to remove but I'd rather it did not occur,

    Please Login or Register  to view this content.
    I have tried to list.remvoe last within this but get an error, so any suggestions for that, and if there a better way's , I would be interested.

    Richard.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-05-2024
    Location
    Moscow, Russia
    MS-Off Ver
    365
    Posts
    16

    Re: Power Query List insert range at irregular intervals

    with List.InsertRange
    Please Login or Register  to view this content.
    with List.Generate
    Please Login or Register  to view this content.

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

    Re: Power Query List insert range at irregular intervals

    Thanks, you helped with this sort of problem before, get the second, the first is a bit beyond me, I thought working on list might be simpler than a table,
    will plug away,
    I do have a question, re code below ; x[c][Item] = c[Item], x[c] = each [c] , so what does c = ?

    Please Login or Register  to view this content.
    Thanks for the help,

    Richard.

  4. #4
    Registered User
    Join Date
    05-05-2024
    Location
    Moscow, Russia
    MS-Off Ver
    365
    Posts
    16

    Re: Power Query List insert range at irregular intervals

    Hello, Richard. c stands for a record field name I defined in this function call. List.Generate in this implementation generates a list of records with fields i, c and s. i field works as counter to access particular item of original list recs. To illustrate what's going on - simply remove 4th optional argument of List.Generate and see what you get as gen. You'll see a list of records with fields and values - this is how List.Generate works. Don't be fooled with x variable. It has different meaning in 2, 3 and 4th argument. Read documentation. In 3rd argument (which generates next item list in our sequence) it refers to previously generated item. So that when we write (x) => [i = x[i] + 1, ...] we simply create next item (next record in our list) with counter field = prev counter + 1.
    So that List.Generate has an access to the very last item it created. It's useful for rolling totals etc.
    At the same time don't forget that we can calculate record field values using fields of the same record. So that [c = 25, s = c + 5] is valid syntax and yields [c = 25, s = 30].
    I can't teach you everything here. Watch some vids, read documentation, solve problems etc.
    Last edited by AlienSx; 06-01-2024 at 10:16 AM.

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

    Re: Power Query List insert range at irregular intervals

    Thank you for taking the time to respond, I'm going to have to get rick de groot and whatshername's book. I find him pretty good, his list generate Fibonacci sequence gave me the basics for records,
    have not had a chance to work through yet, but will,

    Thanks again,

    RD
    Last edited by Dicken; 06-02-2024 at 07:57 AM.

+ 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. How can I concatenate text at irregular intervals?
    By dogplayingpoker in forum Excel General
    Replies: 3
    Last Post: 01-07-2015, 05:22 PM
  3. Calculating quantiies from irregular intervals to regular intervals
    By abhi1421 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-15-2014, 06:34 AM
  4. histogram with irregular intervals or labeling XY scatter
    By rana12345 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-02-2013, 06:52 AM
  5. Converting Data in Irregular Time Intervals into Regular Time Intervals
    By AlexJT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2011, 02:42 AM
  6. Need to Transpose Irregular Time Intervals into Regular Time Intervals
    By AlexJT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2011, 08:30 PM
  7. [SOLVED] How to display gridlines at irregular intervals?
    By Jason Weiss in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-03-2005, 04:06 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