Skip to main content

calculated_attribute_definitions

Creates, updates, deletes, gets or lists a calculated_attribute_definitions resource.

Overview

Namecalculated_attribute_definitions
TypeResource
Idaws.customer_profiles.calculated_attribute_definitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
attribute_detailsobjectMathematical expression and a list of attribute items specified in that expression.
calculated_attribute_namestringThe unique name of the calculated attribute. (pattern: <code>^[a-zA-Z_][a-zA-Z_0-9-]*$</code>)
conditionsobjectThe conditions including range, object count, and threshold for the calculated attribute.
created_atstring (date-time)The timestamp of when the calculated attribute definition was created.
descriptionstringThe description of the calculated attribute.
display_namestringThe display name of the calculated attribute. (pattern: <code>^[a-zA-Z_][a-zA-Z_0-9-\s]*$</code>)
filterobjectDefines how to filter the objects coming in for calculated attributes.
last_updated_atstring (date-time)The timestamp of when the calculated attribute definition was most recently edited.
readinessobjectInformation indicating if the Calculated Attribute is ready for use by confirming all historical data has been processed and reflected.
statisticstringThe aggregation operation to perform for the calculated attribute. (FIRST_OCCURRENCE, LAST_OCCURRENCE, COUNT, SUM, MINIMUM, MAXIMUM, AVERAGE, MAX_OCCURRENCE)
statusstringStatus of the Calculated Attribute creation (whether all historical data has been indexed). (PREPARING, IN_PROGRESS, COMPLETED, FAILED)
tagsobjectThe tags used to organize, track, or control access for this resource.
use_historical_databooleanWhether historical data ingested before the Calculated Attribute was created should be included in calculations.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_calculated_attribute_definitionselectdomain_name, calculated_attribute_name, regionProvides more information on a calculated attribute definition for Customer Profiles.
list_calculated_attribute_definitionsselectdomain_name, regionnext-token, max-resultsLists calculated attribute definitions for Customer Profiles
create_calculated_attribute_definitioninsertdomain_name, calculated_attribute_name, region, AttributeDetailsCreates a new calculated attribute definition. After creation, new object data ingested into Customer Profiles will be included in the calculated attribute, which can be retrieved for a profile using the GetCalculatedAttributeForProfile API. Defining a calculated attribute makes it available for all profiles within a domain. Each calculated attribute can only reference one ObjectType and at most, two fields from that ObjectType.
update_calculated_attribute_definitionupdatedomain_name, calculated_attribute_name, regionUpdates an existing calculated attribute definition. When updating the Conditions, note that increasing the date range of a calculated attribute will not trigger inclusion of historical data greater than the current date range.
delete_calculated_attribute_definitiondeletedomain_name, calculated_attribute_name, regionDeletes an existing calculated attribute definition. Note that deleting a default calculated attribute is possible, however once deleted, you will be unable to undo that action and will need to recreate it on your own using the CreateCalculatedAttributeDefinition API if you want it back.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
calculated_attribute_namestringThe unique name of the calculated attribute.
domain_namestringThe unique name of the domain.
regionstringAWS region (default: us-east-1)
max-resultsintegerThe maximum number of calculated attribute definitions returned per page.
next-tokenstringThe pagination token from the previous call to ListCalculatedAttributeDefinitions.

SELECT examples

Provides more information on a calculated attribute definition for Customer Profiles.

SELECT
attribute_details,
calculated_attribute_name,
conditions,
created_at,
description,
display_name,
filter,
last_updated_at,
readiness,
statistic,
status,
tags,
use_historical_data
FROM aws.customer_profiles.calculated_attribute_definitions
WHERE domain_name = '{{ domain_name }}' -- required
AND calculated_attribute_name = '{{ calculated_attribute_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new calculated attribute definition. After creation, new object data ingested into Customer Profiles will be included in the calculated attribute, which can be retrieved for a profile using the GetCalculatedAttributeForProfile API. Defining a calculated attribute makes it available for all profiles within a domain. Each calculated attribute can only reference one ObjectType and at most, two fields from that ObjectType.

INSERT INTO aws.customer_profiles.calculated_attribute_definitions (
DisplayName,
Description,
AttributeDetails,
Conditions,
Filter,
Statistic,
UseHistoricalData,
Tags,
domain_name,
calculated_attribute_name,
region
)
SELECT
'{{ DisplayName }}',
'{{ Description }}',
'{{ AttributeDetails }}' /* required */,
'{{ Conditions }}',
'{{ Filter }}',
'{{ Statistic }}',
{{ UseHistoricalData }},
'{{ Tags }}',
'{{ domain_name }}',
'{{ calculated_attribute_name }}',
'{{ region }}'
RETURNING
attribute_details,
calculated_attribute_name,
conditions,
created_at,
description,
display_name,
filter,
last_updated_at,
readiness,
statistic,
status,
tags,
use_historical_data
;

UPDATE examples

Updates an existing calculated attribute definition. When updating the Conditions, note that increasing the date range of a calculated attribute will not trigger inclusion of historical data greater than the current date range.

UPDATE aws.customer_profiles.calculated_attribute_definitions
SET
DisplayName = '{{ DisplayName }}',
Description = '{{ Description }}',
Conditions = '{{ Conditions }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND calculated_attribute_name = '{{ calculated_attribute_name }}' --required
AND region = '{{ region }}' --required
RETURNING
attribute_details,
calculated_attribute_name,
conditions,
created_at,
description,
display_name,
last_updated_at,
readiness,
statistic,
status,
tags,
use_historical_data;

DELETE examples

Deletes an existing calculated attribute definition. Note that deleting a default calculated attribute is possible, however once deleted, you will be unable to undo that action and will need to recreate it on your own using the CreateCalculatedAttributeDefinition API if you want it back.

DELETE FROM aws.customer_profiles.calculated_attribute_definitions
WHERE domain_name = '{{ domain_name }}' --required
AND calculated_attribute_name = '{{ calculated_attribute_name }}' --required
AND region = '{{ region }}' --required
;