关于ModeAnalytics的学习

一、官方网站

https://modeanalytics.com

二、 DEMO页面

demo

三、 Let's Begin

1、连接数据库
导航栏

选择数据库类型

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语句
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 %}
report

report
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容