Forum

Combine multiple Ta...
 
Notifications
Clear all

Combine multiple Table With List.Accumulate

7 Posts
4 Users
0 Reactions
371 Views
(@farshad4510)
Posts: 19
Eminent Member
Topic starter
 

Hello I think the question is clear and does not need an explanation. Please assume three tables in an Excel file and solve the problem with the function mentioned in the title.

 
Posted : 01/12/2022 2:15 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Farshad,

The tone of your email does not come across well. If you would like an answer to your question, it is courtesy to provide some data yourself rather than expect our volunteers to do the work for you. We do not know if the data in the three separate tables is the same, has the same headers etc. There are many assumptions to be made.

I recommend you rephrase your question and provide a file.

Mynda

 
Posted : 01/12/2022 6:59 pm
(@farshad4510)
Posts: 19
Eminent Member
Topic starter
 

You are absolutely right, a file is attached

 
Posted : 02/12/2022 12:56 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Farshad,

Why do you want to use List.Accumulate for this?  You can just append (combine) the tables to create 1 table.

= Table.Combine({Table1, Table2, Table3})

Regards

Phil

 
Posted : 02/12/2022 1:07 am
(@farshad4510)
Posts: 19
Eminent Member
Topic starter
 

Hello to Philip and Mynda . I had seen uses of  List.Accumulate In order to understand more about this function, I asked the members  to add this example as well. I am a beginner in programming and I am old, so I am trying to learn by seeing many examples

 
Posted : 02/12/2022 3:00 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Farshad,

List.Accumulate is not necessary in this scenario.

However, the query looks like this:

let
Source = List.Accumulate({Table1,Table2,Table3},#table({},{}),(state,current)=>Table.Combine({state,current}))
in
Source

List.Accumulate is an iterator. When we have a function (Table.Combine) that can combine tables in a single operation, iterators are no longer necessary.

What it does:

Iteration 1: Combines first table with the empty one (state is initially an empty table), state = Table1

Iteration 2: Combines first table with second table, state = Table1 & Table2

Iteration 3: Combines  state with third table, state = Table1 & Table2 & Table3

 
Posted : 03/12/2022 2:15 pm
(@farshad4510)
Posts: 19
Eminent Member
Topic starter
 

Hello Catalin. Thank you for your reply
Mynda and the rest of the members  Again, I apologize if there was a misunderstanding

 
Posted : 03/12/2022 4:01 pm
Share: