Skip to content
Open
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
82 changes: 82 additions & 0 deletions library/blocks/chinh_test_table.block.tpl.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// This is a library dashboard block. For more details, visit https://docs.holistics.io/docs/canvas-dashboard/guides/build-library-blocks
@template(
title='Chinh Test Table',
description='',
thumbnail='',
metadata={
group: ''
block_width: 1260
block_height: 680
}
)
Func block_chinh_test_table() {
VizBlock {
label: 'Table'
viz: DataTable {
dataset: ticket_23584
fields: [
VizFieldFull {
ref: r(chinh_dim_date.date)
format {
type: 'date'
}
uname: 'chinh_dim_date_date'
},
VizFieldFull {
ref: r(chinh_dim_category.category)
format {
type: 'text'
}
uname: 'chinh_dim_category_category_1'
},
VizFieldFull {
ref: r(ticket_23584, chinh_dim_category.active_category)
format {
type: 'number'
pattern: 'inherited'
}
hidden: true
},
VizFieldFull {
ref: r(ticket_23584.total_amount)
format {
type: 'number'
pattern: 'inherited'
}
}
]
settings {
show_row_number: true
sorts: [
SortSetting {
key: 'chinh_dim_date_date'
direction: 'desc'
},
SortSetting {
key: 'chinh_dim_category_category_1'
direction: 'asc'
}
]
conditional_formats: [
ConditionalFormat {
key: 'chinh_dim_date_date'
format: SingleFormat {
condition {
operator: 'before'
value: '2023-12-31'
}
text_color: '#BF0E08'
background_color: '#FAD2D1'
apply_to_row: true
}
}
]
row_limit: 5000
aggregate_awareness {
enabled: true
debug_comments: true
}
}
}
}
}
107 changes: 88 additions & 19 deletions team-folders/Chinh/dashboards/chinh_sandbox.page.aml
Original file line number Diff line number Diff line change
@@ -1,27 +1,94 @@
@template(
title='View Template',
description='',
thumbnail='',
metadata={
}
)
Func view_template() {
TabLayout {
label: 'View 1'
tab tab1: CanvasLayout {
label: 'Tab 1'
width: 1300
height: 1500
grid_size: 20
auto_expand_vertically: true
block v_0m6g {
position: pos(20, 100, 1260, 680)
layer: 1
}
block f_nfvl {
position: pos(20, 20, 300, 80)
layer: 2
}
block f_dtbw {
position: pos(340, 20, 300, 80)
layer: 3
}
block v_sfkb {
position: pos(20, 800, 1260, 2000)
layer: 4
}
mobile {
mode: 'auto'
}
}
tab tab2: CanvasLayout {
label: 'Tab 2'
width: 2000
height: 800
grid_size: 20
auto_expand_vertically: true
mobile {
mode: 'auto'
}
}
}
}

Dashboard chinh_sandbox {
title: 'Chinh Sandbox'
description: ''

view: CanvasLayout {
// view: view_template()
view: TabLayout {
label: 'View 1'
width: 1300
height: 900
grid_size: 20
auto_expand_vertically: true
mobile {
mode: 'auto'
}
block v_0m6g {
position: pos(20, 100, 1260, 680)
layer: 1
}
block f_nfvl {
position: pos(20, 20, 300, 80)
layer: 2
tab tab1: CanvasLayout {
label: 'Tab 1'
width: 1300
height: 1500
grid_size: 20
auto_expand_vertically: true
block v_0m6g {
position: pos(20, 100, 1260, 680)
layer: 1
}
block f_nfvl {
position: pos(20, 20, 300, 80)
layer: 2
}
block f_dtbw {
position: pos(340, 20, 300, 80)
layer: 3
}
block v_sfkb {
position: pos(20, 800, 1260, 680)
layer: 4
}
mobile {
mode: 'auto'
}
}
block f_dtbw {
position: pos(340, 20, 300, 80)
layer: 3
tab tab2: CanvasLayout {
label: 'Tab 2'
width: 2000
height: 800
grid_size: 20
auto_expand_vertically: true
mobile {
mode: 'auto'
}
}
}

Expand Down Expand Up @@ -51,6 +118,7 @@ Dashboard chinh_sandbox {
type: 'number'
pattern: 'inherited'
}
hidden: true
},
VizFieldFull {
ref: r(ticket_23584.total_amount)
Expand Down Expand Up @@ -95,7 +163,7 @@ Dashboard chinh_sandbox {
}
}
block f_nfvl: FilterBlock {
label: 'Category'
label: 'All Category'
type: 'field'
source: FieldFilterSource {
dataset: ticket_23584
Expand All @@ -118,6 +186,7 @@ Dashboard chinh_sandbox {
value: []
}
}
block v_sfkb: block_chinh_test_table()
interactions: [
FilterInteraction {
from: 'f_nfvl'
Expand Down
73 changes: 73 additions & 0 deletions team-folders/Chinh/dashboards/chinh_template.page.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Dashboard chinh_template {
title: 'chinh_template'
description: ''
owner: 'chinh.dm@holistics.io'

view: TabLayout {
label: 'View 1'
tab tab1: CanvasLayout {
label: 'Tab 1'
width: 1300
height: 675
grid_size: 25
auto_expand_vertically: true
auto_expand_horizontally: true
block v_lm5d {
position: pos(25, 125, 1250, 525)
layer: 1
}
block t_uu5o {
position: pos(25, 25, 425, 50)
layer: 2
}
mobile {
mode: 'auto'
}
}
tab tab2: CanvasLayout {
label: 'Tab 2'
width: 1300
height: 800
grid_size: 20
auto_expand_vertically: true
mobile {
mode: 'auto'
}
}
}

theme: H.themes.vanilla
block v_lm5d: VizBlock {
label: 'Total Value by Month'
viz: AreaChart {
dataset: chinh_dynamic_dataset
x_axis: VizFieldFull {
ref: r(chinh_dynamic_dim_model.order_created_at)
transformation: 'datetrunc month'
format {
type: 'date'
pattern: 'LLL yyyy'
}
}
y_axis {
series {
field: r(chinh_dynamic_dataset.total_value)
settings {
color_palette: 0
}
}
}
settings {
row_limit: 5000
x_axis_show_null_datetime: false
aggregate_awareness {
enabled: true
debug_comments: true
}
}
}
}
block t_uu5o: TextBlock {
content: @md This is the template dashboard.;;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PartialDashboard derived_chinh_template = chinh_template.extend({})
73 changes: 73 additions & 0 deletions team-folders/Chinh/datasets/chinh_23949_dataset.dataset.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Dataset chinh_23949_dataset {
label: 'chinh_23949_dataset'
description: ''
data_source_name: 'demodb'
models: [
chinh_23949
]

relationships: [
relationship(chinh_23949.user_agent_id - chinh_23949.user_agent_id, false)
]

dimension is_user_converted {
label: "Is User Converted"
type: "number"
hidden: false
description: ""
definition: @aql
dimensionalize(
count_if(chinh_23949.order_id is not null)
, chinh_23949.user_agent_id
)
;;
model: chinh_23949
}

metric conversion_rate {
label: "Conversion Rate"
type: "number"
hidden: false
description: ""
definition: @aql
safe_divide(
coalesce(
count_distinct(chinh_23949.user_agent_id) | where(chinh_23949.is_user_converted == 1)
, 0
)
, count_distinct(chinh_23949.user_agent_id)
)
;;
}

metric list_user_id {
label: "List User Id"
type: "json"
description: ""
definition: @aql unique(chinh_23949.user_agent_id);;
}

metric nominator {
label: "Nominator"
type: "number"
hidden: false
description: ""
definition: @aql coalesce(count_distinct(chinh_23949.user_agent_id) | where(chinh_23949.is_user_converted == 1), 0);;
}

metric denominator {
label: "Denominator"
type: "number"
description: ""
definition: @aql count_distinct(chinh_23949.user_agent_id);;
}
metric old_conversion_rate {
label: "Old Conversion Rate"
type: "number"
description: ""
definition: @aql safe_divide(
count_distinct(chinh_23949.order_id) * 1.0,
count_distinct(chinh_23949.user_agent_id)
);;
}
}
Loading