From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eJGALwcfuWbyYQAAe85BDQ:P1 (envelope-from ) for ; Sun, 11 Aug 2024 20:28:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id eJGALwcfuWbyYQAAe85BDQ (envelope-from ) for ; Sun, 11 Aug 2024 22:28:55 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=q1AK04wU; dmarc=pass (policy=none) header.from=free.fr; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723408135; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=lbURblfydA1ejKhcKW0dK+lygPzuSAlPdXGRCLVxla8=; b=lBD9vCMwBTdkc0aOnVHUxATAMFyF+LVhIJlyOXwj6+wFxne+B+LvJStcWfSFv/sGAipo8b bmI8z3U6dNzn7H32u3swzcpQ4RXqGnWy/QEEMmjQcghJjwbJFOEwepLfhqhsbNo2saP0rT MlJz/XXntafUxNZQc67Bw2veh5Kwu7btHUMaNC2RRGbeTFEbmAF1uHjC8ZRuWDeSYItagY AdL5jTHJDePQPVm4eP3lAU8qepq4Jv8PvOMw82rm4zNoccD1QgAwQhZU+jtnhpe7vzngL3 WgeJZw6urpjE3pM7Iza68yjRow76caEIV59vq5NtW5u7Zrf6I0GUA8HsFx9JoQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723408135; a=rsa-sha256; cv=none; b=olSRka7PZGwH04mg4ZgZgXOknLNyh34slD39OonrZORN8VKoRNvNK/EO3BbYzWXvr2VjVp P26B5kMBqVRJPa9XOsLzPpnUhqjugR75VlppmgJLthQKXsZcfFKNlPvgygkDVJmVisUdvX OwovApRGtB8QKA+IGeuJHDWH1Lm41lnw5Q9+93WbSaqTRma30WTarVk4fjcjCMctio9Vx6 B2rNsTE3S62cez7U4sqOAiiiQIkXkX/4OcnVo6kp6a/cLGIlayG3uvSXRF7GnAJzsMr0Iw Hm096ZNv3LTS9UpIuetEMR4pgs/jo1H4BGPZvQZu3tOv3zcmRsM0FLI0LJ7b7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=free.fr header.s=smtp-20201208 header.b=q1AK04wU; dmarc=pass (policy=none) header.from=free.fr; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FBC11B901 for ; Sun, 11 Aug 2024 22:28:55 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdFAY-0005JQ-5W; Sun, 11 Aug 2024 16:28:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdFAV-0005JG-Pd for emacs-orgmode@gnu.org; Sun, 11 Aug 2024 16:28:00 -0400 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdFAT-0003oH-LP for emacs-orgmode@gnu.org; Sun, 11 Aug 2024 16:27:59 -0400 Received: from [IPV6:2a01:e35:39f3:4610:dea5:cea3:2551:771a] (unknown [IPv6:2a01:e35:39f3:4610:dea5:cea3:2551:771a]) (Authenticated sender: tbanelwebmin@free.fr) by smtp5-g21.free.fr (Postfix) with ESMTPSA id 7F7406012F for ; Sun, 11 Aug 2024 22:27:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1723408073; bh=4rIhDnpGWL0Z5f8dMsRXCMnOtD9lIY2QBdXVyHNMclE=; h=Date:Subject:To:References:From:In-Reply-To:From; b=q1AK04wULNQBII2nA1rMZKICC/Qc1AOEJP4zLqCMnj0Y4xIlwPJu1a83lAO5hlQ2A 3zL0NUrc2FEF7mJcpgYAn45RYs0u+Muz/fPH4MqEKPIcyiwpXiSKhXZOhWxxYyzE4g LwSsl5rQvpxUKIqozNnp/0W+QIdSsGqaldSsaxYMrdwNKEH6Hnuc/Gxz5AhgHNS1Ka x+7zdWXmQMsP5Dwj6yBja5OY9d9MVXALDkA5vzP+CS+hGflVWrW4VvVvIaK2e9X24h 25/Qr4IkTfOyTz5r36976nq98/0pOtNhqXw92id2YCxlGIurBrXwPLhjcUhKDez3rv LOGieMR2+881w== Message-ID: <6f4ba917-7c81-641e-336e-0b0ba8381fc3@free.fr> Date: Sun, 11 Aug 2024 22:27:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: help: howto aggregate several properties in one column Content-Language: fr To: emacs-orgmode@gnu.org References: From: tbanelwebmin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:e0c:1:1599::14; envelope-from=tbanelwebmin@free.fr; helo=smtp5-g21.free.fr X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.102, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 7FBC11B901 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.84 X-Spam-Score: -9.84 X-TUID: 94TLhHesDoQu Two quick-and-dirty workarounds: 1. Eval that prior to using propview: (setq  TEST_A "<>"  TEST_B "<>"  TEST_C "<>"  TEST_D "<>") 2. Define this helper macro: (defmacro valof (symbol)   `(if (boundp ',symbol)       ,symbol     "()")) Then specify columns like that: (concat (valof TEST_A) (valof TEST_B)) Have fun Thierry On 24-08-11 10:49, Pedro wrote: > Hi, > > I am a heavy user of propview [1] and I am very happy with it, but > looks like now I reached a limitation, or maybe someone founds a > magical workaround. I am open to use another solution outside of > propview. > > Find attached in file aggregate-props.org that serves as a playground > environment and as an example of what I am struggling with, it is > posed as a generic example: I want to "merge" two properties into one, > no matter if the property exists or no. I am trying to use concat, > concat works only when the properties on an item exist, if one of them > does not exist, fails, which is unfortunate to what I am trying to > achieve, because on one side, I would like to report (with a propview > table) the frequency of appearance of each test_a, test_b, test_c, > etc. on all nodes with tag :test:, and with another propview table, a > summary of all test properties. > > There is a workaround based on a precalculation strategy that I kind > of hate: do an org-map-entries of all targeted items with tag "test", > and update SUMMARY property through an adhoc elisp function all the > properties related to test (I am happy with just enumerating all of > the involved subproperties, but I recognize, having a regex on > property such as test_* or that "starts with" test, would be amazing), > then, it is just as easy as adding the new column SUMMARY, but I would > like to avoid this solution > > Extra note: related to propview, it is not a problem to concat 100 > elements, because you can do it in an extra shortnamed function, so > the column name can be short > > So this is what happens, concat of TEST_A and TEST_B is 0 > > #+BEGIN: propview :scope tree :match "+test" :noquote all :cols (ITEM > CREATED TEST_A TEST_B (concat TEST_A TEST_B) (concat TEST_C TEST_D)) > | ITEM    | CREATED                | TEST_A | TEST_B | (concat TEST_A > TEST_B) | (concat TEST_C TEST_D) | > |---------+------------------------+--------+--------+------------------------+------------------------| > > | mytest  | [2024-08-09 Fri 23:53] |      a |      0 > |                      0 | cd                     | > | mytest2 | [2024-08-09 Fri 23:53] |      0 |      b > |                      0 | cd                     | > | mytest3 | [2024-08-09 Fri 23:53] |      0 |      0 > |                      0 | 0                      | > |---------+------------------------+--------+--------+------------------------+------------------------| > > |         |                        |        | |                        > |                        | > #+END: > > What I would expect to happen is that in the concat result of TEST_A > and TEST_B would appear a or b, maybe that could be done with another > function? > > #+BEGIN: propview :scope tree :match "+test" :noquote all :cols (ITEM > CREATED TEST_A TEST_B (concat TEST_A TEST_B) (concat TEST_C TEST_D)) > | ITEM    | CREATED                | TEST_A | TEST_B | (concat TEST_A > TEST_B) | (concat TEST_C TEST_D) | > |---------+------------------------+--------+--------+------------------------+------------------------| > > | mytest  | [2024-08-09 Fri 23:53] |      a |      0 > |                      a | cd                     | > | mytest2 | [2024-08-09 Fri 23:53] |      0 |      b > |                      b | cd                     | > | mytest3 | [2024-08-09 Fri 23:53] |      0 |      0 > |                      0 | 0                      | > |---------+------------------------+--------+--------+------------------------+------------------------| > > |         |                        |        | |                        > |                        | > #+END: > > Cheers, > pedeb > > [1] https://orgmode.org/worg/org-contrib/org-collector.html >