Skip to main content

SSIS to load excel table from any place in a sheet.





Excel source can contain a table anywhere within a sheet, but for each table there is a starting cell and an end cell. In SSIS Excel SQL Command we can precisely select this table by defining those two cells.
Consider the following scenario where the table within an excel sheet starts from the cell W7 and goes till AJ38
For this purpose, we can execute the SQL command option in SSIS and let’s discuss more on this.
First of all, in a table within an excel sheet following are the parameters to be known
Sheet Name - Monthly SSC Report$ (Sheet name can be noticed in the normal selection pane)
Starting Cell - W7
Ending Cell - AJ38
Using the above information, we can form the following SQL command for Excel and extract the data, once it is extracted we can define column names manually and automate it but if there is a scenario where there is more data than the range specified in future it will not be extracted so it is better to have have the ending cell as far down as possible something like AJ500.
SELECT * FROM [Monthly SSC Report$W7:AJ38]





Comments

Popular posts from this blog

Choosing color scheme for Power BI reports

Choosing beautiful colors for an attention seeking Power BI report is always challenging. Sometimes we may have an important message but it might go unseen if proper color scheme is not used, so it is important to create reports which are informational and visually appealing. In this blog our main objective is to get an idea about selecting appropriate color scheme and tools that can be beneficial to do this. What is a color scheme? As you all know not all colors look great together and you can tell stories by just having only two colors, have a look at the following image, there in the middle you can see a circle with same color and same dimension, only thing that changes is the back ground, but depending on the back ground the way you see those circles are totally different. Some small circles appear softer, some appear sharper, and some are brighter also you might notice movements or depth effect too. It is important to choose colors wisely to serve the purp...

Ragged hierarchy in Power BI

Case- I have a data set which has to be visualized in a ragged hierarchy. What is ragged hierarchy A ragged hierarchy is a user defined hierarchy with an uneven number of levels.   You can see the above table which has 5 levels of hierarchy. In the first level we only have “World” as a category then moving forward to the next level we have two categories  namely “UK” and “USA” likewise the level of hierarchy is drilling down up to five levels with an uneven amount of categories. Creating a hierarchy in Power BI In the above image  you can notice that I have right clicked the “level 1” column which has to be the first level of our hierarchy, Once it is right clicked there you will notice “New hierarchy” as the second option then you will have to click that in order to create a new one. As you can notice in the above image once I have created a new hierarchy then a new column is created named “Level 1 Hierarchy” in that I have d...

Invoke a stored procedure in SQL server for a given parameter in Power BI

Case- In some cases we need to filter the data that has been imported from a SQL server database where it is not advisable to create a new query all the time. Prerequisite – You need to have a SQL server database where it should contain a two column table with "town-id" and ''town-name'' also you need to create a stored procedure to accept town-id as input parameter and return the town-name as out put.  We are going to run a native query in Power BI with changing parameter values so in order to avoid too many confirmations go to "Files" then "Option and Settings" then "Option" then "Security" then untick Require user approval for new database queries in Power BI. Calling a stored procedure from SQL server when importing data to Power BI As you can see above I have chosen “SQL Server” in the “get data” option from task bar in order to import data from SQL Server database. Then I have given the serve...