Logseq: Queries

639 Members
This is the channel for queries in Logseq. | This channel is *not* bridged to the Logseq community on Discord. | Space #logseq:matrix.org6 Servers

Load older messages

31 May 2023
@_discord_304191114641145857:t2bot.ioglenn6h changed their display name from Glenn Chew to glenn6h#3595.15:09:19
@_discord_304191114641145857:t2bot.ioglenn6h changed their display name from glenn6h#3595 to glenn6h.15:09:21
1 Jun 2023
@_discord_480268188341239809:t2bot.iopetrichor#6765 is there a way of editing queries with the codemirror widget perhaps? if not, maybe i should make a feature request... 10:01:01
@petrichor:envs.netJez (he/him) 🖥️ joined the room.11:16:23
@_discord_532210849696448522:t2bot.iophosphorix joined the room.11:41:46
@_discord_187569042062704643:t2bot.ioTiago#7451 https://discuss.logseq.com/t/queries-for-task-management/14937/76?u=tiago_pontes 15:17:29
@_discord_797853110834954281:t2bot.ioaforank#3604 joined the room.15:24:01
@_discord_797853110834954281:t2bot.ioaforank#3604 Is it possible to use Advanced queries for grouping flashcards? 15:24:01
@_discord_236571035388870666:t2bot.ioGiacoJames joined the room.17:10:11
@_discord_799721331373113428:t2bot.ioA7med Ragab joined the room.23:16:17
2 Jun 2023
@_discord_165879993283510273:t2bot.iobridgestew joined the room.02:48:26
@_discord_165879993283510273:t2bot.iobridgestew Did this get resolved for you? I'm experiencing the same issue today and have disabled every plugin and theme to try to figure out what is causing it to no avail. 02:48:27
@_discord_347658122741022730:t2bot.ioDarwis#6578 example count todo by page:
@_discord_1018127395473063956:t2bot.iomikem joined the room.09:57:43
@_discord_1018127395473063956:t2bot.iomikem I'd like to have a TODO page which pulls all TODOs into a single list. Is it possible to manually re-order that list arbitrarily? 09:57:44
@_discord_331056596794998785:t2bot.iojybu joined the room.13:25:45
@_discord_331056596794998785:t2bot.iojybu Is there a way to embed a single value result from a query into some text?
Typically I have the following query:
{:query [
 :find (count ?b)
 [task ?b #{"TODO" "WAIT"}]

and I want to have in my page (which is a dashboard of sorts) something like "There are currently $value open actions."
@_discord_347658122741022730:t2bot.ioDarwis#6578 Use hiccup :view 13:35:41
@_discord_331056596794998785:t2bot.iojybu set a profile picture.14:13:35
@_discord_331056596794998785:t2bot.iojybu changed their display name from jybu#2425 to jybu.14:13:36
@_discord_331056596794998785:t2bot.iojybu Thanks. I ended up with:
{:query [
 :find (count ?b)
 [task ?b #{"WAITING" "WAIT"}]
:view (fn [r] (str "There are currently " (nth r 0) " open loop items."))
:collapsed? false

Which is not so bad. I'll look into having multiple queries and formatting another day.
@_discord_236637500636921858:t2bot.iot0fr joined the room.17:37:18
@_discord_712950313547464756:t2bot.ioK-Dizz joined the room.20:17:38
3 Jun 2023
@_discord_1114350506547105902:t2bot.ioad58 joined the room.00:42:11
@_discord_1091344546849361950:t2bot.iodudebro I'm attempting to make an advanced query that returns pages marked as completed within a range of fixed dates, specifically this past May 2023. The idea is to query for pages that have a done-date property that is set from anywhere between [[May 1st, 2023]] to [[May 31st, 2023]].

Most examples I've found online deal with the special date variables like :today etc. I've found one page ( https://discuss.logseq.com/t/query-with-exact-date/1813 ) mentioning that using integers for the date (i.e. 20231024) should work. I've tried it with my code, but no luck, unfortunately.

I'm not certain if the code has the problem, or the the date input is the problem, but regardless, here's the code. The code below was adapted from a use case that uses :today as input. The code does run, in that it does not return an error. However, there are zero results returned. Thanks for any help.

    :title [:h2 "pages finished in May 2023"]
    :inputs ["May 1st, 2023" "May 31st, 2023"] ;
    :query [
        :find (pull ?b [*])
        :in $ ?start ?end;
            (property ?b :type "my-page")
            (property ?b :is-done true)
            [?b :block/properties ?properties]
            [(get ?properties :done-date) ?done-date]
            [?b :block/ref-pages ?p]      ; find the page references
            [?p :block/journal? true]      ; which are journal pages
            [?p :block/journal-day ?d]   ; extract their date
            [(>= ?d ?start)]                ; 
            [(<= ?d ?end)]
@_discord_1109698821883179009:t2bot.iowhitemapleee joined the room.03:24:48
 :query [:find (pull ?b [*])
         :in $ ?start ?end
              [?b :block/properties ?properties]
              [(get ?properties :type) ?type]
              [(= ?type "my-page")]
              [(get ?properties :is-done) ?done]
              [(= ?done true)]
              [(get ?properties :done-date) ?d]
              [?j :block/journal? true]
              [?j :block/original-name ?jn]
              [(contains? ?d ?jn)]
              [?j :block/journal-day ?d-num]
              [(< ?d-num ?end)]
              [(> ?d-num ?start)]
 :inputs [20230501 20230531]
@_discord_996315878310301817:t2bot.ioOli changed their display name from Oli to osoap#3341.22:11:11
@_discord_996315878310301817:t2bot.ioOli changed their display name from osoap#3341 to Oli.22:11:13
4 Jun 2023
@_discord_810253055756861500:t2bot.ioSamuelitooooo joined the room.03:48:44

There are no newer messages yet.

Back to Room ListRoom Version: 10