cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic SQL to union current and future tables

TCoomes
Partner
Partner

Hello, 
   I am trying to union 36 tables together. The challenge comes in because there is another table that I need to union each month. So next month ill have 37 tables and the following ill have 38. Is that something we can do within Incorta? Trying to get around manually adding the newly added table each month. 

1 REPLY 1

RADSr
Partner
Partner

I'll bet that you can do it w/in a notebook looping through a series of table names providing the names are consistent.

I had a similar situation where I did not use a notebook, but instead created in advance the Incorta tables knowing they'd be populated at some point and until then would return zero rows.    Not elegant, but it works.

If you want to go the route of using files in Incorta you can use a wildcard to read them which would allow you to add source files instead of tables and pull them all into one table.