Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created September 15, 2023 21:38
Show Gist options
  • Save typeoneerror/e1009c4863664065ab8255a4b2c7ef66 to your computer and use it in GitHub Desktop.
Save typeoneerror/e1009c4863664065ab8255a4b2c7ef66 to your computer and use it in GitHub Desktop.
Calculating median score through two databases
lets(
values, prop("Agenda(s)").map(current.prop("Journal Entries").map(current.prop("Readiness"))).flat().sort(),
mid, (values.length() / 2).floor(),
value, values.length() % 2 == 0 ? (values.at(mid) + values.at(mid - 1)) / 2 : values.at(mid),
value
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment