I wanna find out the amount of time I have spent playing Red Dead Redemption 2
“RDR2” only appears in my daily note in the overview section, indicating the amount of time I have spent playing the game throughout the whole day.
Summing the duration of RDR2 across all my daily notes will give me the time I have spent playing this game in my lifetime, which is what I want to find out.
If you know Python, I wonder if a plugin like Jupyter or Code Emitter (both available in the Community Plugins list) would let you operate on the data in that manner.
You’ve got some non-duration values in there, which could cause issues when adding up the total, so here’s a query to list those:
```dataview
TABLE RDR2
From "Permanent/Diary"
Where RDR2
AND typeof(RDR2) != "duration"
```
Hopefully this just list out those few text variants in there, but I’m a little “worried” about that multi-valued variant in there.
The main query, untested but hopefully working, is as follows:
```dataview
TABLE WITHOUT ID
sum( filter(flat(rows.RDR2), (r) => typeof(r) = "duration" )) as "Total playing time"
FROM "Permanent/Diary"
WHERE RDR2
GROUP BY true
```
The trick here is to first select only the files having the field, and then group everything into rows.RDR2, before treating this multi-level list using flat(). flat() flattens the list to one level, allowing us to filter out only the values which are durations, which we then sum to get the total playing time.
That calculates out to about 5% of your total time during those two months (more if you subtract sleeping time). Good on you for tracking that information and using it to refine your use of time. (Remember, it’s the literally the most non-renewable resource you have. We all get one tank of the stuff, and although it drains away almost imperceptibly at times, once it’s gone, it’s gone.)
Well, it’s been two years since I begin trying to make something out of this mess of a life. Started by simply reading “Atomic Habits”, started waking up at 6, and studying more…
Starting simple is how many great journeys begin, so it sounds like you’re following in the right footsteps. As someone once said, “The best time to plant a tree is 20 years ago; the second best time is today.” The important thing is that your tree is planted, and it sounds like you’re already starting to benefit from its fruit and shade.
Keep up the great work, and feel free to check in from time to time to share how it’s going if you like!