Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added focus consolidation view #1019

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 59 additions & 9 deletions dashboards/focus/focus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4848,6 +4848,9 @@ datasets:
crawlers: {}
views:
focus_resource_view:
dependsOn:
views:
- focus_consolidation_view
data: |-
CREATE OR REPLACE VIEW focus_resource_view AS
SELECT
Expand Down Expand Up @@ -4894,16 +4897,13 @@ views:
, sum(ConsumedQuantity) ConsumedQuantity
, sum(PricingQuantity) PricingQuantity
FROM
"${data_exports_database_name}"."focus"
focus_consolidation_view
WHERE (((current_date - INTERVAL '30' DAY) <= ChargePeriodStart) AND (ResourceId <> '') AND (CAST(concat(billing_period, '-01') AS date) >= "date_trunc"('month', (current_date - INTERVAL '30' DAY))))
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
parameters:
data_exports_database_name:
default: cid_data_export
description: "Enter the name of the database"
global: True

focus_summary_view:
dependsOn:
views:
- focus_consolidation_view
data: |-
CREATE OR REPLACE VIEW focus_summary_view AS
SELECT
Expand Down Expand Up @@ -4947,13 +4947,63 @@ views:
, sum(ConsumedQuantity) ConsumedQuantity
, sum(PricingQuantity) PricingQuantity
FROM
"${data_exports_database_name}"."focus"
focus_consolidation_view
WHERE (("BillingPeriodStart" >= ("date_trunc"('month', current_timestamp) - INTERVAL '7' MONTH)) AND (CAST(concat(billing_period, '-01') AS date) >= ("date_trunc"('month', current_date) - INTERVAL '7' MONTH)))
GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
focus_consolidation_view:
data: |-
CREATE OR REPLACE VIEW focus_consolidation_view AS
yprikhodko marked this conversation as resolved.
Show resolved Hide resolved
SELECT
availabilityzone
, billedcost
, billingaccountid
, billingaccountname
, billingcurrency
, billingperiodend
, billingperiodstart
, chargecategory
, chargeclass
, chargedescription
, chargefrequency
, chargeperiodend
, chargeperiodstart
, commitmentdiscountcategory
, commitmentdiscountid
, commitmentdiscountname
, commitmentdiscounttype
, commitmentdiscountstatus
, consumedquantity
, consumedunit
, contractedcost
, contractedunitprice
, effectivecost
, invoiceissuername
, listcost
, listunitprice
, pricingcategory
, pricingquantity
, pricingunit
, providername
, publishername
, regionid
, regionname
, resourceid
, resourcename
, resourcetype
, servicecategory
, servicename
, skuid
, skupriceid
, subaccountid
, subaccountname
, tags
, billing_period
FROM
"${data_exports_database_name}"."focus"
parameters:
data_exports_database_name:
type: athena
query: SELECT DISTINCT table_schema FROM information_schema.columns WHERE table_name = 'focus'
default: cid_data_export
description: "Enter the name of the database"
global: True
global: True
Loading