# TopicCalculatedFieldProperty

A structure that represents a calculated field.

- Source: Generated at build time
- Type last changed: v2.141.0 · 8 May 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_quicksight as quicksight } from 'aws-cdk-lib';
const topicCalculatedFieldProperty: quicksight.CfnTopic.TopicCalculatedFieldProperty = {
  calculatedFieldName: 'calculatedFieldName',
  expression: 'expression',

  // the properties below are optional
  aggregation: 'aggregation',
  allowedAggregations: ['allowedAggregations'],
  calculatedFieldDescription: 'calculatedFieldDescription',
  calculatedFieldSynonyms: ['calculatedFieldSynonyms'],
  cellValueSynonyms: [{
    cellValue: 'cellValue',
    synonyms: ['synonyms'],
  }],
  columnDataRole: 'columnDataRole',
  comparativeOrder: {
    specifedOrder: ['specifedOrder'],
    treatUndefinedSpecifiedValues: 'treatUndefinedSpecifiedValues',
    useOrdering: 'useOrdering',
  },
  defaultFormatting: {
    displayFormat: 'displayFormat',
    displayFormatOptions: {
      blankCellFormat: 'blankCellFormat',
      currencySymbol: 'currencySymbol',
      dateFormat: 'dateFormat',
      decimalSeparator: 'decimalSeparator',
      fractionDigits: 123,
      groupingSeparator: 'groupingSeparator',
      negativeFormat: {
        prefix: 'prefix',
        suffix: 'suffix',
      },
      prefix: 'prefix',
      suffix: 'suffix',
      unitScaler: 'unitScaler',
      useBlankCellFormat: false,
      useGrouping: false,
    },
  },
  disableIndexing: false,
  isIncludedInTopic: false,
  neverAggregateInFilter: false,
  nonAdditive: false,
  notAllowedAggregations: ['notAllowedAggregations'],
  semanticType: {
    falseyCellValue: 'falseyCellValue',
    falseyCellValueSynonyms: ['falseyCellValueSynonyms'],
    subTypeName: 'subTypeName',
    truthyCellValue: 'truthyCellValue',
    truthyCellValueSynonyms: ['truthyCellValueSynonyms'],
    typeName: 'typeName',
    typeParameters: {
      typeParametersKey: 'typeParameters',
    },
  },
  timeGranularity: 'timeGranularity',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_quicksight as quicksight

topic_calculated_field_property = quicksight.CfnTopic.TopicCalculatedFieldProperty(
    calculated_field_name="calculatedFieldName",
    expression="expression",

    # the properties below are optional
    aggregation="aggregation",
    allowed_aggregations=["allowedAggregations"],
    calculated_field_description="calculatedFieldDescription",
    calculated_field_synonyms=["calculatedFieldSynonyms"],
    cell_value_synonyms=[quicksight.CfnTopic.CellValueSynonymProperty(
        cell_value="cellValue",
        synonyms=["synonyms"]
    )],
    column_data_role="columnDataRole",
    comparative_order=quicksight.CfnTopic.ComparativeOrderProperty(
        specifed_order=["specifedOrder"],
        treat_undefined_specified_values="treatUndefinedSpecifiedValues",
        use_ordering="useOrdering"
    ),
    default_formatting=quicksight.CfnTopic.DefaultFormattingProperty(
        display_format="displayFormat",
        display_format_options=quicksight.CfnTopic.DisplayFormatOptionsProperty(
            blank_cell_format="blankCellFormat",
            currency_symbol="currencySymbol",
            date_format="dateFormat",
            decimal_separator="decimalSeparator",
            fraction_digits=123,
            grouping_separator="groupingSeparator",
            negative_format=quicksight.CfnTopic.NegativeFormatProperty(
                prefix="prefix",
                suffix="suffix"
            ),
            prefix="prefix",
            suffix="suffix",
            unit_scaler="unitScaler",
            use_blank_cell_format=False,
            use_grouping=False
        )
    ),
    disable_indexing=False,
    is_included_in_topic=False,
    never_aggregate_in_filter=False,
    non_additive=False,
    not_allowed_aggregations=["notAllowedAggregations"],
    semantic_type=quicksight.CfnTopic.SemanticTypeProperty(
        falsey_cell_value="falseyCellValue",
        falsey_cell_value_synonyms=["falseyCellValueSynonyms"],
        sub_type_name="subTypeName",
        truthy_cell_value="truthyCellValue",
        truthy_cell_value_synonyms=["truthyCellValueSynonyms"],
        type_name="typeName",
        type_parameters={
            "type_parameters_key": "typeParameters"
        }
    ),
    time_granularity="timeGranularity"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.quicksight.*;

TopicCalculatedFieldProperty topicCalculatedFieldProperty = TopicCalculatedFieldProperty.builder()
        .calculatedFieldName("calculatedFieldName")
        .expression("expression")

        // the properties below are optional
        .aggregation("aggregation")
        .allowedAggregations(List.of("allowedAggregations"))
        .calculatedFieldDescription("calculatedFieldDescription")
        .calculatedFieldSynonyms(List.of("calculatedFieldSynonyms"))
        .cellValueSynonyms(List.of(CellValueSynonymProperty.builder()
                .cellValue("cellValue")
                .synonyms(List.of("synonyms"))
                .build()))
        .columnDataRole("columnDataRole")
        .comparativeOrder(ComparativeOrderProperty.builder()
                .specifedOrder(List.of("specifedOrder"))
                .treatUndefinedSpecifiedValues("treatUndefinedSpecifiedValues")
                .useOrdering("useOrdering")
                .build())
        .defaultFormatting(DefaultFormattingProperty.builder()
                .displayFormat("displayFormat")
                .displayFormatOptions(DisplayFormatOptionsProperty.builder()
                        .blankCellFormat("blankCellFormat")
                        .currencySymbol("currencySymbol")
                        .dateFormat("dateFormat")
                        .decimalSeparator("decimalSeparator")
                        .fractionDigits(123)
                        .groupingSeparator("groupingSeparator")
                        .negativeFormat(NegativeFormatProperty.builder()
                                .prefix("prefix")
                                .suffix("suffix")
                                .build())
                        .prefix("prefix")
                        .suffix("suffix")
                        .unitScaler("unitScaler")
                        .useBlankCellFormat(false)
                        .useGrouping(false)
                        .build())
                .build())
        .disableIndexing(false)
        .isIncludedInTopic(false)
        .neverAggregateInFilter(false)
        .nonAdditive(false)
        .notAllowedAggregations(List.of("notAllowedAggregations"))
        .semanticType(SemanticTypeProperty.builder()
                .falseyCellValue("falseyCellValue")
                .falseyCellValueSynonyms(List.of("falseyCellValueSynonyms"))
                .subTypeName("subTypeName")
                .truthyCellValue("truthyCellValue")
                .truthyCellValueSynonyms(List.of("truthyCellValueSynonyms"))
                .typeName("typeName")
                .typeParameters(Map.of(
                        "typeParametersKey", "typeParameters"))
                .build())
        .timeGranularity("timeGranularity")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.QuickSight;

var topicCalculatedFieldProperty = new TopicCalculatedFieldProperty {
    CalculatedFieldName = "calculatedFieldName",
    Expression = "expression",

    // the properties below are optional
    Aggregation = "aggregation",
    AllowedAggregations = new [] { "allowedAggregations" },
    CalculatedFieldDescription = "calculatedFieldDescription",
    CalculatedFieldSynonyms = new [] { "calculatedFieldSynonyms" },
    CellValueSynonyms = new [] { new CellValueSynonymProperty {
        CellValue = "cellValue",
        Synonyms = new [] { "synonyms" }
    } },
    ColumnDataRole = "columnDataRole",
    ComparativeOrder = new ComparativeOrderProperty {
        SpecifedOrder = new [] { "specifedOrder" },
        TreatUndefinedSpecifiedValues = "treatUndefinedSpecifiedValues",
        UseOrdering = "useOrdering"
    },
    DefaultFormatting = new DefaultFormattingProperty {
        DisplayFormat = "displayFormat",
        DisplayFormatOptions = new DisplayFormatOptionsProperty {
            BlankCellFormat = "blankCellFormat",
            CurrencySymbol = "currencySymbol",
            DateFormat = "dateFormat",
            DecimalSeparator = "decimalSeparator",
            FractionDigits = 123,
            GroupingSeparator = "groupingSeparator",
            NegativeFormat = new NegativeFormatProperty {
                Prefix = "prefix",
                Suffix = "suffix"
            },
            Prefix = "prefix",
            Suffix = "suffix",
            UnitScaler = "unitScaler",
            UseBlankCellFormat = false,
            UseGrouping = false
        }
    },
    DisableIndexing = false,
    IsIncludedInTopic = false,
    NeverAggregateInFilter = false,
    NonAdditive = false,
    NotAllowedAggregations = new [] { "notAllowedAggregations" },
    SemanticType = new SemanticTypeProperty {
        FalseyCellValue = "falseyCellValue",
        FalseyCellValueSynonyms = new [] { "falseyCellValueSynonyms" },
        SubTypeName = "subTypeName",
        TruthyCellValue = "truthyCellValue",
        TruthyCellValueSynonyms = new [] { "truthyCellValueSynonyms" },
        TypeName = "typeName",
        TypeParameters = new Dictionary<string, string> {
            { "typeParametersKey", "typeParameters" }
        }
    },
    TimeGranularity = "timeGranularity"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

topicCalculatedFieldProperty := &TopicCalculatedFieldProperty{
	CalculatedFieldName: jsii.String("calculatedFieldName"),
	Expression: jsii.String("expression"),

	// the properties below are optional
	Aggregation: jsii.String("aggregation"),
	AllowedAggregations: []*string{
		jsii.String("allowedAggregations"),
	},
	CalculatedFieldDescription: jsii.String("calculatedFieldDescription"),
	CalculatedFieldSynonyms: []*string{
		jsii.String("calculatedFieldSynonyms"),
	},
	CellValueSynonyms: []interface{}{
		&CellValueSynonymProperty{
			CellValue: jsii.String("cellValue"),
			Synonyms: []*string{
				jsii.String("synonyms"),
			},
		},
	},
	ColumnDataRole: jsii.String("columnDataRole"),
	ComparativeOrder: &ComparativeOrderProperty{
		SpecifedOrder: []*string{
			jsii.String("specifedOrder"),
		},
		TreatUndefinedSpecifiedValues: jsii.String("treatUndefinedSpecifiedValues"),
		UseOrdering: jsii.String("useOrdering"),
	},
	DefaultFormatting: &DefaultFormattingProperty{
		DisplayFormat: jsii.String("displayFormat"),
		DisplayFormatOptions: &DisplayFormatOptionsProperty{
			BlankCellFormat: jsii.String("blankCellFormat"),
			CurrencySymbol: jsii.String("currencySymbol"),
			DateFormat: jsii.String("dateFormat"),
			DecimalSeparator: jsii.String("decimalSeparator"),
			FractionDigits: jsii.Number(123),
			GroupingSeparator: jsii.String("groupingSeparator"),
			NegativeFormat: &NegativeFormatProperty{
				Prefix: jsii.String("prefix"),
				Suffix: jsii.String("suffix"),
			},
			Prefix: jsii.String("prefix"),
			Suffix: jsii.String("suffix"),
			UnitScaler: jsii.String("unitScaler"),
			UseBlankCellFormat: jsii.Boolean(false),
			UseGrouping: jsii.Boolean(false),
		},
	},
	DisableIndexing: jsii.Boolean(false),
	IsIncludedInTopic: jsii.Boolean(false),
	NeverAggregateInFilter: jsii.Boolean(false),
	NonAdditive: jsii.Boolean(false),
	NotAllowedAggregations: []*string{
		jsii.String("notAllowedAggregations"),
	},
	SemanticType: &SemanticTypeProperty{
		FalseyCellValue: jsii.String("falseyCellValue"),
		FalseyCellValueSynonyms: []*string{
			jsii.String("falseyCellValueSynonyms"),
		},
		SubTypeName: jsii.String("subTypeName"),
		TruthyCellValue: jsii.String("truthyCellValue"),
		TruthyCellValueSynonyms: []*string{
			jsii.String("truthyCellValueSynonyms"),
		},
		TypeName: jsii.String("typeName"),
		TypeParameters: map[string]*string{
			"typeParametersKey": jsii.String("typeParameters"),
		},
	},
	TimeGranularity: jsii.String("timeGranularity"),
}
```

## Properties

- `aggregation`: string — The default aggregation.

  Valid values for this structure are `SUM` , `MAX` , `MIN` , `COUNT` , `DISTINCT_COUNT` , and `AVERAGE` .

- `allowedAggregations`: string[] — The list of aggregation types that are allowed for the calculated field.

  Valid values for this structure are `COUNT` , `DISTINCT_COUNT` , `MIN` , `MAX` , `MEDIAN` , `SUM` , `AVERAGE` , `STDEV` , `STDEVP` , `VAR` , `VARP` , and `PERCENTILE` .

- `calculatedFieldDescription`: string — The calculated field description.

- `calculatedFieldName`: string (required) — The calculated field name.

- `calculatedFieldSynonyms`: string[] — The other names or aliases for the calculated field.

- `cellValueSynonyms`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTopic.CellValueSynonymProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_quicksight.CfnTopic.CellValueSynonymProperty.html)[] — The other names or aliases for the calculated field cell value.

- `columnDataRole`: string — The column data role for a calculated field.

  Valid values for this structure are `DIMENSION` and `MEASURE` .

- `comparativeOrder`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTopic.ComparativeOrderProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_quicksight.CfnTopic.ComparativeOrderProperty.html) — The order in which data is displayed for the calculated field when it's used in a comparative context.

- `defaultFormatting`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTopic.DefaultFormattingProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_quicksight.CfnTopic.DefaultFormattingProperty.html) — The default formatting definition.

- `disableIndexing`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — A Boolean value that indicates if a calculated field is visible in the autocomplete.

- `expression`: string (required) — The calculated field expression.

- `isIncludedInTopic`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — A boolean value that indicates if a calculated field is included in the topic.

- `neverAggregateInFilter`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — A Boolean value that indicates whether to never aggregate calculated field in filters.

- `nonAdditive`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — The non additive for the table style target.

- `notAllowedAggregations`: string[] — The list of aggregation types that are not allowed for the calculated field.

  Valid values for this structure are `COUNT` , `DISTINCT_COUNT` , `MIN` , `MAX` , `MEDIAN` , `SUM` , `AVERAGE` , `STDEV` , `STDEVP` , `VAR` , `VARP` , and `PERCENTILE` .

- `semanticType`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTopic.SemanticTypeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_quicksight.CfnTopic.SemanticTypeProperty.html) — The semantic type.

- `timeGranularity`: string — The level of time precision that is used to aggregate `DateTime` values.
