关于ModeAnalytics的学习

一、官方网站

https://modeanalytics.com

二、 DEMO页面

关于ModeAnalytics的学习_第1张图片
demo

三、 Let's Begin

1、连接数据库
关于ModeAnalytics的学习_第2张图片
导航栏

关于ModeAnalytics的学习_第3张图片
选择数据库类型

关于ModeAnalytics的学习_第4张图片
image.png

填写:

  • host ip地址
  • 数据库名称
  • 数据库用户名
  • 数据库密码

Mode can connect to your database in two ways:
官网介绍

  • Direct Connect: Mode will connect directly to your database over the public internet. This is the simplest way to connect, but may require your database or network to be configured to allow Mode’s servers to connect to it.
  • Bridge: Mode connects to your database with the assistance of a small helper application installed on a computer inside your network with direct access to your database. This solution lets Mode connect to your database even if it’s not publicly accessible.

备注:

为了能让mode连接到你的本地数据库,需要利用桥接模式(安装相应的dmg软件)
2、编写sql语句
关于ModeAnalytics的学习_第5张图片
demo

关于编写sql语句 参数相关demo

SELECT orders.occurred_at::DATE AS "Date",
       orders.id AS "Order ID",
       orders.standard_amt_usd AS "Standard",
       orders.gloss_amt_usd AS "Glossy",
       orders.poster_amt_usd AS "Poster"
FROM demo.orders
JOIN demo.accounts
  ON accounts.id=orders.account_id
JOIN demo.sales_reps
  ON sales_reps.id=accounts.sales_rep_id
JOIN demo.orders__fulfillments
  ON orders__fulfillments.order_id=orders.id
JOIN demo.region on region.id=sales_reps.region_id
  WHERE orders.occurred_at >= '{{ order_start_date }}'
    AND orders.occurred_at <= '{{ order_end_date }}'
    AND region.name in ({{ sales_region }})
    AND orders.total_amt_usd >= {{ order_min }}
    AND orders.total_amt_usd <= {{ order_max }}
    AND orders__fulfillments.shipment_status = '{{ shipment_status }}'
    AND accounts.sales_rep_id in ({{ sales_rep }})


{% form %}

order_start_date:
  type: date
  default: 2016-01-01
  description: Only display results for orders placed after this date
  
order_end_date:
  type: date
  default: 2016-12-31
  description: Only display results for orders placed before this date
  
sales_region:
  type: multiselect
  default: [Northeast,West]
  description: Display results for one or more sales regions
  input_type: string
  options: [Northeast,Midwest,West,Southeast]
    
order_min:
  type: text
  default: 0
  label: Minimum Order Amt ($)
  description: Only display results for orders over this amount

order_max:
  type: text
  default: 1000
  label: Maximum Order Amt ($)
  description: Only display results for orders less than this amount
  
shipment_status:
  type: select
  default: delivered
  options: [delivered,failure]
  
{% endform %}
关于ModeAnalytics的学习_第6张图片
report

关于ModeAnalytics的学习_第7张图片
report

你可能感兴趣的:(关于ModeAnalytics的学习)