[GH-ISSUE #6093] [Bug]: ActualQL .calculate Fails "Can't convert String to float" #16840

Closed
opened 2026-04-14 19:50:48 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Phil89a on GitHub (Nov 8, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/6093

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

Trying to use ActualQL to sum the amount column in Transactions, using the example in the documentation, but the sum of amount fails with "Error: Can't convert string to float"

The query in question is

window.$query(window.$q('transactions') 
  .filter({ 'category.name': 'Food' })
  .calculate({ $sum: 'amount' }));

Returned: -

Unhandled Promise Rejection: Error: Can’t convert string to float
Expression stack:
  {"$sum":"amount"}
  select({"result":{"$sum":"amount"}})

Also tried the below query which failed the same error: -

window.$query(window.$q('transactions') 
  .filter({ 'category.name': 'Food' })
    .select({ total: { $sum: 'amount' } }));

How can we reproduce the issue?

Insert and run the above query in DevTools Console

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Safari

Operating System

Mac OSX

Originally created by @Phil89a on GitHub (Nov 8, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/6093 ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? Trying to use ActualQL to sum the amount column in Transactions, using the example in the documentation, but the sum of amount fails with "Error: Can't convert string to float" The query in question is ``` window.$query(window.$q('transactions') .filter({ 'category.name': 'Food' }) .calculate({ $sum: 'amount' })); ``` Returned: - ``` Unhandled Promise Rejection: Error: Can’t convert string to float Expression stack: {"$sum":"amount"} select({"result":{"$sum":"amount"}}) ``` Also tried the below query which failed the same error: - ``` window.$query(window.$q('transactions') .filter({ 'category.name': 'Food' }) .select({ total: { $sum: 'amount' } })); ``` ### How can we reproduce the issue? Insert and run the above query in DevTools Console ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Safari ### Operating System Mac OSX
GiteaMirror added the API label 2026-04-14 19:50:48 -05:00
Author
Owner

@MatissJanis commented on GitHub (Nov 10, 2025):

👋 Thanks for the issue! Turns out the docs were incorrect.

I have updated them here: https://github.com/actualbudget/actual/pull/6105

This is the correct query:

window.$query(window.$q('transactions') 
  .filter({ 'category.name': 'Food' })
  .calculate({ $sum: '$amount' }));
<!-- gh-comment-id:3513808337 --> @MatissJanis commented on GitHub (Nov 10, 2025): 👋 Thanks for the issue! Turns out the docs were incorrect. I have updated them here: https://github.com/actualbudget/actual/pull/6105 This is the correct query: ``` window.$query(window.$q('transactions') .filter({ 'category.name': 'Food' }) .calculate({ $sum: '$amount' })); ```
Author
Owner

@Phil89a commented on GitHub (Nov 10, 2025):

Lovely thanks - I can removed my code that was looping through all transactions to get the total :-)

<!-- gh-comment-id:3513816203 --> @Phil89a commented on GitHub (Nov 10, 2025): Lovely thanks - I can removed my code that was looping through all transactions to get the total :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#16840