Tagging and Cost Allocation

Tagging is quite common in large organizations, it fulfills the requirement of allocating costs back to specific business units. It is also important for optimizing workload allocation and for measuring performance.

  1. Display Top20 Highest Costing Items grouped by CostCenter Detail Description and tags
SELECT "bill_payer_account_id",
"product_product_name",
"line_item_usage_type",
"line_item_line_item_description",
resource_tags_user_cost_center,
round(sum(line_item_unblended_cost), 2) as cost
FROM "costmaster"."monthly_report"
WHERE length("resource_tags_user_cost_center") > 0
GROUP BY "resource_tags_user_cost_center",
"bill_payer_account_id",
"product_product_name",
"line_item_usage_type",
"line_item_line_item_description"
ORDER BY cost desc
LIMIT 20

Cost

  1. Query results returned

Cost

  1. Display Top20 Highest Costing Items grouped by Detailed Description and omit the CostCenter tag
SELECT "bill_payer_account_id",
"product_product_name",
"line_item_usage_type",
"line_item_line_item_description",
round(sum(line_item_unblended_cost), 2) as cost
FROM "costmaster"."monthly_report"
WHERE length("resource_tags_user_cost_center") = 0
GROUP BY "bill_payer_account_id",
"product_product_name",
"line_item_usage_type",
"line_item_line_item_description"
ORDER BY cost desc
LIMIT 20

Cost

  1. Query results returned

Cost