Hi! I'm trying to use this query in Fava:
SELECT
year, month, root(account, 1) as account, sum(position) as total
WHERE
account ~ "Expenses" OR
account ~ "Liabilities" OR
account ~ "Income"
GROUP BY year, month, account
ORDER BY year, month, account
FLATTEN
but it's throwing this error:
Traceback (most recent call last):
File "C:\Python\Python39\lib\cmd.py", line 214, in onecmd
func = getattr(self, 'do_' + cmd)
AttributeError: 'QueryShell' object has no attribute 'do_SELECT'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Python39\lib\site-packages\beancount\query\shell.py",
line 271, in run_parser
self.dispatch(statement)
File "C:\Python\Python39\lib\site-packages\beancount\query\shell.py",
line 251, in dispatch
return method(statement)
File "C:\Python\Python39\lib\site-packages\fava\core\query_shell.py",
line 106, in on_Select
rtypes, rrows = execute_query(c_query, self.entries, self.options_map)
File
"C:\Python\Python39\lib\site-packages\beancount\query\query_execute.py",
line 381, in execute_query
result_types, result_rows = flatten_results(result_types, result_rows)
File
"C:\Python\Python39\lib\site-packages\beancount\query\query_execute.py",
line 422, in flatten_results
value = value[irow] if irow < len(value) else None
KeyError: 0
If I remove the FLATTEN operator it works fine, but it's not the result I
expect so I would rather use it cause it's really useful for me. Any ideas?
--
You received this message because you are subscribed to the Google Groups
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/68bac62a-7e84-4308-89a7-c195451fc0ffn%40googlegroups.com.