# Dataset Calculated Fields

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Calculated Field</td><td valign="top">Cost Management</td><td valign="top">Marketplace Spending</td><td valign="top">Container Allocation</td><td valign="top">Savings Plans Management</td></tr><tr><td valign="top">Container Utilization Rate</td><td valign="top"> </td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td></tr><tr><td valign="top">Is Container Resource</td><td valign="top"> </td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td></tr><tr><td valign="top">Marketplace Total Cost</td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">Marketplace Usage Cost</td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">Marketplace Subscription Cost</td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">Is Third Party</td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">AWS Platform Cost</td><td valign="top"> </td><td valign="top">X</td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">Spending Source</td><td valign="top"> X</td><td valign="top">X</td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">SP Coverage Rate</td><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td><td valign="top">X</td></tr><tr><td valign="top">SP Savings Amount</td><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td><td valign="top">X</td></tr><tr><td valign="top">Is SP Covered</td><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td><td valign="top">X</td></tr></tbody></table>

Container Utilization Rate

```
ifelse(
  {split_cost} + {split_unused_cost} = 0, 
  NULL, 
  {split_cost} / ({split_cost} + {split_unused_cost})
)
```

Is Container Resource (Dimension)

```
ifelse(isNotNull({split_cost}) AND {split_cost} > 0, "Yes", "No")
```

Marketplace Total Cost

```
ifelse({billing_entity} = "AWS Marketplace", {unblended_cost}, 0)
```

Marketplace Usage Cost

```
ifelse({billing_entity} = "AWS Marketplace" AND {charge_type} = "Usage", {unblended_cost}, 0)
```

Marketplace Subscription Cost

```
ifelse({billing_entity} = "AWS Marketplace" AND {charge_type} = "Fee", {unblended_cost}, 0)
```

Is Third Party (Dimension)

```
ifelse({billing_entity} = "AWS Marketplace", "Yes", "No")
```

AWS Platform Cost

```
ifelse({billing_entity} = "AWS", {unblended_cost}, 0)
```

Spending Source (Dimension)

```
ifelse({billing_entity} = "AWS Marketplace", "Marketplace", "AWS")
```

SP Coverage Rate

```
ifelse(
  {charge_type} = 'SavingsPlanCoveredUsage',
  {savings_plan_coverage} / nullIf({savings_plan_coverage} + {savings_plan_effective_cost}, 0),
  NULL
)
```

SP Savings Amount

```
ifelse(
  {charge_type} = 'SavingsPlanCoveredUsage',
  {savings_plan_coverage} - {savings_plan_effective_cost},
  0
)
```

Is SP Covered

```
ifelse({savings_plan_coverage} > 0, "Yes", "No")
```

AI Cost

```
ifelse(strlen({ai_operation_type}) > 0, {cost}, NULL)
```

AI Region Type

```
ifelse(
  locate('_Global', {usage_type}) > 0 AND strlen({ai_operation_type}) > 0, 'Global (Cross-Region)',
  ifelse(strlen({ai_operation_type}) > 0, 'Regional (Hardcoded)', NULL)
)
```

### New Calculated Fields (26.4.0)

The following calculated fields were added in version 26.4.0 to support unified cost reporting, discount tracking, business week alignment, and credit source identification across all topics.

#### Cost (Unified)

Combines claimed\_cost and shared\_cost into a single unified cost field. This is the primary cost metric used across all topics for total spending queries. The field sums both directly claimed resource costs and shared (allocated) costs for each resource.

```
{claimed_cost} + {shared_cost}
```

#### Net Cost

Calculates the effective cost after applying all discounts and credits. This field subtracts distributor discounts, private rate discounts, bundled discounts, EDP discounts, and SPP discounts from the unified cost to provide the true net spending amount.

```
{cost} - {distributor_discount} - {private_rate_discount} - {bundled_discount} - {edp_discount} - {spp_discount}
```

#### Discount Columns

Five discount columns are sourced directly from the Athena query layer and included in the dataset as raw columns (not calculated fields). These are used by the net\_cost calculated field above. The discount columns are: distributor\_discount, private\_rate\_discount, bundled\_discount, edp\_discount, and spp\_discount. Each column contains the discount amount applied to that line item. All values default to 0 when no discount applies.

#### Business Week Number

Assigns a business week number (W1 through W6) to each line item based on the interval\_start date. Business weeks run Sunday through Saturday. W1 starts on the first day of the month, W2 starts on the first Sunday on or after the 2nd, and so on. A month can have up to 6 business weeks. This field is calculated at the dataset level rather than the topic level to ensure consistent week alignment across all queries.

```
ceil(
  (extract('DD', {interval_start}) + 
     extract('WD', addDateTime(-extract('DD', {interval_start}) + 1, 'DD', {interval_start})))
       / 7
       )
```

#### Business Week Label

Creates a human-readable label for each business week in the format "Mon YYYY - Wn" (e.g., "Jan 2026 - W1"). This field concatenates the three-letter month abbreviation, four-digit year, and the business\_week\_number to produce a sortable, display-friendly week identifier.

```
concat(
  formatDate({interval_start}, 'MMM'),
    ' ',
      toString(extract('YYYY', {interval_start})),
        ' - W',
          toString({business_week_number})
          )
```

#### Credit Source

Identifies the source of AWS credits applied to line items. Credits appear as negative cost values in the dataset. The credit\_source field uses the line\_item\_description column to classify credits by their origin (e.g., Enterprise Discount Program, Support credits, promotional credits). This field is sourced as a raw column from the Athena query layer, not as a calculated field.
