Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design and document predicates that return values #122

Open
dsdshcym opened this issue May 14, 2020 · 2 comments
Open

Design and document predicates that return values #122

dsdshcym opened this issue May 14, 2020 · 2 comments
Assignees
Milestone

Comments

@dsdshcym
Copy link
Contributor

I wanted to know how many tasks in my org files are closed on the same day as they were scheduled.

I then tried (closed :on scheduled) but it didn't work as I expected (the where clause didn't filter out anything).

So I'm wondering if it's possible to use data from heading in the query expression?
If so, org-ql can really become more powerful and help me analyze my notes/tasks:

  • how many tasks are finished on time
  • how many days are tasks get delayed
  • etc.

Finally, thanks for this great package!!!

@alphapapa
Copy link
Owner

Some predicates do return the values they test. That's not formally documented or designed yet, but it would be good to do so in the future.

I don't remember if (closed) and (scheduled) do. If they do, you could do something like (org-ql-select FILES '(equal (closed) (scheduled))), however that would likely include the hour-minute timestamp, which wouldn't work for testing the day. So you'd probably need to convert the Org timestamp strings to timestamps and compare the difference (you could use the ts library, which org-ql uses internally).

Thanks for the kind words. I'm glad it's useful to you.

@dsdshcym
Copy link
Contributor Author

I tried '(equal (ts-parse-org (closed)) (ts-parse-org (scheduled))), but ran into an error (wrong-type-argument stringp 1642)

I think it's because (closed) doesn't return the org timestamp, right?

Well, we don't need to figure out how to do it currently.
I just hope this feature can be added to the project roadmap, so we can use an formally supported version of it.

@alphapapa alphapapa changed the title [Feature Request] Is it possible to query where: scheduled = closed? Design and document predicates that return values May 15, 2020
@alphapapa alphapapa self-assigned this May 15, 2020
@alphapapa alphapapa added this to the Future milestone May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants