Unfortunately I don't know of a way to have account level meta-data. metadata is at the transaction level. So a value expression would have nothing to sort on. Putting a code string in the account name is the closest ledger can get as far as I know.
On Sat, Dec 31, 2016 at 12:40 PM, Jakob Mattsson <[email protected]> wrote: > Yeah, I've been doing something along those lines (slightly altering the > names of my accounts) to get it to the order I want - or close at least. > > What I think would be more elegant is being able to sort on something that > would produce the desired result, rather than relying on account names > (except as a default behavior of course) . For example, from the docs: > > --sort VEXPR-S VEXPR > Sort a report by comparing the values determined using the value > expression VEXPR. For example, using ‘-S "-abs(total)"’ in the balance > report will sort account balances from greatest to least, using the > absolute value of the total. For more on how to use value expressions, > see Value Expressions > <http://www.ledger-cli.org/3.0/doc/ledger3.html#Value-Expressions>. > > Now, this can clearly sort on the amount in the accounts. Imagine if we > could sort on some other property belonging to an account. For example, it > could be on the "note" associated with an account (and the number you > suggested could be put as the first thing in there), or some other more > arbitrary data. > > Is this something anyone else would find useful? Or is there even a way to > do something similar already? > > > > > > > On Saturday, December 31, 2016 at 9:29:04 AM UTC-10, Craig Earls wrote: >> >> How is ledger supposed to know the characteristics of the commodities in >> the accounts? >> >> Ledger just sees account names as a string of characters, it does not >> treat an account that starts with "asset" or "Vermögenswert" any >> differently than any other account. It does not know how liquid or >> illiquid the commodities in an account are. >> >> One way to control this is to name your account in the order in which you >> want them presented. >> >> For example: >> >> 00001 Assets:00001 Least Liquid >> 00001 Assets:00002 Next Least Liquid >> >> 00002 Liabilities:00001 Soonest >> 00002 Liabilities:00002 Next Soonest >> >> etc. >> >> >> I can see that this would quickly get cumbersome, but some additional >> code written for editing and displaying could help this. Like stripping >> out the 0000X in the output. The numbers don't have to be consecutive >> either, just in the sort order you want. >> >> On Sat, Dec 31, 2016 at 12:20 PM, Jakob Mattsson <[email protected]> >> wrote: >> >>> Hi all, >>> >>> I have a little pet peeve regarding balance reports. As you might know, >>> a balance sheet is usually organized with assets at the top, from the least >>> liquid to the most liquid, followed by liabilities/equities, from the most >>> immediate to be paid to the least immediate. >>> >>> In ledger-cli the output of the balance command is sorted by account >>> names. >>> >>> Is there a way to control this output order, so it can more closely >>> resemble "the usual" ordering in a balance sheet? >>> >>> >>> >>> >>> -- >>> >>> --- >>> 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]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Craig, Corona De Tucson, AZ >> [image: missile_flyout] >> enderw88.wordpress.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]. > For more options, visit https://groups.google.com/d/optout. > -- Craig, Corona De Tucson, AZ [image: missile_flyout] enderw88.wordpress.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]. For more options, visit https://groups.google.com/d/optout.
