PowerPivot Adding new sheet to already created Database.

countryfan_nt

Well-known Member
Joined
May 19, 2004
Messages
765
Hello friends, hope all is well!

The below code uses a SQL code to combine multi sheets (workbooks) into 1.

because there are many rows it is expected to take time, that is OK. The process is done. Now, I want to add on a different date a new sheet,
let us say F:\DATABASES\AvgClaimCo\14.xlsb`.[JAN-APR$]

Can somebody please help, and tell me how can I add the above sheet to the existing already added sheets from a previous period.
instead of redoing the UNION ALL All over again of 2015,2016,2017,2018?

This will save loads of time, and effort. Thanks a lot in advance!


Code:
SELECT [HEAD$].*   FROM [HEAD$]


UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\17-18.xlsb`.[JAN-APR$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\17-18.xlsb`.[MAY-AUG$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\17-18.xlsb`.[SEP-DEC$]


UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\16.xlsb`.[JAN-MAR$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\16.xlsb`.[APR-SEP$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\16.xlsb`.[OCT-DEC$]


UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Jan-Mar$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Apr-Jun$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Jul-Sep$]

UNION ALL 
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Oct-Dec$]
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top