Open jarpolacek opened 1 year ago
Depending on how long you have been tracking, it might be easier to invert what you have been tracking instead.
Seconding this. I'm just getting started setting up my Obsidian habit tracker and would love to see my streaks for avoiding bad habits
@jarpolacek In case you're interested, here's a workaround I came up with using Dataview.
```dataview
CALENDAR date(file.name, "dd-MM-yyyy")
FROM "Daily"
WHERE !badHabit AND !veryBadHabit
This is tailored to my specific notes but just to give you an idea.
This takes notes which have the date as their title and fixes the formatting.
The notes are stored in the "Daily" folder
The calendar is marked as long as the bad habits have a value of null
or 0
I think I figured it out
searchType: frontmatter
searchTarget: Bad Habit
folder: Folder/Folder
datasetName: No Bad Thing!
valueShift: -1
penalty: 1
month:
" valueShift: -1 penalty: 1 "
valueshifts the "i did the bad thing" true(1) down to 0, and then having a null value returns a 1 which is the inversion you're wanting for a bad habit. Just make sure you're template's default value for that habit is a null and not false.
Would be nice if there was clearer one-line parameter that can invert a boolean like this. but this works for now.
I have data that is a Boolean value of 1 and 0. By default, I use the calendar view based on the "month:" command and it will display the days, with a value of 1. Can I invert the logic to display 0? I tried showSelectedValue: false, but that had no effect...