Workaround with tags
Jack
ostroffjh at users.sourceforge.net
Wed Feb 26 21:51:46 GMT 2025
On 2025.02.26 16:09, Louis-Philippe Allard via KMyMoney wrote:
> Hello maillist,
>
> While the devs are working on the next updates of KMM, and hopefully
> make the tags working, are anyone aware of a decent workaround to use
> tags in reports?
>
> I am extensively using tags to "bundle" transactions across multiple
> categories to track project costs...
>
> I have not found a way to have all transactions of a specific tag
> listd in a single location. The tags page doesnt list the
> transactions if they are splits, the reports are not working well at
> all with tags and the only somehow relatively "OK" way I found is to
> do a system-wide search (Find transaction) using the tag in the Text
> search field..... Even that does not let me export nor copy paste
> the results so its pretty much pointless...
>
> Exporting my KMY file in another format? Database ? Excel?....
>
> Hopefully someone has a recommendation for those like me using tags...
Hello Louis-Philippe,
Exporting to a database would allow full searching, but only if you are
comfortable using SQL. While the core of the data store in the .kmy
file is XML, that does translate well to a relational database model.
However, with the right tools, you can also query more directly the
XML. I have used Perl, and the XML::LibXML module to write a script to
query the data for all securities containing (regular expression
search) a given sub-string, and then list all the stock accounts for
those securities, and finally all the Investment Accounts containing
those stock accounts. However, I am personally more comfortable using
SQL, but I used the XML approach because it allows me to use my current
data file, instead of having to save as SQL every time I want to use
that script. I was already very comfortable using Perl, but it did
take me a while to figure out the proper syntax for doing the XML
related searches. If you are not comfortable with Perl, I suspect that
Python, Ruby, and other scripting languages also have appropriate XML
parsing modules.
I would not suggest trying to use Excel, as there is no direct export,
and no easy way I know of to get a spreadsheet with things lined up in
an easy to search and manipulate format. However you approach this, it
is probably pretty important to understand how the various entities
relate to each other, so you can properly assemble the pieces. The
TAGS entity links the tag id to the tag name, the SPLITS entity links
the TRANSACTIONS to the ACCOUNTS, and so forth. This is not really
difficult to follow, but it is often confusing until you become more
familiar with it.
Jack
More information about the KMyMoney
mailing list