Dataview 实战 - 将一周的元数据显示为 emojis(习惯跟踪)

Dataview 实战 - 将一周的元数据显示为 emojis(习惯跟踪)

利用 dataview 提供的 choice 函数,我们可以把输出值修改为 emoji,使得表格更加直观,下面给了两种使用示例,可以参考这两段代码的使用方式以及结果构建属于自己的 dataview 查询语句。

```dataview
TABLE 
    choice(praying, "💚", "➖") AS Praying, 
    choice(breathing, "💚", "➖") AS breathing, 
    choice(beingthankful, "💚", "➖") AS "being thankful", 
    choice(slowdown, "💚", "➖") AS "slow down"
FROM "10 Example Data/dailys"
WHERE wellbeing.mood > 0 AND date(file.day).weekyear = 2
```

Dataview 实战 - 将一周的元数据显示为 emojis(习惯跟踪)--

```dataview
TABLE 
	choice(wellbeing.mood = 1, "😢", 
	choice(wellbeing.mood = 2 or wellbeing.mood = 3, "😐", 
	choice(wellbeing.mood > 3, "😃", ""))) as Mood, 
	choice(praying, "💚", "➖") AS Praying, 
	choice(breathing, "💚", "➖") AS breating, 
	choice(beingthankful, "💚", "➖") AS "being thankful", 
	choice(slowdown, "💚", "➖") AS "slow down"
FROM "10 Example Data/dailys"
WHERE wellbeing.mood > 0 AND date(file.day).weekyear = 2
```

Dataview 实战 - 将一周的元数据显示为 emojis(习惯跟踪)--

讨论

若阁下有独到的见解或新颖的想法,诚邀您在文章下方留言,与大家共同探讨。



反馈交流

其他渠道

版权声明