Download Views CSV automatically Daily
Maybe you want to consider the Forena module (disclosure: I'm a co-maintainer of it) ... Here is a quote from that page:

... built of the idea of using SQL to get data out of a database and use XHTML and CSS to format it into web reports.
It is designed to leverage existing knowledge of HTML, CSS, SQL and JavaScript to help you create rich interactive web reports.

Here is another quote from Reasons for considering Forena, related to the &quot;CSV&quot; in the question here:

Reports created by Forena (combined with SVGGraph and mPDF) can be saved (exported) as PDF documents with embedded graphs. Other supported formats for saving a report are CSV, XLS, DOC, HTML, etc.

My answer to &quot;How to retrieve data directly from a Drupal database&quot; contains like a 1 minute summary to explain the typical (about 3) steps for creating:

a connection to an external database (typically by an admin).
a custom SQL query (typically by an admin).
a custom report (either by an admin, or by just any regular user who is either familiar with creating what is called 'FRX files', or otherwise using the WYSIWYG report editor).

These steps (without any PHP coding involved ...) are like the equivalent to writing the PHP coding as included in the question there.
For an online demo (prior to installing/testing Forena), refer to these links:

Reporting samples, about data stored in some SQLite database, and including things like drill down reports, creating charts (using the PHP SVG Graph library), etc.

Forena Documentation, which you also get in your own site after installing the module). It contains topics such as (incomplete list):

Module installation and administration, a kind of getting started guide.
WYSIWYG Report Writing, using a report editor to facilitate the creation of reports.
Site Building, topics about integrations of Forena with other Drupal modules.
Forena hooks, to use it in other (custom) modules.