absolute_form_query: Create form query of type 'ABSOLUTE'

Description Usage Arguments Value Examples

View source: R/form_queries.R

Description

Creates query of type 'ABSOLUTE'

Usage

1
2
3
4
5
6
7
8
9
absolute_form_query(
  query_id,
  start_date,
  end_date,
  queries = NULL,
  concept_ids = NULL,
  connection = NULL,
  resolution = "COMPLETE"
)

Arguments

query_id

query_id for query that defines population

start_date

start date of date restriction for features

end_date

end date of date restriction for features

queries

list of queries (type 'CONCEPT_QUERY' - from create_query function)

concept_ids

list of concept ids to use instead of queries

connection

connection object is needed when using concept_ids

resolution

time resolution of output - 'COMPLETE', 'YEARS', 'QUARTERS'

Value

absolute form query

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Step 1. Get query id that represents group of people
# a) Take query id from return value of execute_query function (Example)
concept_id = "fdb_destatis.alter"
query = concept_to_query(concept_id, connection = connection,
                         start_date="2017-01-01", end_date="2017-01-31")
query_id = execute_query(connection, query)

# b) Get query id from from query label
query_id = query_label_to_id(connection, "query-label")

# Step 2. Create Form Query

## Absolute Form
form_query = absolute_form_query(query_id,
                                 concept_ids = list("fdb_destatis.alter",
                                                    "fdb_destatis.geschlecht"),
                                 connection=connection,
                                 start_date="2017-01-01", end_date="2017-01-31")

## Relative Form
form_query = relative_form_query(query_id,
                                 before_concept_ids = list("fdb_destatis.alter",
                                                    "fdb_destatis.geschlecht"),
                                 after_concept_ids = list("fdb_destatis.alter",
                                                           "fdb_destatis.geschlecht"),
                                 connection=connection,
                                 start_date="2017-01-01", end_date="2017-01-31")

# Step 3. Execute form_query
form_query_id = execute_query(connection, form_query)

# Step 4. Get query result
data = get_query_result(connection, form_query_id)

ingef/cqapiR documentation built on Dec. 20, 2021, 7:02 p.m.