Logseq Simple Queries - All the basics to filter what you need

Tools on Tech
3 Apr 202323:12

Summary

TLDRThis video script from 'Tools on Tech' offers a comprehensive guide to constructing queries in Logseq, a knowledge management tool. It covers the basics of query building, the use of operators and functions, and how to filter tasks with tags and priorities. The tutorial also explores advanced features like properties for tasks and pages, which allow for dynamic and organized data retrieval. The script emphasizes the importance of understanding the underlying structure of queries for effective use of the tool.

Takeaways

  • 😀 The video aims to simplify the process of building queries in Logseq, focusing on the basics to help users extract the most out of their data.
  • 🔍 The core layout of a query in Logseq is the use of curly brackets with 'query' in the center, which Logseq can auto-generate for the user.
  • 📚 Understanding how operators and functions work within queries is fundamental, with functions followed by values inside the brackets.
  • 🛠 The query builder in Logseq is a helpful tool for constructing queries, but it's also crucial to understand the underlying code for more complex setups.
  • 📝 The importance of correct bracket placement in queries is emphasized, as errors often arise from misplaced or missing brackets.
  • 🏷 Filtering for specific tags is a key feature in Logseq, allowing users to organize their tasks by context, such as 'at home' or 'at work'.
  • 🔑 The 'and' operator is highlighted as a core element in building queries, combining multiple conditions to filter results accurately.
  • 🔄 The video demonstrates how to dynamically update queries by adjusting tags and priorities, showing the flexibility of Logseq's query system.
  • 📅 The 'between' property is introduced for filtering tasks based on specific date ranges, useful for reviewing past or planning future tasks.
  • 📊 Properties are a powerful feature in Logseq for categorizing and filtering tasks, as shown with the 'system' property for gaming consoles.
  • 📋 Page properties are discussed as a way to track information over time, such as work hours, and can be used to create overviews and summaries.

Q & A

  • What is the basic structure of a query in Logseq?

    -The basic structure of a query in Logseq is a pair of curly brackets with the keyword 'query' inside. This is the core layout that is always needed for any query.

  • How does Logseq handle operators and functions within queries?

    -In Logseq, operators and functions are used within queries by placing them between the curly brackets. The function is followed by values, and it's important to understand that Logseq does not use traditional arithmetic operators like '+' for calculations.

  • What is the purpose of the query builder in Logseq?

    -The query builder in Logseq helps users construct queries by suggesting functions and values. It can auto-generate parts of the query and helps in avoiding syntax errors related to the placement of brackets.

  • How can you filter tasks by tags in Logseq queries?

    -You can filter tasks by tags in Logseq by using the 'tag' function within a query. For example, to filter tasks tagged with 'home', you would use 'tag home' within your query.

  • What is the difference between 'and' and 'or' operators in Logseq queries?

    -The 'and' operator in Logseq queries requires all conditions to be met for a result to be returned, while the 'or' operator allows for results to be returned if any of the conditions are met.

  • How can you filter tasks by priority in Logseq?

    -You can filter tasks by priority in Logseq by using the 'priority' function followed by the desired priority level (A, B, or C) within your query.

  • What is a 'property' in Logseq and how is it used?

    -A 'property' in Logseq is a custom attribute that can be added to blocks or pages to categorize and filter content. It is used within queries to filter results based on these attributes.

  • How can you use 'page properties' to track information over time in Logseq?

    -You can use 'page properties' in Logseq to track information like work hours or book ratings over time. By adding these properties to journal entries or pages, you can create queries that filter and display this information in a structured way.

  • What is the 'not' operator used for in Logseq queries?

    -The 'not' operator in Logseq queries is used to exclude certain results based on specified conditions. It is a negation operator that helps in removing items from the query results.

  • How can you use the 'between' function in Logseq queries to filter tasks by date?

    -The 'between' function in Logseq queries allows you to filter tasks by a specific date range. You can specify two dates, and the query will return tasks that fall within that range.

  • What is the recommended approach when building complex queries in Logseq?

    -When building complex queries in Logseq, it is recommended to limit the depth to around two layers (e.g., 'and' followed by multiple 'or' or 'not'). If the query becomes too complex, it might be better to use advanced queries or break it down into simpler parts.

Outlines

00:00

😀 Introduction to Query Building Basics

The speaker introduces the concept of query building in Lockseek, aiming to simplify the process of extracting data. They explain the basic structure of a query, emphasizing the use of curly brackets and functions. The importance of understanding operators and functions within queries is highlighted, with a practical example of filtering tasks based on their status. The Query Builder's utility in constructing queries is demonstrated, and the significance of correct bracket placement to avoid errors is stressed.

05:01

🔍 Advanced Query Construction with Tags and Priorities

This paragraph delves into the use of tags for organizing tasks and the application of priorities to distinguish the importance of tasks. The speaker illustrates how to create a query to filter tasks by context, such as 'at home', and demonstrates the use of the 'and' operator to combine multiple criteria. They also discuss the limitations of the Query Builder and how manual adjustments can be made to refine query results, including the dynamic updating of queries as task properties change.

10:03

📅 Utilizing Dates with Between and Related Dates

The speaker explores the use of dates in queries to filter tasks based on when they are due or were completed. They explain the 'between' function, which allows for tasks to be retrieved within a specified date range, and note the limitations when using related dates directly in the Query Builder. Practical examples are given, such as creating a task for a specific date and then filtering tasks from a certain period, like the last seven days.

15:06

🎮 Properties for Enhanced Task Management

In this section, the speaker introduces the use of properties to add custom attributes to tasks, such as gaming systems (e.g., Xbox, PlayStation). They demonstrate how to filter tasks based on these properties and transform the query results into a table for better visualization. The flexibility of properties for sorting and filtering tasks is emphasized, along with the ability to refine lists by excluding certain properties.

20:07

📊 Page Properties for Tracking and Organization

The speaker discusses the use of page properties for tracking activities over time, such as work hours, and how they can be utilized within a journal for daily updates. They provide a step-by-step guide on creating a page property query and explain how these properties can be used to generate quick summaries of tracked data. The versatility of page properties for different types of pages is also highlighted, including their application in organizing books, projects, and other content.

🔧 Operators for Fine-Tuning Query Results

This paragraph focuses on the use of operators such as 'and', 'or', and 'not' to manipulate query results. The speaker explains how these operators can be used to combine or exclude criteria within a query. Practical examples are provided, such as creating a query for tasks that are high priority and not at home. The limitations of the Query Builder when using complex combinations of operators are acknowledged, and the speaker advises on best practices for constructing reliable queries.

Mindmap

Keywords

💡Query Builder

The Query Builder is a tool within the video's context that assists users in constructing queries without needing to memorize the syntax. It is integral to the video's theme of simplifying data retrieval within a system. The script mentions using the Query Builder to find tasks, like 'to do and later,' and to construct more complex queries by combining elements such as tags and priorities.

💡Brackets

Brackets are a fundamental part of the query syntax that the video discusses. They are used to denote the start and end of a function or query within the system. The video emphasizes their importance, noting that errors often occur due to misplaced or missing brackets, which can change the query's meaning.

💡Functions

In the context of the video, functions are used within queries to perform specific operations or retrieve certain data. The script gives the example of 'task' as a function to filter for tasks within the system, illustrating how functions are a core element of building queries.

💡Tags

Tags are used to categorize and filter data within the system. The video describes using tags like 'at home' to create queries that retrieve tasks associated with specific contexts, such as household chores that need to be done.

💡AND Operator

The AND operator is crucial for combining multiple conditions in a query. The video explains that it ensures all conditions must be met for an item to be included in the query results, such as a task being both 'to do' and 'at home'.

💡OR Operator

The OR operator allows for flexibility in queries by including items that meet at least one of several conditions. The video provides an example where a query could retrieve tasks tagged with either 'home' or 'work'.

💡NOT Operator

The NOT operator is used to exclude certain conditions from a query. In the video, it is demonstrated to remove tasks tagged 'at home' from a broader list of tasks, thus refining the results to exclude specific items.

💡Properties

Properties in the video refer to custom attributes that can be added to tasks or pages to provide additional data points. They are used to create more refined queries, such as filtering tasks by the system they are related to, like 'Xbox' or 'PlayStation'.

💡Page Properties

Page properties are similar to properties but are applied at the page level. The video uses the example of tracking work hours as a page property, which allows for the creation of a timesheet summary by querying the 'hours' property across multiple days.

💡Between

The 'between' function is used to filter data within a specific date range. The video demonstrates using 'between' to find tasks that occurred within a certain timeframe, such as the month of March.

💡Priority

Priority is a way to mark tasks with different levels of importance. In the video, tasks can be tagged with 'Priority A,' 'Priority B,' or 'Priority C,' allowing users to filter and organize tasks based on their urgency or importance.

Highlights

Introduction to building queries in Lockseek with the basic structure of a query using curly brackets and the query function.

Explanation of operators and functions within queries, demonstrating the use of brackets, functions, and values.

The importance of understanding how calculations work differently in Lockseek compared to traditional arithmetic.

Demonstration of filtering tasks using functions and values, such as 'task' and 'to do later'.

Utilization of the Query Builder for constructing queries without memorizing syntax.

The significance of correctly placing brackets to avoid errors in query construction.

Using tags for organizing to-dos by context, such as location, demonstrated with a 'home' tag example.

Combining multiple criteria in queries using the 'and' operator to filter tasks by context and status.

Adjusting queries dynamically to include or exclude tasks based on their status, such as 'done'.

Introduction of the 'priority' feature to mark tasks with different levels of importance.

Building queries to filter tasks by priority, showcasing how to adjust and combine multiple criteria.

Using 'between' to filter tasks within a specific date range, with examples using journal dates.

The capability to use related dates in queries to dynamically show tasks from a certain time period.

Exploring 'properties' to add custom attributes to tasks, such as gaming systems (Xbox, PlayStation).

Transforming query results into a table format to view properties like gaming systems alongside tasks.

Using page properties to track information over time, such as work hours, within a journal.

Creating a timesheet summary page using page properties to quickly fill in work hours.

The power of using operators like 'and', 'or', and 'not' to manipulate query results based on conditions.

Practical examples of using 'not' to exclude certain tags from query results, like 'no filter'.

Strategies for building complex queries with multiple layers of conditions without breaking the query structure.

Emphasizing the importance of understanding the underlying code for debugging and building complex queries.

Transcripts

play00:00

hey welcome to tools on Tech this week I

play00:02

want to break down simple queries give

play00:04

you all the building blocks you need in

play00:06

about 10 minutes so you can build any

play00:07

query you might need within lockseek and

play00:10

get the most out of all that data you

play00:12

were putting in there

play00:15

now let's start with the absolute Basics

play00:18

if you do slash query you get this the

play00:21

life query Builder and if you click on

play00:23

it you see that the core layout of a

play00:26

query is just curly brackets with query

play00:29

in the middle this you always need and

play00:32

you don't really need to memorize

play00:33

because loxiq will type it in for you if

play00:35

you press slash query now the other core

play00:38

element that you need to know is how

play00:41

operators and functions work inside

play00:43

queries let me quickly show you how that

play00:47

looks you always have these brackets and

play00:50

then there is a function basically and

play00:53

then values

play00:55

now looking at that that's a bit weird

play00:58

because if we do calculations for

play01:00

example you say one plus one equals two

play01:04

and that's not how closure works I

play01:06

explained that one in previous videos

play01:08

but I'm going to recap it because it's

play01:10

important Claudia would look at this

play01:11

like this

play01:12

and that would return to so that's a

play01:16

little mind shift and in practice how

play01:18

that looks is for example if you would

play01:20

be filtering on tasks you say task which

play01:24

is the function and then you say what

play01:26

you would like to have so like for

play01:27

example to do and later this is a core

play01:31

element on how you build things within

play01:34

simple query and we're going to dive

play01:35

into that more once we get to operators

play01:38

now one of the nice things that we have

play01:41

the query Builder is while I'm going to

play01:42

talk about the code bit a lot in this

play01:45

video you can find a lot of things by

play01:48

using the query Builder so for example

play01:50

the one that I was showing you just now

play01:52

is if I go to query

play01:55

and then I would say click on the plus

play01:57

find that task function that I just had

play02:00

and do the same thing I say to do and

play02:03

later

play02:04

and click on the plus

play02:07

then that would build the query for me

play02:10

and now if I click on live query you

play02:12

basically see a combination of the

play02:14

things I just explained you see that we

play02:17

have the query curly brackets that

play02:19

surround it and we see one of these

play02:20

functions tasked to do later in it so

play02:23

this query just gets me all the tasks

play02:25

that are in my system that are to do and

play02:27

later now it's important to remember

play02:30

that these brackets on the outside are

play02:32

important a lot of times things go wrong

play02:34

because the brackets are in the wrong

play02:37

place for example you have brackets with

play02:39

spaces in them or you have brackets

play02:42

where you need them and you don't have

play02:43

brackets where you don't need them so

play02:46

for example if I would build a query I

play02:50

would go like this

play02:51

and I would forget the brackets so I do

play02:54

something like this the task to do doing

play02:56

I would get an error because now it's

play02:59

not a function now it's looking actually

play03:02

for specific things

play03:04

now you can do something like aim for a

play03:08

page so for example if I have like an

play03:10

idea page

play03:12

then that would work because I'm not

play03:15

using a function I'm searching for

play03:17

something like a reference inside my

play03:19

table and this is also where things get

play03:21

like a little bit confusing and I'll

play03:23

dive into that when I talk references

play03:25

and the and operator

play03:28

so one of the bread and butter things

play03:31

that you want to do with a query is

play03:34

filter for specific tags and this is one

play03:37

of the ways for example that I used to

play03:39

order my to-do's I would tag something

play03:42

with a location so let me give you there

play03:45

a nice example say I have the trash that

play03:49

needs to be put out so I'm making a

play03:50

to-do and I'm saying like put out the

play03:52

trash

play03:54

and that's something that I need to do

play03:56

at home so what do I do I add a tag and

play03:58

I use from GTD the at symbol which means

play04:01

that it's in a specific context and I

play04:03

would say home

play04:06

now this thing has a tag to it that says

play04:09

at home meaning that if I'm at home I

play04:12

can put out the trash

play04:14

and then I can build a simple query that

play04:16

would say hey I would like to get all

play04:19

the results that I have

play04:21

and I want to say all the things at home

play04:26

I say page references and I say at home

play04:30

and then it finds that to do so now I

play04:33

have this at home query but it also

play04:36

would show texts that have attacked with

play04:38

that aren't tasks and that's the main

play04:40

operator that I use with queries and

play04:42

that is Task and I say like anything

play04:45

that I need to do

play04:46

and if I can click on the plus here then

play04:48

it makes a more complex curvy and we're

play04:50

gonna break this down to you understand

play04:53

what's written here because the query

play04:54

Builder will help you but understanding

play04:57

what goes on on the water is why you are

play04:59

here

play05:00

so let's click on the live query and

play05:02

look at that query build up

play05:05

um so you look at the query and we're

play05:07

gonna break it up so you have the outer

play05:09

part which is the query itself and then

play05:11

you see without a bracket around it the

play05:14

reference towards home and that is

play05:16

because it points towards a reference

play05:18

and it's not a function and then after

play05:20

it comes a function and that does start

play05:22

with the brackets and it's a function

play05:23

task which says like find me all the

play05:25

tasks that are marked whatever I put

play05:27

behind it so in this case just to do

play05:29

what you could like do also to do doing

play05:31

now later to make like a full list and

play05:34

make sure everything gets captured and

play05:36

then around that is another function

play05:39

that's and and says all the things that

play05:42

are in here have to be marked or else

play05:45

we're not getting this setup so if we go

play05:48

back and we look at the two lines that

play05:50

we have then you see that I have this

play05:53

one to do put out trash home and that

play05:55

one matches because it is marked at home

play05:58

and it's marked to do and then next one

play06:01

that one gets filtered out because it's

play06:03

marked with just the tag home but it's

play06:05

not marked as it has to do if you would

play06:08

go here and I would press Ctrl enter and

play06:09

make it a to do

play06:11

then you see that the query gets updated

play06:13

and it returns but if it's not to do but

play06:16

it's for example done

play06:19

then it gets removed because we said we

play06:21

only one tasks that are on to do

play06:24

and then of course we can go here

play06:27

and this is like one of the points where

play06:29

the query Builder lacks right I can't

play06:30

change it I have to either rebuild it so

play06:32

in those cases I'm just going to go in

play06:34

here and say like hey I would also say

play06:36

like to see all the things that are done

play06:39

to that now I've got both of them in my

play06:41

view by doing a quick adjustment

play06:43

[Music]

play06:46

okay now let's dive into priority now I

play06:49

put this list here of three things and

play06:51

I'm going like okay these things are

play06:53

important but some things are more

play06:55

important than others so for example

play06:56

feeding the cat well I won't be

play06:59

forgetting that one because again

play07:00

remember let's give that one a priority

play07:01

by going give it Priority a you get

play07:03

priority a b and c

play07:05

and that puts like a nice marker in

play07:07

front of it and say like hey this is

play07:08

priority a then I can go to my query

play07:10

that was already filtered for everything

play07:13

at home and I said like hey I would like

play07:15

to see just the things that are my

play07:17

highest priority set so again I go to

play07:19

plus I click priority I say a and I

play07:22

click on plus again and it gets added

play07:24

and now you see that I just get those

play07:27

priority a markers

play07:30

and if you look at the query Builder

play07:31

there's not an extra ant that gets added

play07:34

and there's like cumulative so you can

play07:35

have multiple things in it so this one

play07:37

says and and it says home tagged and

play07:41

talk to do tagged and priority a text

play07:43

those three things must match to get

play07:46

like the result that we're having here

play07:48

and that means that we only get one back

play07:50

so for example if I say that putting out

play07:52

the trash

play07:53

is priority a then it will start popping

play07:56

up the moment I save it as you see here

play07:59

and if I say like oh no this is like

play08:01

less priority I make it Priority B then

play08:04

it will disappear again from List It

play08:07

Takes a second and now it doesn't show

play08:09

that one but I can go to things like my

play08:11

query and say like hey I would like to

play08:13

see priority A and B and if I do

play08:16

something like that then they both show

play08:17

up again now in practice of course you

play08:21

might want to have a certain order in

play08:22

this and one of the things that I do

play08:24

with things like priority is that I take

play08:26

a query like this and I say like hey I

play08:28

would like to have everything in

play08:30

priority a and I then just copy the

play08:32

whole query put it under there

play08:35

and give that one b

play08:38

and now I have two queries and the top

play08:41

query will tell me all my a priority

play08:43

thing so it will be on top and the

play08:45

second query will tell me my B

play08:47

priorities which will be in the bottom

play08:49

you could use Advanced queries and then

play08:52

basically make a sorted list and make

play08:54

sure that everything's like nice and

play08:55

dandy and placed and in the right order

play08:58

but this is just so much easier to set

play09:00

up just make a couple of queries and put

play09:02

them in the order that you want to see

play09:03

those queries this is how I built my my

play09:06

task list page where I just have a bunch

play09:08

of queries in the order that I want to

play09:10

scroll through them so first things that

play09:12

come in there anything that I marked is

play09:13

doing then I have like a b c's and then

play09:17

all my other tasks are under it and then

play09:19

I can just scroll through all the tasks

play09:21

and pick a mix whenever I would like to

play09:23

pick up this is much easier to build

play09:24

than going straight into advanced

play09:26

queries

play09:28

now for the next one we're going to look

play09:30

at between and between is a property

play09:33

that gives you everything between a

play09:36

certain date and that one's very much

play09:38

based on Journal dates so if we adjust

play09:42

our example here we should get nothing

play09:46

because the to-do's that I made aren't

play09:48

on my journal page they are on a sub

play09:51

page so they don't have a date let's see

play09:54

if that's the case I'm gonna go here I'm

play09:57

gonna remove this last query

play10:00

I'm gonna go to this top one

play10:02

I'm also going to remove this priority

play10:04

A1 let me use the query Builder I still

play10:06

have to get used that I have this and

play10:09

then I go to between

play10:12

and I say you know you can pick a date

play10:15

so I can say like hey I want something

play10:17

that's between the first and the end of

play10:21

March

play10:22

now I have this setup and I get no

play10:25

results of course I don't get any

play10:27

results because I don't have any task in

play10:29

March that is marked at home so let's go

play10:32

to my journal page and make one so this

play10:36

is the last day of March I say to do

play10:39

March example and I would mark it as the

play10:42

at home as we just did so now I made a

play10:44

task in March and I made it on a

play10:48

specific date and you'll see it pop

play10:49

right back because the between is here

play10:52

and it shows you where the task supposed

play10:54

to be happening now I hear you asking

play10:57

like this is nice but I'm not gonna

play10:58

enter dates every time I want to build a

play11:00

query for example to see what I needed

play11:02

to do last week and that's totally fair

play11:05

and that's why you can use like related

play11:07

dates unfortunately you can't use them

play11:10

in the query Builder I tried and I'm

play11:12

going to show you like if I go here and

play11:14

I delete this and I add like a new

play11:16

between

play11:17

and I try using something like minus 7D

play11:20

which means the last seven days then I

play11:24

just can't submit it like I don't get an

play11:27

entry so this is something that we have

play11:29

to do in code still until this gets

play11:31

added

play11:32

but it's not that hard so I added

play11:34

between I say minus seven days but I can

play11:37

also say minus one weak producing debt W

play11:40

but we're going to use minus seven days

play11:42

and today and that means that I want any

play11:45

task that was between seven days ago and

play11:48

now and if I click on that you'll see

play11:50

this one happening but that's not a good

play11:52

example because I just made one so let's

play11:54

go to a specific date and let's go like

play11:56

a week ago so the 21st

play11:59

and I'm going to go here and I'm going

play12:00

to make another to do I'm gonna go back

play12:03

and you still don't see it showing up

play12:05

now if I go back to this one to this

play12:07

between and I said like hey let's turn

play12:10

that one into minus two weeks

play12:14

then you see the result happening so

play12:16

with the between you can really figure

play12:18

out where tasks are and of course this

play12:20

also works in the plus so you can say

play12:22

something like between today and plus

play12:25

seven days if you have any tasks

play12:27

scheduled for the future to see what's

play12:29

adding your way

play12:33

now let's dive in some of the really

play12:35

neat features of logseek and that is

play12:37

properties

play12:39

I made these two entries here for play

play12:41

games and I'm gonna give them a property

play12:43

so I click on the to do I press shift

play12:45

enter so I stay within the block and I'm

play12:47

gonna say system

play12:49

I'm going to say I'm going to play games

play12:50

on the Xbox

play12:52

and then once I've done that one I'm

play12:55

gonna make a new one here as well also

play12:57

going to shift enter and because system

play12:59

is now known I can just do two columns

play13:01

and then type system

play13:03

and it will show you all the values it

play13:06

knows in this case Xbox but I'm going to

play13:08

add PlayStation

play13:09

I might add switch as well but no need

play13:14

so now I have these two tasks what can I

play13:16

do with these properties that I just

play13:18

added now let's go back to our live

play13:20

query that's under here I'm going to

play13:22

remove the between because I want the

play13:24

things that are on this page and you can

play13:26

like see the entries that are made here

play13:28

and you also see the entries that are in

play13:30

the journal and then I'm going to say

play13:32

like hey I want only the tasks that have

play13:34

the property system so I'm going to go

play13:36

here

play13:37

I'm going to say property

play13:39

I'm going to type in system

play13:41

and then I can also pick if I want to

play13:44

have just the PlayStation ones or just

play13:46

the Xbox Ones or just oh I'm gonna pick

play13:48

all in this case

play13:50

if you look at the query you see that

play13:51

property system

play13:54

and then I just get to Do's that are

play13:56

marked system and now we get to like one

play13:58

of the really cool features because I

play14:00

can go up the top here and turn it into

play14:01

a table

play14:03

and then I not just have like an

play14:04

overview of all these blocks but I also

play14:07

have like a list of that property behind

play14:09

it so in this case showing me on what

play14:11

system and in what block and it's going

play14:15

to get even more funky once we get into

play14:17

page properties which I'll show right

play14:19

after this you know this is on this page

play14:21

you might not care about the page so you

play14:23

can click on this one and say like nah

play14:25

just

play14:26

leave the page out of it and so you can

play14:28

like update your list and you can also

play14:30

sort

play14:31

and as you just see also filters are

play14:33

selling hey I just want the Xbox stuff

play14:34

let's move remove this one go here to

play14:37

property

play14:38

say that I want some system and I just

play14:41

want the Xbox lines and I'll just get

play14:42

the Xbox so using properties really

play14:45

makes it possible for you to slice and

play14:47

dice all the blocks that you are making

play14:49

and I'm going to give you like a quick

play14:51

example of how I use that for pages

play14:55

now that we had block properties let's

play14:58

look at page properties and one of the

play15:00

strongest ways for me to use page

play15:02

properties is by using them inside my

play15:05

journal because there's things that I

play15:07

can track over time let me give you a

play15:10

quick example here I need to keep track

play15:12

of the hours that I work and it's not

play15:15

that I have to keep track of like every

play15:16

minute for that I would need a much more

play15:18

fine-grained method or use it per block

play15:21

but I need to keep track of like did I

play15:23

work eight hours or six hours on a day

play15:25

you know did I go home early for example

play15:27

and the way I do that is I have a

play15:30

template that I start every day and that

play15:32

adds hours as a first block property so

play15:35

let's say I worked eight hours today and

play15:37

then I get this like in my journal on

play15:39

the top it says like hours is eight now

play15:41

I prep this so if I'll go back you see

play15:43

that I got a couple of hours filled in

play15:45

and then what I can do is I can click

play15:48

and it already shows me this data

play15:49

because I've already done this before

play15:50

but if I go to that I get to the hours

play15:53

page which is the page for the property

play15:55

and I created a small query that

play15:57

basically says nothing else except page

play15:59

property hours so let's let's build this

play16:02

from scratch I say query and I go page

play16:07

property so you got property here but I

play16:09

said like no I want Pages go pages I say

play16:12

property again I say hours

play16:14

foreign

play16:16

select all and then what happens is I

play16:19

get this list of all the dates in my

play16:23

calendar and the hours worked created at

play16:26

because it's a page so it knows when

play16:28

it's created and when it's updated and I

play16:30

also experiment a bit with mood as you

play16:32

can see here then let's sort it at the

play16:36

page level and that means that now I get

play16:39

back and go like hey if I fill my

play16:41

timesheet I can open this and I just see

play16:43

like the hours that I filled in every

play16:44

day and I can type it in to my

play16:46

timesheets in like 10 seconds flat

play16:48

because I got all the information that I

play16:50

need over the last few days using page

play16:53

properties is super useful not just in

play16:56

things like the journal but also in

play16:59

things like types so for example I make

play17:01

lists for books so who's the author when

play17:04

was it written what rating did I give it

play17:07

I use it for projects is it still active

play17:10

Who's involved what priority does it

play17:12

have any type of thing that I want to

play17:14

put on a page I can add these page

play17:17

properties to and then use the simple

play17:19

query Builder to filter for those

play17:21

properties and get the results back in

play17:23

the order that I need them this is a

play17:25

really powerful function and I highly

play17:27

recommend just playing around with it a

play17:29

bit and figuring out what kind of

play17:31

workflows you would like to use this for

play17:33

remember if you're making a workflow

play17:36

start with the end in mind so for

play17:38

example this one was hey I have to fill

play17:40

in this time sheet every week I need to

play17:42

keep track of the hours every day now

play17:44

before I dive into operators if you like

play17:46

my content and want to help me out check

play17:48

out my patreon link down below I'm not

play17:51

sure yet what I'm going to do with it

play17:52

but at least it will have early postings

play17:55

of my videos while I can still do

play17:57

something with the feedback that I get

play17:59

answer questions from people and take

play18:01

recommendations on videos or topics that

play18:03

I should handle next

play18:07

dive into operators and operators are

play18:11

free shapes we have and or and not and

play18:14

what they do is that they manipulate if

play18:17

you want something yes or no in your

play18:19

setup

play18:20

and we've already seen so it

play18:22

automatically happens if using the query

play18:24

Builder if you start combining

play18:26

properties that you want to see then and

play18:28

will put those together and you will

play18:29

only get results if all the things are

play18:32

matched so and it's a to-do and it's at

play18:35

work and it's a priority a those things

play18:38

combined result into a thing then or is

play18:43

just a tad different because that one

play18:44

says like any of these things can match

play18:46

and then we can start adding it already

play18:48

now put a quick example up here and what

play18:52

you can see is that I updated the list I

play18:55

added a at work tag and I made this

play18:58

small query so I said and so all the

play19:00

things that are in here are and and then

play19:01

the first element in that is an or and

play19:03

what it does and let me see if I can

play19:05

select just just this part

play19:08

is it says or home or work and then a

play19:11

task so that means that it has to be a

play19:13

task and it has to have either home or

play19:16

work or both both so you see the result

play19:19

coming back which is basically the whole

play19:21

list if I remove home somewhere let's

play19:24

say then I change this one to phone then

play19:28

that one gets removed because I didn't

play19:30

say that I wanted to have a phone as

play19:32

well so or is very nice if you're making

play19:34

combined lists of different types you

play19:37

want to put them together

play19:39

and then finally we have not and not is

play19:44

just the negation so if we're going back

play19:47

to the example that I was just showing

play19:49

where you see hey look I've got this one

play19:52

and I'm saying like I would like to get

play19:54

all the tasks in my system

play19:57

so we're going cleaning this one up I

play19:59

say just tasks

play20:01

and I would say like but

play20:04

I don't want to see any of the at home

play20:06

stuff so I'm gonna go nut and then say

play20:09

not at home

play20:11

and then if I get a result I get a whole

play20:13

bunch of tasks because it goes through

play20:15

my whole system and gets all the tasks

play20:17

that I have

play20:19

with the exception of things like put

play20:21

out the trash so let's make this a bit

play20:24

simpler by saying by ant that we have

play20:26

here and going like let me get me some

play20:29

priority so priority and I just want to

play20:32

get a

play20:34

and then you get like a couple of things

play20:36

but you'll see that none of these ones

play20:39

are in there because none of these ones

play20:41

are at home so if I take the call center

play20:44

one here with phone and I would like add

play20:47

priority a to it

play20:49

this one would match because it's a

play20:51

to-do it has a priority of a and it is

play20:54

not at home and looking back at that

play20:56

this gets updated and core contact is

play20:58

there so the not parameter is mostly if

play21:02

you want to remove something from the

play21:04

list one of the ways that I use it very

play21:06

often is I have a tag called an F which

play21:10

I mean no filter and I add that if I

play21:13

want to remove something from all my

play21:15

filters so very often I have a not an F

play21:18

at the end of my streak of queries and

play21:21

that means that I can clean up long

play21:23

lists that I have with elements that I

play21:25

don't want to change so that they

play21:27

automatically fall out of the filter but

play21:29

I still don't want them in my end

play21:31

results because I'm either done with

play21:32

them or because they're just a thought

play21:34

or comment that were added and they were

play21:36

cluttering up my view

play21:39

now simple crews are nice but they're

play21:41

not perfect if I try messing around with

play21:44

them very often things will break so if

play21:47

I'm looking at this example where I said

play21:49

like hey I made an oars like either or

play21:51

home or phone and then I said like but

play21:53

not like I tried to reverse that that

play21:55

doesn't work I just get both of them

play21:57

back so in most cases if it's not

play22:01

working try to break it down into

play22:02

smaller pieces I usually take a

play22:05

processing order where I say like I have

play22:07

and and then I have like all the lines

play22:08

in there and I make multiple nuts or

play22:11

ores in there if I have to build my

play22:14

aquarium if you're going like three

play22:16

layers deep then maybe it's better to

play22:19

start diving into something like

play22:20

Advanced queries try to limit it to

play22:23

around two layers deep so just and and

play22:26

then under and things like nut or or

play22:29

but not what I'm doing here and and then

play22:32

not and then or where you go like three

play22:34

layers into the whole system okay so I'm

play22:37

mostly focused on how to do it in text

play22:40

and that is deliberate because while the

play22:41

query Builder is nice it isn't perfect

play22:44

and if it starts giving weird results

play22:46

you'll have to dive in the code to fix

play22:48

it so knowing how these elements fit

play22:49

together really help you to either debug

play22:52

or build a little bit more complex

play22:54

queries without things breaking down

play22:57

remember you're awesome keep it up and

play23:00

see you in the next one

play23:03

foreign

play23:08

foreign

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
LogseqQuery BuildingProductivityTask ManagementData OrganizationWorkflowTime TrackingJournalingTaggingProperty Filters
هل تحتاج إلى تلخيص باللغة الإنجليزية؟