The TASK Query outputs an interactive list of all tasks in your vault that match the given data commands (if any). TASK queries are special compared to the other Query Types because they do give back Tasks as results and not pages. This implies that all data commands operate on Task level and makes it possible to granularly filter your tasks i.e. for their status or meta data specified on the task itself.
Also, TASK Queries are the only possibility to manipulate your files through DQL. Normally, Dataview does not touch the content of your files; however, if you check a task through a dataview query, it’ll get checked in its original file, too. In the Dataview Settings under “Task Settings”, you can opt-in to automatically set a completion meta data field when checking a task in dataview. Mind though that this only works if you check the task inside a dataview block.
TASK Query Type:TASK queries render an interactive list of all tasks in your vault. TASK Queries are executed on task level, not page level, allowing for task-specific filtering. This is the only command in dataview that modifies your original files if interacted with.
```dataviewTASK
**Output**
- Buy new shoes #shopping
- Mail Paul about training schedule
- Finish the math assignment
- Finish Paper 1 [due:: 2022-08-13]
- Read again through chapter 3 [due:: 2022-09-01]
- Write a cheatsheet [due:: 2022-08-02]
- Write a summary of chapter 1-4 [due:: 2022-09-12]
- Hand in physics
- Get new pillows for mom #shopping
- Buy some working pencils #shopping
You can use data commands like for all other Query Types. Data Commands are executed on task level, making implicit fields on tasks directly available.
```DV
```dataview
TASK
WHERE !completed AND contains(tags, "#shopping")
**Output**
- Buy new shoes #shopping
- Get new pillows for mom #shopping
A common use case for tasks is to **group tasks by their originating file**:
```DV
```dataview
TASK
WHERE !completed
GROUP BY file.link
**Output**
2022-07-30 (1)
- Finish the math assignment
- Read again through chapter 3 [due:: 2022-09-01]
- Write a summary of chapter 1-4 [due:: 2022-09-12]
2022-09-21 (2)
- Buy new shoes #shopping
- Mail Paul about training schedule
2022-09-27 (1)
- Get new pillows for mom #shopping
**Counting tasks with subtask:** Noticing the (1) on the header of `2022-07-30`? Child tasks belong to their parent task and are not counted separately. Also, they **behave differently** on filtering.