@ghost opened this Issue on February 26th 2015

Currently, when you export custom variables in CSV or TSV, you get a file name like:
"Piwik Exporter [start date] - [end date] .csv"

It would be a nice feature to have an extra GET variable to name the file. Example: "downloadName=mySpecialReport" would give: "Piwik Exporter mySpecialReport [start date] - [end date] .csv"

@mattab commented on April 8th 2015 Member

Thanks for suggestion @rogertheshrubber

maybe we could automatically include the report name in the filename eg. Piwik Exporter _ Custom Variables _ [start date] - [end date] .csv

and even maybe add the website ID or name Piwik Exporter _ Custom Variables _ [start date] - [end date] _ Website $NAME_HERE .csv

@ghost commented on April 8th 2015

That would be good by default, but I still think it would be better to set your own name somehow. At work we're creating multiple reports with several custom variables. We won't be exporting all custom variables in one report, but rather different groups of custom variables in different reports. If we were to export all of them, we couldn't tell the difference between each report by the name.

@martenkoetsier commented on January 3rd 2022

My biggest issue in the filenames is the date formatting. The reports are currently named with the $prettyDate, which causes the reports to be not sortable. I would strongly prefer the ISO date format in the filename (e.g. 2022-01-03) because that is sortable. Sorting is important when you want to find a specific report in a directory with many reports.

Perhaps there could be an option "local date formatting or ISO8601 formatting"?

@tsteur commented on January 4th 2022 Member

Indeed @martenkoetsier that could be improved. What do you suggest what it would look like for weeks or other date ranges? like Export _ Exit pages _ week 2022-01-03 to 2022-01-09.csv? A problem might be also different date formats which we would probably need to respect as sometimes the order of day / month / year is different. Having the month in the name written makes this bit more clear

@martenkoetsier commented on January 4th 2022

@tsteur Yes, that format would work. The part before the date (Export _ Exit pages _ week, or in my cases for example Report the-name -) will remain the same over time. Thus with many reports stored in a directory it does not influence ordering.

Respecting local date formatting is great for everyone who wants it. Indeed, the order of the fields is different for various languages, making a date such as 2/3/2022 ambiguous and that could be solved by writing the month as a name. However, the issue with that is that it sorts non-chronological. That's why I suggested to (optionally) make use of the ISO8601 formatting, which is always clear: the largest "temporal term" always comes first: year, month, day. No need to replace the numbers with names anymore.

I have not yet found any way to set the date formatting in Matomo. It might be linked with some language setting. I do need Matomo to be in English, not any other language (even though I am Dutch). With this, the "pretty date" is Weekday_name, Month_name day_of_month, Year (year with 4 digits). As an illustration, my daily reports are therefore ordered as:

  • First order by day-of-week, in alphabetical order of English day name: Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday.
  • Then per day-of-week: order by month, in alphabetical order of English month name: April, August, December, Februari, Januari, Juli, June, March, May, November, October, September.
  • Then, per month: order by day-of-month, in alphabetical order (that is, not the logical order): 1, 10, 11, 12, ..., 18, 19, 2, 20, 21, ..., etc.
  • Finally, per day-of-month, order by the year.

I think everyone understands that finding a specific report is not easy. Hence my desire to name them:

Report some-name - yyyy-mm-dd.pdf

or

Report some-name - yyyy-mm-dd <dayname>.pdf

Or for weekly reports (ISO8601 has a format for that too):

Report some-name - week yyyy-Www.pdf

or just

Report some-name - week yyyy-mm-dd to yyyy-mm-dd.pdf

And for monthly reports:

Report some-name - month yyyy-mm.pdf

All these options share one essential property: they are easily sorted in chronological order of the report-period.

Powered by GitHub Issue Mirror