PIVOT BY clause not supported yet (2.3.1)?

130 views
Skip to first unread message

cha...@gmail.com

unread,
Dec 1, 2020, 8:17:30 AM12/1/20
to Beancount

I am using Beancount 2.3.1, and am getting the message that the PIVOT BY clause is not supported yet. Is this something only available in v3+? It does still appear to by in the documentation: https://beancount.github.io/docs/beancount_query_language.html#pivot-by

The query I am trying to run, it appears PIVOT BY only accepts column name as syntax and not position:



SELECT
  account,
  ymonth(date) AS yearmonth,
  SUM(COST(position)) AS balance
WHERE
   account ~ 'Expenses' AND
   NOT account ~ 'Business' AND
   currency = 'USD' AND
   date_diff(today(), date) < 120
GROUP BY 1,2
PIVOT BY account, yearmonth;

Martin Blais

unread,
Dec 2, 2020, 4:17:03 PM12/2/20
to Beancount
Apologies for this, the PIVOT BY clause implementation was never completed.
I've adjusted the documentation.


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/b35d0cc0-9fff-45e5-a9bc-3e1e9cf74838n%40googlegroups.com.

cha...@gmail.com

unread,
Dec 3, 2020, 9:35:19 PM12/3/20
to Beancount
Good to know, thank you for the clarification.

Altynbek Isabekov

unread,
Jan 3, 2021, 2:51:08 AM1/3/21
to Beancount
I had to come up with a workaround for interval summaries:

Having "PIVOT BY period" feature in BQL would faciliate multiperiod report generation.

Martin Blais

unread,
Jan 3, 2021, 5:15:00 PM1/3/21
to Beancount
I know. Send me a patch?


Chary Chary

unread,
Jan 4, 2021, 9:39:08 AM1/4/21
to Beancount
Altynbek,

thanks for sharing example of usage of jupyter with beancount!

It really helps!
Reply all
Reply to author
Forward
0 new messages