I'm using this function to sort and export data to excel
window.exportData = function () {
data.sort(function(a, b){
return a.destino - b.destino;
});
alasql("SELECT * INTO XLSX('cities.xlsx',{headers:true}) FROM ? ", [data]);
it works well. I need to change the name 'cities.xlsx' for a name like, for example,
var filename = 'cities'+variable+'.xlsx';
and obtain
alasql("SELECT * INTO XLSX("filename",{headers:true}) FROM ? ",[data]);
in order to avoid confusions with saved files in excel.
Thank you in advance.