* Gulshan Singh <[email protected]> [2022-04-17 00:06]:
> I've tried something like this for the Medicare example, but it
> doesn't work as abs(O) is dealing with the transaction amount, and
> not the total balance of the account:

There is a syntax to refer to the total of an account:
account("...").total

However, that's not going to work for your cause.  If you go from,
let's say, $180k income to $240k, there's afaik no way to tell ledger
to apply something exactly at $200k.


account Assets:Bank
account Income:Hooli

account Liabilities:Taxes:Medicare
account Liabilities:Taxes:Medicare:Additional

= expr "account =~ /Income:Hooli/ and account('Income:Hooli').total <= -200000 
USD"
    (Liabilities:Taxes:Medicare:Additional)     .009

= expr "account =~ /Income:Hooli/"
    (Liabilities:Taxes:Medicare)                .0145

2022-04-15 * Payroll
    Income:Hooli                               -150,000 USD
    Assets:Bank

2022-04-01 * Payroll
    Income:Hooli                               -150,000 USD
    Assets:Bank

2022-04-01 * Payroll
    Income:Hooli                               -150,000 USD
    Assets:Bank

-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/Yl32BAzHYxErEudt%40jirafa.cyrius.com.

Reply via email to