Results 1 to 5 of 5

Power Query ; Custom function to work on a list

Threaded View

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

    Power Query ; Custom function to work on a list

    Hi,

    I have made a custom function to work on a list and insert a range of values, I have not worked these into the function yet,

    the fucntion in based on this

    let rc = List.Count( Source ) , 
    
    check = rc / grupe = Number.IntegerDivide( rc,grupe) , 
    
    n = ( Number.IntegerDivide( rc, grupe ) * insertN ) + rc , 
    
    slist = { grupe..n } , 
    altlist = List.Alternate( slist, ( grupe + insertN )-1, 1,1) 
    
    in if check = true then List.RemoveLastN(  altlist, 1  ) 
    
    else altlist
    and the list.Accumulate to insert rows at the above positions,

    List.Accumulate(  Altlist , Source, (S,C)=> List.InsertRange( S ,C, insert ) )
    But I have made a basic function not incorporating the rows to insert or grouping by number, but I can only get it to work
    by type it in so; Function ( list) , but can't figure out how to use the options to enter parameter ; invoke dialog box ?
    is there a way to select a list as you would a table? I don't know whether to use ( func name as list) => or just leave it out ?

    I have attached work book with example and function,

    Richard.
    Attached Files Attached Files
    Last edited by Dicken; 04-27-2024 at 07:31 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Power Query Custom replacer function
    By Dicken in forum Office 365
    Replies: 10
    Last Post: 12-03-2023, 12:03 PM
  2. [SOLVED] Power Query custom function variable to make table a list
    By Dicken in forum Office 365
    Replies: 10
    Last Post: 07-08-2023, 11:13 AM
  3. How to update a custom function in Power Query
    By MangoFresh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2023, 08:58 AM
  4. Power Query Custom function for running total
    By Dicken in forum Office 365
    Replies: 6
    Last Post: 10-29-2022, 10:58 AM
  5. Power query Custom function / parameter query
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 03-23-2022, 10:41 AM
  6. Replies: 1
    Last Post: 02-14-2022, 06:23 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

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