;doc: Generating data: rewrite

This commit is contained in:
Simon Michael 2024-05-31 19:41:56 -10:00
parent a5a067204e
commit 0f8b536055

View File

@ -5084,37 +5084,28 @@ $ hledger balance Income:Dues --pivot kind:member
# Generating data # Generating data
hledger has several features for generating data, such as: hledger can enrich the data provided to it, or generate new data, in a number of ways.
Mostly, this is done only if you request it:
- [Periodic transaction](#periodic-transactions) rules can generate - Missing amounts or missing costs in transactions are inferred automatically when possible.
single or repeating transactions following a template. These are - The `--infer-equity` flag infers missing conversion equity postings from @/@@ costs.
usually dated in the future, eg to help with forecasting. They are - The `--infer-costs` flag infers missing costs from conversion equity postings.
activated by the `--forecast` option. - The `--infer-market-prices` flag infers `P` price directives from costs.
- The `--auto` flag adds extra postings to transactions matched by [auto posting rules](#auto-postings).
- The balance command's `--budget` option uses these same periodic - The `--forecast` option generates transactions from [periodic transaction rules](#periodic-transactions).
rules to generate goals for the budget report. - The `balance --budget` report infers budget goals from periodic transaction rules.
- Commands like `close`, `rewrite`, and `hledger-interest` generate transactions or postings.
- CSV data is converted to transactions by applying CSV conversion rules.. etc.
- [Auto posting](#auto-postings) rules can generate extra postings on Such generated data is temporary, existing only at report time.
certain matched transactions. They are always applied to forecast You can convert it to permanent recorded data by, eg, capturing the output of `hledger print` and saving it in your journal file.
transactions; with the `--auto` flag they are applied to This can sometimes be useful as a data entry aid.
transactions recorded in the journal as well.
- The `--infer-equity` flag infers missing conversion equity postings If you are curious what data is being generated and why, run `hledger print -x --verbose-tags`.
from @/@@ costs. And the inverse `--infer-costs` flag infers missing `-x/--explicit` shows inferred amounts and `--verbose-tags` adds tags like
@/@@ costs from conversion equity postings. `generated-transaction` (from periodic rules) and `generated-posting`, `modified` (from auto posting rules).
Similar hidden tags (with an underscore prefix) are always present, also,
Generated data of this kind is temporary, existing only at report so you can always match such data with queries like `tag:generated` or `tag:modified`.
time. But you can see it in the output of `hledger print`, and you
can save that to your journal, in effect converting it from temporary
generated data to permanent recorded data. This could be useful as a
data entry aid.
If you are wondering what data is being generated and why, add the
`--verbose-tags` flag. In `hledger print` output you will see extra
tags like `generated-transaction`, `generated-posting`, and
`modified` on generated/modified data. Also, even without `--verbose-tags`,
generated data always has equivalen hidden tags (with an underscore prefix),
so eg you could match generated transactions with `tag:_generated-transaction`.
# Forecasting # Forecasting