Ash FrameworkAF
Ash Framework3y ago
12 replies
Alan Heywood

Nested aggregates and calculations

I have a calculation that looks like this conceptually:

some_documentation_created (calculation) refers to: 
  count_of_documented_skills (aggregate) filters by:
    status_calculated (calculation) refers to:
      latest_documentation_status (aggregate) sorts by:
        timestamp (calculation)
  all_documentation_approved (calculation) refers to:
    count_of_skills (aggregate)
    count_of_approved_skills (aggregate) filters by:
      status_calculated (calculation) refers to:
        latest_documentation_status (aggregate) sorts by:
          timestamp (calculation)


Can a calculation refer to an aggregate that filters by a calculation (that refers to an aggregate)? If it should be possible, the issue is illustrated here: https://gist.github.com/ahey/2c3fcb0dd215f3a82620563e96344949
Gist
GitHub Gist: instantly share code, notes, and snippets.
nested_aggregates.ex
Was this page helpful?