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
CSV and TSV exports should have a consistent order of columns #12156
Comments
Hi @iamwebrocker In your case could you list some example of CSV data exports causing random column order? wondering if all APIs are affected or just a few. Thanks, |
Hi @mattab, Select the segment from dashboard: Export csv, limit to three months: The resulting csv from August and September show different column orders (see ***):
|
oops, wrong button, sorry :-) |
@iamwebrocker Did you generate those two exports with the same Piwik version or did the order change after doing an update of Piwik? |
hi @sgiehl, the exports were made with the same piwik version/install (3.1.0). The "August" export happened mid-september, the "September" last week. |
Thanks for clarification. Will try to reproduce that on my local instance and have a look if I'm able to fix it |
@sgiehl thanks for taking care of this. If it helps, I would give you temporarily access to the live instance where this happen(s|ed). What I didn't check: Does the order change when I repeatetly export from the same range/view. I could do/check this in the meantime, if it helps. |
Yes, it would help if you would check that. I'll get back to you if I need some access... |
Here's the order of another segment which doesn't show differences with the same settings as above in the same range:
|
I compared the resulting CSV upon noticing that this seems only to happen with segements that have fairly low counts. I notice that the "wrong" ones (assuming that the order with "Durschnittliche Besuchszeit (in Sekunden)" at the last position is the correct one) have empty values in the the CSV, e.g. ",,," instead of "3,0.4,100," etc.
Notice the succession of empty values at the end of the last row. And here is another one, this time the "August" CSV of the first example:
Again, empty values, this time in the second row. Maybe this is a pointer to what's going on there? |
Note this was also duplicate for TSV exports in #10186See this forum post for details: https://forum.piwik.org/t/set-the-order-of-columns-in-export/8020 Reproduce
I haven't checked, but maybe this issue occurs only for the API Proposed solutionColumns should be displayed in a consistent order in our exported API data sets. Same issue as #12156 |
Hi,
I noticed a (to me) strange behavior when exporting CSV data:
Every month I export the metrics from, say, "Users" overview. I keep the range for the export as "3 months", so I get the three recent months (but I played around with larger ranges as well, it doesn't change the behaviour). I collect these CSVs in a spreadsheet and have some kind of dashboard table where I collect/display the data.
I noticed that though the amount of columns don't change, and always the same "view" is used, the order of the columns vary across the months. One month the "unique visitors" are in column D, another month they are in another column.
The critical thing in my workflow is currently that I need to manually check if the data is indeed in the column I referenced from my "dashboard" table. It is easy to spot when a time-based metric like visitor time swaps places with a simple count, but it is very hard to spot if "Download" swaps places with "Pageviews".
I think I could tweak my workflow to re-order the columns alphabetically or something like this, but what I'd like to know, why do the columns swap places, if similar views are exported from month to month?
cheers, and thanks for all the work done here,
Tom
The text was updated successfully, but these errors were encountered: