{"record":{"id":"cf021c3df5e8a69e","repo":"actualbudget/actual","slug":"unknown-property-name-did-you-mean-to-call-a","errorCode":null,"errorMessage":"Unknown property \"${name}.\" Did you mean to call a function? Try prefixing it with $","messagePattern":"Unknown property \"(.+?)\\.\" Did you mean to call a function\\? Try prefixing it with \\$","errorType":"exception","errorClass":"CompileError","httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/aql/compiler.ts","lineNumber":531,"sourceCode":"      Object.keys(expr).find(k => k[0] === '$')\n    ) {\n      // It's a function call\n      return compileFunction(state, expr);\n    }\n  }\n\n  return compileLiteral(expr);\n});\n\nconst compileFunction = saveStack('function', (state, func) => {\n  const [name] = Object.keys(func);\n  let argExprs = func[name];\n  if (!Array.isArray(argExprs)) {\n    argExprs = [argExprs];\n  }\n\n  if (name[0] !== '$') {\n    throw new CompileError(\n      `Unknown property \"${name}.\" Did you mean to call a function? Try prefixing it with $`,\n    );\n  }\n\n  let args = argExprs;\n  // `$condition` is a special-case where it will be evaluated later\n  if (name !== '$condition') {\n    args = argExprs.map(arg => compileExpr(state, arg));\n  }\n\n  switch (name) {\n    // aggregate functions\n    case '$sum': {\n      validateArgLength(args, 1);\n      const [arg1] = valArray(state, args, ['float']);\n      return typed(`SUM(${arg1})`, args[0].type);\n    }\n","sourceCodeStart":513,"sourceCodeEnd":549,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/aql/compiler.ts#L513-L549","documentation":"This CompileError comes from compileFunction in the AQL compiler. Function calls in AQL expressions must reference named functions with a `$` prefix (e.g. `$month`); when the key of a property in an expression object does not start with `$`, the compiler assumes it is not a function call and rejects it. The message hints that the user likely intended to call a function but forgot the `$` prefix.","triggerScenarios":"Calling compileQuery/`q()` with an expression object whose key is meant to be a function but lacks the `$` prefix, e.g. `{amount: {month: '$date'}}` instead of `{$month: '$date'}`.","commonSituations":"Hand-writing AQL expressions from memory, porting raw SQL-style field references into AQL, or copying older query examples that predate the `$`-prefixed function convention.","solutions":["Prefix the function key with `$`, e.g. change `month:` to `$month:`.","Check the list of supported functions in the AQL compiler to confirm the function name is valid.","If you actually wanted to reference a field, use `$field` syntax on the right-hand side instead of a nested object key."],"exampleFix":"// before\n{ select: [{ date: 'day' }] }\n// after\n{ select: [{ day: { $date: '$date' } }] }","handlingStrategy":"validation","validationCode":"function assertFunctionCall(expr) {\n  for (const key of Object.keys(expr)) {\n    if (typeof expr[key] === 'object' && expr[key] !== null && !key.startsWith('$')) {\n      throw new Error(`Function \"${key}\" must be prefixed with $`);\n    }\n  }\n}","typeGuard":"const isFunctionCall = (expr) => typeof expr === 'object' && expr !== null && Object.keys(expr).every(k => k.startsWith('$'));","tryCatchPattern":null,"preventionTips":["Always prefix AQL function names with $.","Lint custom query builders for non-$ object keys nested under field values.","Keep a shared constant map of valid function names instead of hand-writing keys."],"tags":["aql","query-compiler","syntax"],"backgroundTag":"aql-function-prefix-missing","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}