New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A "tags" reporting command. #261

Open
maisammusthafa opened this Issue May 23, 2015 · 7 comments

Comments

Projects
None yet
5 participants
@maisammusthafa

maisammusthafa commented May 23, 2015

Here are some features I would like to see in hledger.

  1. A "tags" reporting command that will report a list of all the tags in the journal (even the tags with values, and multiple tags on single lines). The list will show only unique tags, and will be sorted alphabetically.
  2. A --values flag for the "tags" reporting command that will report the tags and their values (only tags with values will be shown).
  3. A --count flag for the "tags" reporting command that will show how many times each tag has been used.

This will help greatly when using tags in queries since the user will know exactly what tags to query.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@imransobir

This comment has been minimized.

Show comment
Hide comment
@imransobir

imransobir May 23, 2015

+1, would like to see this feature as well.

imransobir commented May 23, 2015

+1, would like to see this feature as well.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael May 23, 2015

Owner

Great idea. I have not used tags heavily enough to need it, but I can see how it would be useful. The accounts command, and maybe the stats command, should give some ideas if someone would like to work on it.

Owner

simonmichael commented May 23, 2015

Great idea. I have not used tags heavily enough to need it, but I can see how it would be useful. The accounts command, and maybe the stats command, should give some ideas if someone would like to work on it.

@the-solipsist

This comment has been minimized.

Show comment
Hide comment
@the-solipsist

the-solipsist Oct 17, 2017

I feel it would be useful to print tag values as well when printing the tags.

the-solipsist commented Oct 17, 2017

I feel it would be useful to print tag values as well when printing the tags.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Oct 17, 2017

Owner

I had forgotten this issue, but the tags command arrived recently, in hledger 1.4. We can improve it further:

Currently any arguments filter the transactions in which tags are discovered. Today I found this unintuitive (see #hledger log) and I propose to add a new first argument which filters the tag names themselves, ie changing the UI to hledger tag [TAGNAMEREGEX [QUERYARGS]].

Note you can see tag values now by using the accounts command and --pivot: hledger --pivot TAGNAME accounts. Is tags --values still needed ? If so what should the output look like ?

How should --count's output look ? Should --count interact with --values ?

A related report which gives some idea of tag activity: hledger activity tag:TAGNAME

Owner

simonmichael commented Oct 17, 2017

I had forgotten this issue, but the tags command arrived recently, in hledger 1.4. We can improve it further:

Currently any arguments filter the transactions in which tags are discovered. Today I found this unintuitive (see #hledger log) and I propose to add a new first argument which filters the tag names themselves, ie changing the UI to hledger tag [TAGNAMEREGEX [QUERYARGS]].

Note you can see tag values now by using the accounts command and --pivot: hledger --pivot TAGNAME accounts. Is tags --values still needed ? If so what should the output look like ?

How should --count's output look ? Should --count interact with --values ?

A related report which gives some idea of tag activity: hledger activity tag:TAGNAME

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Oct 18, 2017

Owner

There is some overlap between these tag reporting desires and our usual reports. We could add some features generalising these:

  • a different kind of pivot. Instead of using the values of a single tag as account names, it would use TAGNAME:TAGVALUE as the account names. Might or might not be useful to expose in UI.
  • a --count mode. Instead of summing amounts, it would count the number of postings. Could be used with any report.

Given the above, we could produce pseudo balance reports including tag names, tag values, and accumulated hierarchic counts of both, displayable in any of the ways we display balance reports.

Owner

simonmichael commented Oct 18, 2017

There is some overlap between these tag reporting desires and our usual reports. We could add some features generalising these:

  • a different kind of pivot. Instead of using the values of a single tag as account names, it would use TAGNAME:TAGVALUE as the account names. Might or might not be useful to expose in UI.
  • a --count mode. Instead of summing amounts, it would count the number of postings. Could be used with any report.

Given the above, we could produce pseudo balance reports including tag names, tag values, and accumulated hierarchic counts of both, displayable in any of the ways we display balance reports.

@simonmichael simonmichael added help wanted tags and removed easy? cli labels Oct 18, 2017

@ony

This comment has been minimized.

Show comment
Hide comment
@ony

ony Oct 20, 2017

Collaborator

I clearly can see benefit of listing all unique names of tags and all tags with their corresponding values to identify misspelling or to provide input for auto-completio (especially with filtering).

But I'm not sure I understand use-case for --count. Is it to place most frequent tags in a top list of auto-completion? Or identifying which tags are used infrequently and might be a subject for stripping from journal?

Collaborator

ony commented Oct 20, 2017

I clearly can see benefit of listing all unique names of tags and all tags with their corresponding values to identify misspelling or to provide input for auto-completio (especially with filtering).

But I'm not sure I understand use-case for --count. Is it to place most frequent tags in a top list of auto-completion? Or identifying which tags are used infrequently and might be a subject for stripping from journal?

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Oct 20, 2017

Owner
Owner

simonmichael commented Oct 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment