Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
30 changes: 22 additions & 8 deletions models/demo/accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,30 @@ models:
meta:
primary_key: account_id
# This filter means that unless you are an admin, you can't see Enterprise account
sql_filter: ${lightdash.attributes.is_admin_saas_demo} = 'true' or segment != 'Enterprise'
description: List of all customer and prospective customer Accounts pulled from our CRM
sql_filter: ${lightdash.attributes.is_admin_saas_demo} = 'true' or segment !=
'Enterprise'
description: List of all customer and prospective customer Accounts pulled from
our CRM
joins:
- join: deals
sql_on: ${accounts.account_id} = ${deals.account_id}
type: inner
fields: [unique_deals, new_deals, won_deals, lost_deals, stage, average_amount, total_amount]
fields:
[
unique_deals,
new_deals,
won_deals,
lost_deals,
stage,
average_amount,
total_amount
]
columns:
- name: account_id
description: "The Account ID from our database"
meta:
dimension:
type: number
type: string
urls:
- label: 'Open in CRM'
url: https://demo_saas.com/example/account/${ value.raw }
Expand All @@ -31,19 +42,22 @@ models:
unique_smb_accounts:
label: Unique SMB Accounts
type: count_distinct
description: The unique number of accounts based on distinct Account IDs for accounts in the SMB Segment
description: The unique number of accounts based on distinct Account IDs for
accounts in the SMB Segment
filters:
- segment: 'SMB'
unique_midmarket_accounts:
label: Unique Midmarket Accounts
type: count_distinct
description: The unique number of Midmarket accounts based on distinct Account IDs for accounts in the Midmarket Segment
description: The unique number of Midmarket accounts based on distinct Account
IDs for accounts in the Midmarket Segment
filters:
- segment: 'Midmarket'
unique_enterprise_accounts:
label: Unique Enterprise Accounts
type: count_distinct
description: The unique number of accounts based on distinct Account IDs for accounts in the Enterprise Segment
description: The unique number of accounts based on distinct Account IDs for
accounts in the Enterprise Segment
filters:
- segment: 'Enterprise'
- name: account_name
Expand All @@ -60,4 +74,4 @@ models:
description: "The market Segment for this account (SMB, Midmarket, Enterprise)"
meta:
dimension:
type: string
type: string
Loading