Toad World® Forums

Exporting filtered results to Excel

In TDP workbook 5.05.61, when I add a report step and export results to Excel, it exports all the results even if I have applied filters to the results. Shouldn't it only export the filtered results?

What filters are you referring to? If you added filters on a result grid or filters on a pivot, then the answer is no, they do not effect the export data. They are on the top view layer. Instead you need to filter your data through use of variables in your SQL Query.

Have you tried selecting the first filtered row and shift clicking the last row and then right click the highlighted selection and export to Excel? I know copy and paste will work (up to a limit on how many rows and columns, your memory is going to give out at some point). Filtering in the SQL query as the Toad Goddess, Debbie mentioned is probably best (definitely most efficient for most cases). 2nd would be to run the query directly to Excel and then use a pivot table or data filter to get what you want. Again size and what your are actually trying to accomplish can matter here. The reason for not filtering in the SQL query would be if you have multiple asks of the same result and want to present it different ways and it is faster to pull the data once and then slice it and dice different ways, then you want to send the result to an Excel pivot table and do the filtering there with one or more pivots.

Greg, I found that I can click the first row of filtered results, then shift-click the last row to select all the filtered results. I also noticed that clicking
the box in the upper left corner or control-A will also highlight all the results. In workbook right-clicking the highlighted section doesn’t bring up any menu but control-C will copy the highlighted data to the clipboard and then I’m able paste into Excel.