analytics-dimension {khisr}R Documentation

Analytics Data Dimensions

Description

Constructs a dimensions expression for analytics queries based on specified property, operator, and values.

Usage

analytics_dimension(property, operator, values)

operator %.d% values

operator %.f% values

Arguments

property

A character string representing whether its dimension or filter. It only accepts 'dimension', 'filter'.

operator

A character string representing the property to filter on (e.g., 'dx', 'pe', 'ou').

values

A vector of values or semi-colon separated string items.

Details

DHIS2 organizes data using multiple dimensions, each with a unique identifier and a set of items that represent specific data points within that dimension.

The infix operator used for filter and dimension includes:

Value

A spliced list with filter in the format property=operator:value

Examples


# Create a dimension for data element "DE_1234"
analytics_dimension('dimension', "dx", "DE_1234")

# Equivalent to the expression above
dx %.d% "DE_1234"

# Create a filter dimension for the period of January 2024
pe %.f% "202401"

# Create filter dimension for periods "202401" and "202402":
analytics_dimension("filter", "pe", c("202401", "202402"))


[Package khisr version 1.0.5 Index]