Apply markup to a specific service
Objective: Add or subtract a percentage from the cost of a specific service.
Use case: Create a visualization to show the service cost, adjusted by subtracting or adding a fee.
SQL:
CASE
WHEN "product/productname" = 'Amazon Elastic Compute Cloud' THEN (
CASE
WHEN MONTH("lineitem/usagestartdate") = 1
AND YEAR("lineitem/usagestartdate") = 2025 THEN 1.16
WHEN MONTH("lineitem/usagestartdate") = 2
AND YEAR("lineitem/usagestartdate") = 2025 THEN 1.22
WHEN MONTH("lineitem/usagestartdate") = 3
AND YEAR("lineitem/usagestartdate") = 2025 THEN 1.21
WHEN MONTH("lineitem/usagestartdate") = 4
AND YEAR("lineitem/usagestartdate") = 2025 THEN 1.19
WHEN MONTH("lineitem/usagestartdate") = 5
AND YEAR("lineitem/usagestartdate") = 2025 THEN 1.23
ELSE 1.20
END
)
ELSE * "lineitem/unblendedcost"
ENDLast updated