Skip to content

Instantly share code, notes, and snippets.

@Lahannin
Last active February 22, 2022 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lahannin/9e1f2be43d0067814dabab62bf209d2a to your computer and use it in GitHub Desktop.
Save Lahannin/9e1f2be43d0067814dabab62bf209d2a to your computer and use it in GitHub Desktop.
{
"dataSources": {
"enableCaching": false,
"id": "demo-ds",
"name": "demo-ds",
"pdm": {
"tables": [
{
"columns": [
{
"dataType": "NUMERIC",
"isPrimaryKey": false,
"name": "budget"
},
{
"dataType": "STRING",
"isPrimaryKey": true,
"name": "campaign_channel_id"
},
{
"dataType": "INT",
"isPrimaryKey": false,
"name": "campaign_id",
"referencedTableColumn": "campaign_id",
"referencedTableId": "campaigns"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "category"
},
{
"dataType": "NUMERIC",
"isPrimaryKey": false,
"name": "spend"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "type"
}
],
"id": "campaign_channels",
"path": [
"demo",
"campaign_channels"
],
"type": "TABLE"
},
{
"columns": [
{
"dataType": "INT",
"isPrimaryKey": true,
"name": "campaign_id"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "campaign_name"
}
],
"id": "campaigns",
"path": [
"demo",
"campaigns"
],
"type": "TABLE"
},
{
"columns": [
{
"dataType": "INT",
"isPrimaryKey": true,
"name": "customer_id"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "customer_name"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "geo__state__location"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "region"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "state"
}
],
"id": "customers",
"path": [
"demo",
"customers"
],
"type": "TABLE"
},
{
"columns": [
{
"dataType": "INT",
"isPrimaryKey": false,
"name": "campaign_id",
"referencedTableColumn": "campaign_id",
"referencedTableId": "campaigns"
},
{
"dataType": "INT",
"isPrimaryKey": false,
"name": "customer_id",
"referencedTableColumn": "customer_id",
"referencedTableId": "customers"
},
{
"dataType": "DATE",
"isPrimaryKey": false,
"name": "date"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "order_id"
},
{
"dataType": "STRING",
"isPrimaryKey": true,
"name": "order_line_id"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "order_status"
},
{
"dataType": "NUMERIC",
"isPrimaryKey": false,
"name": "price"
},
{
"dataType": "INT",
"isPrimaryKey": false,
"name": "product_id",
"referencedTableColumn": "product_id",
"referencedTableId": "products"
},
{
"dataType": "NUMERIC",
"isPrimaryKey": false,
"name": "quantity"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "wdf__region"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "wdf__state"
}
],
"id": "order_lines",
"path": [
"demo",
"order_lines"
],
"type": "TABLE"
},
{
"columns": [
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "category"
},
{
"dataType": "INT",
"isPrimaryKey": true,
"name": "product_id"
},
{
"dataType": "STRING",
"isPrimaryKey": false,
"name": "product_name"
}
],
"id": "products",
"path": [
"demo",
"products"
],
"type": "TABLE"
}
]
},
"schema": "demo",
"type": "POSTGRESQL",
"url": "jdbc:postgresql://localhost:5432/demo",
"username": "demouser"
}
],
"organization": {
"hostname": "localhost",
"id": "default",
"name": "Default Organization",
"oauthClientId": "5c399fd2-53c6-4e75-a570-01541fe9bff7"
},
"userGroups": [
{
"id": "adminGroup"
}
],
"users": [
{
"id": "admin",
"userGroups": [
{
"id": "adminGroup",
"type": "userGroup"
}
]
},
{
"authId": "CiRlMDM0ZTAyNy03NmMxLTRhNzMtOTA3MC1mNThkYWY5MGQxYzUSBWxvY2Fs",
"id": "demo",
"userGroups": [
{
"id": "adminGroup",
"type": "userGroup"
}
]
}
],
"workspaceDataFilters": [],
"workspaces": [
{
"id": "092e88c11dd840f6977fa0c4c37bce8f",
"model": {
"analytics": {
"analyticalDashboards": [
{
"content": {
"filterContextRef": {
"identifier": {
"id": "date_filter",
"type": "filterContext"
}
},
"layout": {
"type": "IDashboardLayout",
"sections": [
{
"type": "IDashboardLayoutSection",
"items": [
{
"type": "IDashboardLayoutItem",
"size": {
"xl": {
"gridWidth": 12
}
},
"widget": {
"type": "insight",
"title": "Total Sales by Year",
"description": "",
"ignoreDashboardFilters": [],
"dateDataSet": {
"identifier": {
"id": "date",
"type": "dataset"
}
},
"insight": {
"identifier": {
"id": "total_sales_by_year",
"type": "visualizationObject"
}
},
"drills": [],
"properties": {}
}
}
]
}
]
},
"version": "2"
},
"description": "A dashboard that provides a visual representation of total sales",
"id": "sales_dashboard",
"title": "Sales Dashboard"
}
],
"dashboardPlugins": [],
"filterContexts": [
{
"content": {
"filters": [],
"version": "2"
},
"description": "",
"id": "date_filter",
"title": "filterContext"
}
],
"metrics": [
{
"content": {
"format": "$#,##0.00",
"maql": "SELECT SUM({fact/price}* SUM({fact/quantity}))"
},
"description": "The value of all the products sold over time.",
"id": "total_sales",
"title": "Total Sales"
}
],
"visualizationObjects": [
{
"content": {
"buckets": [
{
"items": [
{
"measure": {
"localIdentifier": "33f6054078b74dc8912e524f8911d1cc",
"definition": {
"measureDefinition": {
"item": {
"identifier": {
"id": "total_sales",
"type": "metric"
}
},
"filters": []
}
},
"title": "Total Sales"
}
}
],
"localIdentifier": "measures"
},
{
"items": [
{
"attribute": {
"localIdentifier": "ceba9c56516b468ba157e77e6cb6d3a3",
"displayForm": {
"identifier": {
"id": "date.year",
"type": "label"
}
},
"alias": "Year"
}
}
],
"localIdentifier": "view"
}
],
"filters": [],
"sorts": [],
"properties": {},
"visualizationUrl": "local:column",
"version": "2"
},
"description": "Total Sales by Year",
"id": "total_sales_by_year",
"title": "Total Sales by Year"
}
]
},
"ldm": {
"datasets": [
{
"attributes": [
{
"description": "Campaign channel id",
"id": "campaign_channel_id",
"labels": [
{
"description": "Campaign channel id",
"id": "campaign_channel_id",
"primary": true,
"sourceColumn": "campaign_channel_id",
"tags": [
"Campaign channels"
],
"title": "Campaign channel id"
}
],
"tags": [
"Campaign channels"
],
"title": "Campaign channel id"
},
{
"description": "Category",
"id": "campaign_channels.category",
"labels": [
{
"description": "Category",
"id": "campaign_channels.category",
"primary": true,
"sourceColumn": "category",
"tags": [
"Campaign channels"
],
"title": "Category"
}
],
"tags": [
"Campaign channels"
],
"title": "Category"
},
{
"description": "Type",
"id": "type",
"labels": [
{
"description": "Type",
"id": "type",
"primary": true,
"sourceColumn": "type",
"tags": [
"Campaign channels"
],
"title": "Type"
}
],
"tags": [
"Campaign channels"
],
"title": "Type"
}
],
"dataSourceTableId": {
"dataSourceId": "demo-ds",
"id": "campaign_channels",
"type": "dataSource"
},
"description": "",
"facts": [
{
"description": "Budget",
"id": "budget",
"sourceColumn": "budget",
"tags": [
"Campaign channels"
],
"title": "Budget"
},
{
"description": "Spend",
"id": "spend",
"sourceColumn": "spend",
"tags": [
"Campaign channels"
],
"title": "Spend"
}
],
"grain": [
{
"id": "campaign_channel_id",
"type": "attribute"
}
],
"id": "campaign_channels",
"references": [
{
"identifier": {
"id": "campaigns",
"type": "dataset"
},
"multivalue": false,
"sourceColumns": [
"campaign_id"
]
}
],
"tags": [
"Campaign channels"
],
"title": "Campaign channels"
},
{
"attributes": [
{
"description": "Campaign id",
"id": "campaign_id",
"labels": [
{
"description": "Campaign id",
"id": "campaign_id",
"primary": true,
"sourceColumn": "campaign_id",
"tags": [
"Campaigns"
],
"title": "Campaign id"
}
],
"tags": [
"Campaigns"
],
"title": "Campaign id"
},
{
"description": "Campaign name",
"id": "campaign_name",
"labels": [
{
"description": "Campaign name",
"id": "campaign_name",
"primary": true,
"sourceColumn": "campaign_name",
"tags": [
"Campaigns"
],
"title": "Campaign name"
}
],
"tags": [
"Campaigns"
],
"title": "Campaign name"
}
],
"dataSourceTableId": {
"dataSourceId": "demo-ds",
"id": "campaigns",
"type": "dataSource"
},
"description": "",
"facts": [],
"grain": [
{
"id": "campaign_id",
"type": "attribute"
}
],
"id": "campaigns",
"references": [],
"tags": [
"Campaigns"
],
"title": "Campaigns"
},
{
"attributes": [
{
"description": "Customer id",
"id": "customer_id",
"labels": [
{
"description": "Customer id",
"id": "customer_id",
"primary": true,
"sourceColumn": "customer_id",
"tags": [
"Customers"
],
"title": "Customer id"
}
],
"tags": [
"Customers"
],
"title": "Customer id"
},
{
"description": "Customer name",
"id": "customer_name",
"labels": [
{
"description": "Customer name",
"id": "customer_name",
"primary": true,
"sourceColumn": "customer_name",
"tags": [
"Customers"
],
"title": "Customer name"
}
],
"tags": [
"Customers"
],
"title": "Customer name"
},
{
"description": "Region",
"id": "region",
"labels": [
{
"description": "Region",
"id": "region",
"primary": true,
"sourceColumn": "region",
"tags": [
"Customers"
],
"title": "Region"
}
],
"tags": [
"Customers"
],
"title": "Region"
},
{
"description": "State",
"id": "state",
"labels": [
{
"description": "Location",
"id": "geo__state__location",
"primary": false,
"sourceColumn": "geo__state__location",
"tags": [
"Customers"
],
"title": "Location"
},
{
"description": "State",
"id": "state",
"primary": true,
"sourceColumn": "state",
"tags": [
"Customers"
],
"title": "State"
}
],
"tags": [
"Customers"
],
"title": "State"
}
],
"dataSourceTableId": {
"dataSourceId": "demo-ds",
"id": "customers",
"type": "dataSource"
},
"description": "",
"facts": [],
"grain": [
{
"id": "customer_id",
"type": "attribute"
}
],
"id": "customers",
"references": [],
"tags": [
"Customers"
],
"title": "Customers"
},
{
"attributes": [
{
"description": "Order id",
"id": "order_id",
"labels": [
{
"description": "Order id",
"id": "order_id",
"primary": true,
"sourceColumn": "order_id",
"tags": [
"Order lines"
],
"title": "Order id"
}
],
"tags": [
"Order lines"
],
"title": "Order id"
},
{
"description": "Order line id",
"id": "order_line_id",
"labels": [
{
"description": "Order line id",
"id": "order_line_id",
"primary": true,
"sourceColumn": "order_line_id",
"tags": [
"Order lines"
],
"title": "Order line id"
}
],
"tags": [
"Order lines"
],
"title": "Order line id"
},
{
"description": "Order status",
"id": "order_status",
"labels": [
{
"description": "Order status",
"id": "order_status",
"primary": true,
"sourceColumn": "order_status",
"tags": [
"Order lines"
],
"title": "Order status"
}
],
"tags": [
"Order lines"
],
"title": "Order status"
}
],
"dataSourceTableId": {
"dataSourceId": "demo-ds",
"id": "order_lines",
"type": "dataSource"
},
"description": "",
"facts": [
{
"description": "Price",
"id": "price",
"sourceColumn": "price",
"tags": [
"Order lines"
],
"title": "Price"
},
{
"description": "Quantity",
"id": "quantity",
"sourceColumn": "quantity",
"tags": [
"Order lines"
],
"title": "Quantity"
}
],
"grain": [
{
"id": "order_line_id",
"type": "attribute"
}
],
"id": "order_lines",
"references": [
{
"identifier": {
"id": "campaigns",
"type": "dataset"
},
"multivalue": false,
"sourceColumns": [
"campaign_id"
]
},
{
"identifier": {
"id": "customers",
"type": "dataset"
},
"multivalue": false,
"sourceColumns": [
"customer_id"
]
},
{
"identifier": {
"id": "date",
"type": "dataset"
},
"multivalue": false,
"sourceColumns": [
"date"
]
},
{
"identifier": {
"id": "products",
"type": "dataset"
},
"multivalue": false,
"sourceColumns": [
"product_id"
]
}
],
"tags": [
"Order lines"
],
"title": "Order lines"
},
{
"attributes": [
{
"description": "Product id",
"id": "product_id",
"labels": [
{
"description": "Product id",
"id": "product_id",
"primary": true,
"sourceColumn": "product_id",
"tags": [
"Products"
],
"title": "Product id"
}
],
"tags": [
"Products"
],
"title": "Product id"
},
{
"description": "Product name",
"id": "product_name",
"labels": [
{
"description": "Product name",
"id": "product_name",
"primary": true,
"sourceColumn": "product_name",
"tags": [
"Products"
],
"title": "Product name"
}
],
"tags": [
"Products"
],
"title": "Product name"
},
{
"description": "Category",
"id": "products.category",
"labels": [
{
"description": "Category",
"id": "products.category",
"primary": true,
"sourceColumn": "category",
"tags": [
"Products"
],
"title": "Category"
}
],
"tags": [
"Products"
],
"title": "Category"
}
],
"dataSourceTableId": {
"dataSourceId": "demo-ds",
"id": "products",
"type": "dataSource"
},
"description": "",
"facts": [],
"grain": [
{
"id": "product_id",
"type": "attribute"
}
],
"id": "products",
"references": [],
"tags": [
"Products"
],
"title": "Products"
}
],
"dateInstances": [
{
"description": "",
"granularities": [
"MINUTE",
"HOUR",
"DAY",
"WEEK",
"MONTH",
"QUARTER",
"YEAR",
"MINUTE_OF_HOUR",
"HOUR_OF_DAY",
"DAY_OF_WEEK",
"DAY_OF_MONTH",
"DAY_OF_YEAR",
"WEEK_OF_YEAR",
"MONTH_OF_YEAR",
"QUARTER_OF_YEAR"
],
"granularitiesFormatting": {
"titleBase": "",
"titlePattern": "%titleBase - %granularityTitle"
},
"id": "date",
"tags": [
"Date"
],
"title": "Date"
}
]
}
},
"name": "Analytics as Code"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment