bean-query Absolute value on inventory?

63 views
Skip to first unread message

Jacques Gagnon

unread,
Sep 6, 2017, 7:31:41 AM9/6/17
to bean...@googlegroups.com
Hi,

I got a simple report with bean-query for taxable interest and filter on the Income account so the amount is negative.

I though I could use the absolute function to get ride of the sign but it doesn't work:
select year, abs(sum(position)) as interest where account ~ "Income:Interest" and not account ~ "TFSA|RRSP" group by year order by year

ERROR: Invalid type for argument 0 of Abs: found <class 'beancount.core.inventory.Inventory'> expected <class 'decimal.Decimal'>.

Any suggestion? It's not a big deal but I'm still curious.

Martin Blais

unread,
Sep 6, 2017, 5:17:45 PM9/6/17
to Beancount
Only defined over Decimal:

It would be next to nothing to add it for Inventory and Position





--
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+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAPgTVrbPfjV05o7oWgtR-114ApSDy-znAKF1wqo-yjKOS%3Dt8Lg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Martin Blais

unread,
Sep 6, 2017, 5:46:24 PM9/6/17
to Martin Blais, Beancount

Jacques Gagnon

unread,
Sep 6, 2017, 5:51:20 PM9/6/17
to bean...@googlegroups.com, Martin Blais
That work, Thanks :)

Jacques Gagnon
GTalk/E-Mail: darth...@gmail.com
WLM (MSN): clou...@msn.com

Reply all
Reply to author
Forward
0 new messages