Account Balance Not Showing Correctly in Ledger

I have a chequing account under Assets that has an opening balance of 0 as of 2021-12-31. I imported a few QFX formatted transactions and in the ledger for this account, the first transaction is dated 2022-01-18, with a payment of $334.37. However, on this line the balance is 2,347.22, which does not make sense to me. Should the balance not be -334.37, considering the opening balance is 0? None of the transactions are reconciled although there is a Cleared balance of 2,68.59, but I cannot find any transactions in this account that have a status of Cleared.

Also, the consistency check displays the following issues:

  • Potential problem with securities/currencies
    • The account ‘Joint Chequing’ in currency ‘Canadian Dollar’ has no price set for the opening date ‘2021-12-31’.
      Please enter a price for the currency on or before the opening date.

In Settings > Configure… > General > Filter, the do not show transactions prior to is set to 1900-01-01.

I have been trying to figure out these two issues for a few days, but cannot for the life of me find the problem. Any suggestion or assistance on how I might solve this is much appreciated.

First things first: which version of KMyMoney are you using on which operating system?

Looking at the amounts you provided it seems to me that things are OK (provided that 2,68.59 is a typo):

2,681.59 - 334.37 = 2,347.22

Also, the information that 2,347.22 is the amount cleared somehow confirms that. So there must be more than this one transaction you mentioned in that account because the information about the cleared amount is calculated based on existing transactions. Maybe, they are hidden for a reason. Some more questions:

  • what is the status of the option “Do not show reconciled transactions”? Turn off if selected.
  • what is the status of the transaction filter in the ledger view? Make sure it is set to “Any status”.

Regarding the issue reported by the consistency check: the account is denominated in a currency different from your selected base currency (I don’t know which one it should be). Therefore, a conversion rate is required to get correct results. Depending on your situation you have two choices:

  • provide a currency conversion rate (Tools/Prices) or
  • change the setting of your base currency in case it is CAD.

The latter can be achieved using Tools/Currencies.

I hope that gets you started. If you need more help simply ask here.

Thank you for your response. My apologies for not providing the basic information in my previous post. Below is the information you requested:

KMyMoney Version: 5.1.3-ca3da80c6

OS: Windows 11 Pro Version: 10.0.22631 Build 22631

Yes “2,68.59” was a typo. Your assumption is correct it is 2,681.59.

“Do not show reconciled transactions” was turned off, (the box was not checked).

The status of the transaction filter in the Ledgers view was set to “Any status”.

The base currency should be CAD. From Tools > Currencies… I highlighted CAD and selected “Select as base currency”, then Close and Save; on reopening KMyMoney, it prompts me with the pop-up window “Currencies – KMyMoney” to select the base currency. This happens every time I launch KMyMoney.

So, there are two issues here for which I need assistance.

  1. How do I find the hidden transactions in the Account that make up the balance of 2,681.59? Opening balance for this Account is 0. In the Ledgers view it does show “Cleared: 2,681.59”, however, I cannot find these “Cleared” transactions in the ledger.

  2. Why does it keep prompting me for the base currency every time I launch KMyMoney, even after choosing “Select as base currency” for CAD?

Thanks again for your assistance and I look forward to your response.

Thank you for the confirmation of my assumptions about the values.

It is very strange, that KMyMoney forgets the setting of the base currency. It asks for it when it figures out that no base currency is assigned when opening the file.

Please try the following (best with a version of the file that does not ask for the base currency in case you still have it. There should be files called your-file-name.kmy.#~ (where # is a number starting at 1) in the directory where you store your data file. In case they don’t exist, the option to create them was not activated and we need to use your data file directly).

  1. Copy the above mentioned file to something like “testdata.kmy” (we like to work on backups)
  2. Open that file using KMyMoney
  3. Select Save as... and make sure to store the file with an extension of .xml (it will write the same content as before but un-compressed) You may want to read about file formats in the manual.
  4. Don’t quit KMyMoney
  5. Open this .xml file using your favorite editor (e.g. notepad)

Search for baseCurrency to find a line that looks like
<PAIR key="kmm-baseCurrency" value="EUR"/>.

What does this line look like? I expect the value to be different from CAD.

  1. Close the editor and go back to the running KMyMoney instance.
  2. Change the base currency to CAD
  3. Save the file using Save (not Save as...)
  4. Repeat steps 4. and 5.

What does the baseCurrency line look like now?

Regarding the other problem concerning the transactions, use the editor and look for a section starting with <ACCOUNTS> in the xml file. Locate the one that is for your chequing account and remember the value of id="A######".

Locate the section in the file that starts with <TRANSACTIONS> and check if you find entries of the form <SPLIT ....> that contain account="A######" where ###### is the number you found in the <ACCOUNTS> section for your account.

Do more of those entries exist than you see on screen? What is the postdate=yyyy-mm-dd of their surrounding <TRANSACTION>? How does it differ from the opening date of the account? Maybe, you can post them here after you replaced sensitive information by XXXX.

I hope this is not too technical to perform and analyze.

Thank you very much for the direction you provided, I suspect I know what the problem might be, which I have detailed at the end of this post. But first, below are the results of what you asked me to try.

  1. When I executed your steps 1 – 5 from the previous post, I was not able to find the line that had the string “baseCurrency” in the XML file.

  2. When I executed your steps 6 – 9, the baseCurrency line I found in the XML file looked like the following:
    .

Now launching KMyMoney does not prompt for the default currency, so the default currency persists in the file.

Also, the Cleared total in the Ledger View for the Account with the missing transactions is now zero. As a result, the balance of the first entry is now -334.37 which is correct and there are no missing transactions.

When I installed KMyMoney I selected the SQL database SQLite for the data rather than the kmy file format. I suspect the data file somehow got corrupted, but I am not sure how. I have been using it for 10 months with no issues and there are about 1,000 transactions in 6 accounts, it was only last week I ran into these issues. When I did the “save as” to an XML file format, I think the correct transaction entries were saved to the XML file. If you need me to investigate further why the problem occurred in the SQL database, I am happy to do so, but will need some guidance.

For now, I have decided to use the kmy file format as it does not seem to cause any problems.

Thanks again for your help and patience.