Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Exported file names #7308

Open
ghost opened this issue Feb 26, 2015 · 5 comments
Open

Improve Exported file names #7308

ghost opened this issue Feb 26, 2015 · 5 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.

Comments

@ghost
Copy link

ghost commented Feb 26, 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
Copy link
Member

mattab commented Apr 8, 2015

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

@mattab mattab changed the title Set Name of Export File Improve Exported file names Apr 8, 2015
@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Apr 8, 2015
@mattab mattab added this to the Mid term milestone Apr 8, 2015
@ghost
Copy link
Author

ghost commented Apr 8, 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.

@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@martenkoetsier
Copy link

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 tsteur added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Jan 4, 2022
@tsteur
Copy link
Member

tsteur commented Jan 4, 2022

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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

3 participants