generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 247
Open
Description
Is there a way to do a conditional statement? I would like to track a habit and know when the last time I did something was. However, if I haven't done that yet, I would like to be able to see that too.
For example, here is a simple template
searchType: task.notdone, task.done
searchTarget: Walking, Walking
folder: Diary\2026
summary:
template: " - Walks this year: {{sum(dataset(1))}}\n - Last walk (if the above isn't zero, otherwise ignore) {{endDate(dataset(1))}}\n - Worst streak so far: {{maxStreak(dataset(0))}} days."
However, if you haven't completed the task even once in the dateset, then endDate is the current date
It would be nice to have something like a ternary operator so that you can have something like
dataset(1) == 0 ? No walks so far : endDate(dataset(1)
Metadata
Metadata
Assignees
Labels
No labels