• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

How to expand list of tables generated from list.generate function and append columns of each table|Power Query|Excel Forum|My Online Training Hub

You are here: Home / How to expand list of tables generated from list.generate function and append columns of each table|Power Query|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryHow to expand list of tables genera…
sp_PrintTopic sp_TopicIcon
How to expand list of tables generated from list.generate function and append columns of each table
Avatar
Tan Sin Ling

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 21, 2022
sp_UserOfflineSmall Offline
1
May 21, 2022 - 5:06 pm
sp_Permalink sp_Print

I have generated a dynamic list of tables using list.generate function. May I know how to expand each table from list and append columns of each tables. Column 2 is reference column and append Column 3 of each table.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
May 23, 2022 - 2:39 pm
sp_Permalink sp_Print

Hi Tan,

Can you clarify please? Hard to see your structure.

You have the list of tables in a list object? Or it's just in a new column in a table object?

Avatar
Tan Sin Ling

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 21, 2022
sp_UserOfflineSmall Offline
3
May 24, 2022 - 12:43 am
sp_Permalink sp_Print

Hi Catalin,

It is the list of tables in a list object. Actually I would like to perform looping function but I don't know how to write the iteration code. The looping step is to get the table data from table in list position 0, then append column 3 of the table to a reference column. Then perform the loop for next table.list.pngImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage list.png (188 KB)
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
May 28, 2022 - 5:23 pm
sp_Permalink sp_Print

Hi Tan,

You can convert the list to a table and expand only column 3, this will provide a single column result.

Not sure what means appending to a reference column, where is that reference column?

For example, the following line will take a list of tables (Custom1) and combines then one by one, at each iteration, starting from an empty table #table({},{}) :
= List.Accumulate(Custom1,#table({},{}),(current,state)=>state & (current))

Avatar
Tan Sin Ling

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 21, 2022
sp_UserOfflineSmall Offline
5
May 28, 2022 - 9:22 pm
sp_Permalink sp_Print

Hi Catalin,

I able to generate list of tables. Each table has same column headers [Column2] and [Results]. The number of tables in the list is more than hundreds. I would like to perform like table.nestedjoin function for [Column2] and append each [Results] of table. I am thinking to use list.accumulate but it would have same column name for each iteration of joining. May I know how to solve this?

Source is list of tables.

Table.NestedJoin(Source{0}, {"Column2"}, Source{1}, {"Column2"}, "Final", JoinKind.LeftOuter)

list-1.pngImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage list-1.png (159 KB)
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
6
May 29, 2022 - 11:05 pm
sp_Permalink sp_Print sp_EditHistory

You can use this step, assuming that PreviousStepName is a list of tables:

= Table.FromColumns(List.Skip(List.Accumulate(PreviousStepName,{{}},(state,current)=> state & {current[Results]} ),1))

Avatar
Tan Sin Ling

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 21, 2022
sp_UserOfflineSmall Offline
7
May 31, 2022 - 12:39 pm
sp_Permalink sp_Print

Hi Catalin,

It works and solved. Thanks much.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Denise Lloyd
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Raj Mattoo
Mark Luke
terimeri dooriyan
Jack Aston
AndyC
Denise Lloyd
michael serna
mashal sana
Tiffany Kang
Leah Gillmore
Forum Stats:
Groups: 3
Forums: 24
Topics: 6219
Posts: 27276

 

Member Stats:
Guest Posters: 49
Members: 31903
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.