Split table to multiple tables in Power Query!

Hi Team,

I have a tricky problem and I think someone might be able to help with this. I have a file with 49,755 records and I want to post files. But SAP journal allows a max of 999 lines to load, so I will have to split this one file into many files. Following are the requirements to load the journal:

  1. The files should be split by Fiscal period (FIS_Period column and we have 1 to 3 periods).
  2. In each Fiscal period, we have many records, so these will split further based on 998 lines in each file.
  3. We should have the last line entry which makes the total to 0. e.g if the SUM of all [Amount] Column in one file is 10,000 then we should have the last line as below. The reason is that the total of the journal should be 0.

So, overall if we get this done, I think we will get the following number of files.

Period 0 – 3 files
Period 1 – 16 files
Period 2 – 17 files
Period 3 - 17 files

Demo Data.xlsx (2.0 MB)

Any hint to solve this problem is really appreciated. Thanks!

Kind Regards,
Naila

Hi team,

Any luck for this request please.

@EnterpriseDNA , @Melissa , may be you can help in this query.

Kind Regards,
Naila

Hi @Naila

How you are posting the data to SAP ? Is it manual or Automation ?

Here multiple tables are dynamic, number of tables depends on Period and number of records.
As per my knowledge we can’t create tables dynamically, The only way we can create multiple tables in one shot is selecting from Data Source.

I’ve created a column Files, you can create multiple tables MANUALLY by coping the query and apply filter on this filed.

Now each table has Max 998 lines.

Split table to multiple tables.pbix (654.1 KB)

1 Like

Hi @Rajesh ,

Thank you so much for taking time to provide this solution. Yes, it would be manual load and this solution seems perfectly fine to me. I will try with team to upload journal and hopefully will not face any issue.

Thanks again for your timely support.

Kind Regards,
Naila