albertvaka / bettercounter

A daily counter to track habits
GNU General Public License v2.0
133 stars 15 forks source link

Formatting of exported CSV #8

Open gevhaz opened 3 years ago

gevhaz commented 3 years ago

Currently, the exported file is a CSV with the name of the counter in rows and each instance in a new column. I think it would be better to have the counters in columns and a new row for each new instance. In other words. to "transpose" the spreadsheet. This is easier to get an overview of since we otherwise get a very long list of columns after using the app for a while. It is also the standard for statistics, at least as I've understood it from other apps and academic datasets.

Then there is a second issue of instances on the same column having nothing to do with each other. Basically, each counter is a list and they just happen to be next to each other in a spreadsheet. I'm not sure if this should be changed, but I can imagine for example having names of counters in columns and dates in rows. Something like this:

Counter 1 Counter 2
2021-04-23 2 5
2021-04-24 0 4

The problem with this is that we lose time precision for when something occurred. My actual preferred method might be to have the variables "counter name" and "time" in columns and a single occurrence on each row, like this:

Counter name Time
Counter 1 2021-04-23T08:33:24
Counter 2 2021-04-23T11:16:54
Counter 2 2021-04-23T19:01:12
Counter 1 2021-04-24T09:15:32
Counter 2 2021-04-24T10:45:44

Using UNIX timestamps (or whatever they're called) like present, would of course also be fine.

ltguillaume commented 3 years ago

Makes sense!

HappyClem commented 1 year ago

I like the idea, tho I more often use the total per counter instead of the time of occurence. Could both exist in 1 export ?

sonst-was commented 7 months ago

I like the idea, tho I more often use the total per counter instead of the time of occurence. Could both exist in 1 export ?

I don't think the total needs to explicitely be present in the export, as it's easily calculated from the times of occurences.

MikeStirner commented 7 months ago

A bit more ideal, but if you are using the export (the way it is now), you're going to probably be skilled enough to transform it into whatever format you want to have.

There is an upside to the format that the export is currently in, which is that somebody who doesn't really know how spreadsheets work very well can pretty easily do a sum() function, and sum up the total count for each item quite easily.

Personally, I'm just glad any kind of export with timestamps is in the app!

albertvaka commented 7 months ago

A column-based export format would be best for using in a spreadsheet, but I think the current format is best for parsing using python or any other programming language.

Both formats have pros and cons, but since we already went with one format I would rather stick with it. If we change it now we should still allow importing files exported in the old format, which would be a bit cumbersome to implement.

MikeStirner commented 7 months ago

Yeah, I never use Python or any kind of coding language because it's something I'm not really familiar with and don't want to get into, but I do use spreadsheets because I use those a lot. They're pretty simple and easy to get into.

If I made a spreadsheet that converted the current export format into the format that the original poster was suggesting, I'll post it on here. I'd make sure it's something that will work in LibreOffice so that people can do it for free and offline.

MikeStirner commented 7 months ago

And here's that spreadsheet! It's a .ods so you can open it with LibreOffice Calc, which is what I used. Instructions are inside. You should be able to get all the data into the desired format mentioned by the author in about a minute once you read the instructions and get used to it. bettercounter analyzer.ods