Skip to content

Computed Value: Boolean Count

Create an extension of ComputedValueComponent, that simply counts how many true answers exist for a boolean question in the provided dataset and timeframe and compares it to the counts how many true answers exist for the previous time frame. Only for boolean valued questions.

  • Only for boolean answers
  • Calculate the number of true answer in the provided dataset and timeframe.
  • Calculate the number of true answer in the provided dataset and the previous timeframe of the same length.
  • Final output: Calculate the difference of change from between those two counts.

i.e. current_timewindow_yes_count - past_timewindow_yes_count

If !588+ was not merged yet, base you MR off of it. That MR also includes some explanation what Computed values are about, plus an example: AverageTrendComputedValueComponent.

Data and timeframe are given by a DataViewControl (use .datasets[0], and .startDate and .endDate).

Add Description for the computed value:

"This timeframe's average vs. last timeframe's average"

ComputedValueCategories (see docs computed-value-component.class.ts):

  • Positve values: Class A
  • Negative values: Class B
  • 0 values: Class N

Clickup: https://app.clickup.com/t/861mz9jaq

Figma: https://www.figma.com/file/8PWKCoBl4vl4TrI32UV5op/RC-Design-PRODUCTION?type=design&node-id=7139%3A76329&mode=design&t=8L0TeMvZfDLR1oNZ-1

Edited by Elisabeth Kress