Query All The Things (qatt) - Plugin to allow you to query your vault and more with customized rendering

I have done some more updates to the documentation and added some more samples to make it clearer.

The like statement needs the wildcards.

query: |
  SELECT * 
  from dataview_pages
  where file->folder Like "Periodicals/Daylies%"

For joins all the ones alasql supports the plugin supports.

Here is an example that shows the count of tasks per page to show completed and total tasks.

query: |
  SELECT TOP 10 
    notes.*, 
    tasks.*, 
    cast((tasks.CompletedTasks/tasks.TotalTasks) * 100 as int) AS perCompleted
  FROM obsidian_markdown_notes AS notes
  JOIN (
    SELECT 
      COUNT(*) AS TotalTasks, 
      COUNT(case when status = 'x' then 1 else null end) AS CompletedTasks, 
      COUNT(case when status <> 'x' then 1 else null end) AS PendingTasks, 
      page 
    FROM obsidian_markdown_tasks 
    GROUP BY page
  ) AS tasks ON notes.path = tasks.page
  ORDER BY perCompleted DESC
template: | 
  {{#each result}}
    - {{basename}} - '{{perCompleted}}%' - {{CompletedTasks}}/{{TotalTasks}}
  {{/each}} 
1 Like