You did not specify whether or not CSV has to be created on fly, or You have some pre-made CSV files stored on the server and You want to download specific file based on some condition on client side. Some more information would definitely help.
For dynamic CSV creation and download here's a PHP article showing how to achieve it (concepts can be transfered to other server side languages as well) >> Creating downloadable CSV files using PHP
For pre-made CSV files You can generate file link dynamically and call it using client side JavaScript:
var userName = "dan"
if(userName === "dan")
{
window.open("http://sitename.com/dan.csv","_self")
}
else if (userName === "mark")
{
window.open("http://sitename.com/mark.csv","_self")
}