Step-by-step tutorial MO | How to implement MatrixOne's visual reports through FineBI

1 Overview

FineBI is a new generation of big data analysis tool that helps enterprise business people deeply understand and make full use of their data. In FineBI, users can easily create diverse data visualization information and freely analyze and explore data. FineBI has a variety of data connection functions and can be used to create various complex reports and build data decision-making analysis systems. It is widely used in company management, production management, financial intelligent accounting, sales operations and other fields.

MatrixOne supports connection to the data visualization tool FineBI. This article will guide you how to connect to the stand-alone version of MatrixOne through FineBI, create various visual data reports, and assemble them into dashboards for data analysis and exploration.

2. Preliminary preparation

  • Installation and startup of MatrixOne have been completed.
  • The installation of FineBI and FineBI initialization settings have been completed.

#Note

The FineBI version used in the operation examples shown in this document is Linux 6.0. You can choose to install the package Linux_unix_FineBI6_0-CN.sh.

3. Connect to MatrixOne service through FineBI

Step 1 - After logging in to FineBI, select Management System > Data Connection > Data Connection Management > New Data Connection, as shown in the figure below, select MySQL

Step 2 - Fill in the MatrixOne connection configuration, including database name, host, port, user name, password, and other parameters can be set as default. You can click the Test Connection button to verify that the connection is available, and then click Save to save the connection:

4. Use MatrixOne data to create visual reports

1. Create Demo data

First, log in to the MatrixOne database and execute the following SQL statements to create the data tables and views required for the demonstration:

create database orders;
use orders;
CREATE TABLE `category` (`product_category_name` VARCHAR(255) DEFAULT NULL,
`product_category_name_english` VARCHAR(255) DEFAULT NULL );
CREATE TABLE `item` (`order_id` VARCHAR(255) NOT NULL, `order_item_id` INT DEFAULT null,
`product_id` VARCHAR(255) DEFAULT null,
`seller_id` VARCHAR(255) DEFAULT null, `shipping_limit_date` DATETIME DEFAULT null,
`price` DECIMAL(10,2) DEFAULT null,
`freight_value` DECIMAL(10,2) DEFAULT null
);
CREATE TABLE `review` (
`review_id` VARCHAR(255) NOT NULL,
`order_id` VARCHAR(255) DEFAULT null,
`review_score` TINYINT DEFAULT null,
`review_comment_title` VARCHAR(255) DEFAULT null,
`review_comment_message` TEXT DEFAULT null,
`review_creation_date` DATETIME DEFAULT null,
`review_answer_timestamp` DATETIME DEFAULT null,
PRIMARY KEY (`review_id`)
);
CREATE TABLE `order_time` (
`order_id` VARCHAR(255) NOT NULL,
`customer_id` VARCHAR(255) DEFAULT null,
`y` INT DEFAULT null,
`q` INT DEFAULT null,
`m` INT DEFAULT null,
`d` DATE DEFAULT null,
`h` INT DEFAULT null,
`order_purchase_timestamp` DATETIME DEFAULT null
);
CREATE TABLE `orders` (
`order_id` VARCHAR(255) NOT NULL,
`customer_id` VARCHAR(255) DEFAULT null,
`order_status` VARCHAR(255) DEFAULT null,
`order_purchase_timestamp` DATETIME DEFAULT null,
`order_approved_at` DATETIME DEFAULT null,
`order_delivered_carrier_date` DATETIME DEFAULT null,
`order_delivered_customer_date` DATETIME DEFAULT null,
`order_estimated_delivery_date` DATETIME DEFAULT null,
PRIMARY KEY (`order_id`)
);
CREATE TABLE `product` (
`product_id` VARCHAR(255) NOT NULL,
`product_category_name` VARCHAR(255) DEFAULT null,
`product_name_lenght` INT DEFAULT null,
`product_description_lenght` INT DEFAULT null,
`product_photos_qty` INT DEFAULT null,
`product_weight_g` INT DEFAULT null,
`product_length_cm` INT DEFAULT null,
`product_height_cm` INT DEFAULT null,
`product_width_cm` INT DEFAULT null,
PRIMARY KEY (`product_id`)
);
CREATE TABLE `rfm` (
`customer_id` VARCHAR(255) DEFAULT null,
`user_type` VARCHAR(255) DEFAULT null,
`shijian` DATE DEFAULT null
);

CREATE view total_order_value as select  t.order_id,product_id,seller_id,(price*total)+(freight_value*total) as order_value  from (select order_id,count(*) as total  from item group by order_id) t join item on t.order_id=item.order_id;

CREATE view order_detail as select a.order_id,product_id,seller_id, customer_id,round(order_value,2) as order_value, y,q,m,d,h,order_purchase_timestamp from total_order_value a inner join order_time b on a.order_id=b.order_id;

Next, use the following SQL import statement to import the pre-prepared Demo data into the corresponding table of the MatrixOne database.

#Note

Please note that the path /root/data/table_name.csv is the path to the data file of each table. You can refer to this process to generate the data yourself.

use orders;
load data local infile '/root/data/category.csv' into table category FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";
load data local infile '/root/data/review.csv' into table review FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";
load data local infile '/root/data/product.csv' into table product FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";
load data local infile '/root/data/item.csv' into table item FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";
load data local infile '/root/data/order_time.csv' into table order_time FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";
load data local infile '/root/data/orders.csv' into table orders FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";
load data local infile '/root/data/rfm.csv' into table rfm FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\r\n";

2. Add data set

In FineBI, click Public Data , then click New Folder , create and select a folder, then click New Dataset , select the SQL dataset , and add the SQL query to the selected folder. Enter the dataset name and fill in the SQL query as follows:

select d,
count(order_id) as order_num,
count(DISTINCT customer_id)
from orders.order_detail
group by d
order by d

You can click the Preview button to view the results of the SQL query, then click OK to save:

Here is an example of all the query SQL used in this example:

-- 日活用户数及订单数
select d,
count(order_id) as order_num,
count(DISTINCT customer_id)
from orders.order_detail
group by d
order by d

-- 月活用户数及订单数
select count(DISTINCT customer_id),
count(order_id),
concat(y, '-', m)
from orders.order_detail
group by y,m
order by y,m

-- 各时段活跃用户数及订单数
select h,
count(DISTINCT customer_id),
count(order_id) order_num
from orders.order_detail
group by h
order by h

-- 各类型用户数量
SELECT count(*),
user_type
from orders.rfm
GROUP BY user_type

-- 月 GMV
select y,m,
sum(order_value),
concat(y, "-", m) month
from orders.order_detail
group by y,m
order by y,m

-- 季度 GMV
select y,q,
sum(order_value) gmv,
concat(y, "季度", q) as quator
from orders.order_detail
group by y,q
order by concat(y, "季度", q) asc

-- 季度 ARPU
select y,q,
round((sum(order_value)/count(DISTINCT customer_id)),2) arpu,
concat(y, "季度", q) as quator
from orders.order_detail
group by y,q
order by y,q

-- 月度 ARPU
select y,m,
round((sum(order_value)/count(DISTINCT customer_id)),2) arpu,
concat(y, "-", m) as month
from orders.order_detail
group by y,m
order by y,m

-- 重要挽留用户热门指数
SELECT e.product_category_name_english good_type,
SUM(a.order_value) ordder_total_value,
ROUND(AVG(c.review_score), 2) good_review_score,
(0.7*SUM(a.order_value)+

0.3*10000*ROUND(AVG(c.review_score), 7))
top_rank_rate
FROM orders.order_detail a
INNER JOIN
(SELECT customer_id
from orders.rfm
WHERE user_type='重要挽留用户' ) as b ON a.customer_id=b.customer_id
LEFT JOIN orders.review c ON a.order_id=c.order_id
LEFT JOIN orders.product d ON a.product_id=d.product_id
LEFT JOIN orders.category e ON d.product_category_name=e.product_category_name
where e.product_category_name_english is not NULL
GROUP BY e.product_category_name_english limit 50

-- 一般挽留用户热门指数
SELECT e.product_category_name_english good_type,
SUM(a.order_value) ordder_total_value,
ROUND(AVG(c.review_score), 2) good_review_score,
(0.7*SUM(a.order_value)+0.3*10000*ROUND(AVG(c.review_score), 7))
top_rank_rate
FROM orders.order_detail a
INNER JOIN
(SELECT customer_id from orders.rfm
WHERE user_type='一般挽留用户' ) as b ON a.customer_id=b.customer_id
LEFT JOIN orders.review c ON a.order_id=c.order_id
LEFT JOIN orders.product d ON a.product_id=d.product_id
LEFT JOIN orders.category e ON d.product_category_name=e.product_category_name
where e.product_category_name_english is not NULL
GROUP BY e.product_category_name_english limit 50

3. Update data

After saving the data set, you need to click the Update Data button and wait for the data to be updated before analysis can be performed:

4. Create analysis topics

The analysis theme of this example is used to visually display the e-commerce platform's general retained users, important retained users, monthly ARPU, quarterly ARPU, active users in different periods, daily active users, number of monthly active users, and number of orders to assist decision-making and Improve business. The specific steps to create an analysis topic are as follows:

  • Click My Analysis , then New Folder to create and select a folder.
  • Click New Analysis Topic , select the data set created in the previous step, and click OK .

#Note

You can use the bulk selection feature to select multiple datasets for thematic analysis.

Click the Add Component button, select the chart type, drag the fields on the left to the right as needed, double-click to modify the field visualization name, and modify the component name below. The component name is the report content analyzed by the component:

5. Assemble the dashboard

Click Add Dashboard to add the component you just created to the dashboard. You can freely drag and scale the size and position of the component, and modify the component name below to describe the report content analyzed by the component.

6. Publish the dashboard

After the assembly is completed, click Apply for Release and set the release name, release node and display platform. then click

Now, you can find the newly released dashboard under the homepage navigation and view its display effect.


About the origin of the matrix

Matrix Origin is an industry-leading big data and database management system (DBMS) technology and service provider. Its main team members come from well-known domestic and foreign technology companies and have strong innovation capabilities. Matrix Origin's goal is to create and use world-class data infrastructure technologies and products to assist enterprises in transforming and upgrading from informatization, digitalization to intelligence. Matrix Origin has core competitiveness in the fields related to cloud computing, databases, big data and artificial intelligence. It has a broad industry and international vision and foresight, and can quickly and effectively implement advanced technologies in different fields and expand them on a large scale.

About MatrixOne

MatrixOne's core product, MatrixOne, is a multi-mode database based on cloud native technology that can be deployed in both public and private clouds. This product uses an original technical architecture that separates storage and computing, separation of reading and writing, and separation of hot and cold. It can simultaneously support multiple loads such as transaction, analysis, flow, timing, and vector under a set of storage and computing systems, and can perform real-time and on-demand Isolated or shared storage and computing resources. MatrixOne can help users significantly simplify the increasingly complex IT architecture and provide minimalist, extremely flexible, cost-effective and high-performance data services.

MatrixOrigin official website: A new generation of hyper-converged heterogeneous open source database-MatrixOrigin (Shenzhen) Information Technology Co., Ltd. MatrixOne

Github 仓库:GitHub - matrixorigin/matrixone: Hyperconverged cloud-edge native database

Keywords: hyper-converged database, multi-mode database, cloud native database, domestic database.

Bilibili crashed twice, Tencent’s “3.29” first-level accident... Taking stock of the top ten downtime accidents in 2023 Vue 3.4 “Slam Dunk” released MySQL 5.7, Moqu, Li Tiaotiao… Taking stock of the “stop” in 2023 More” (open source) projects and websites look back on the IDE of 30 years ago: only TUI, bright background color... Vim 9.1 is released, dedicated to Bram Moolenaar, the father of Redis, "Rapid Review" LLM Programming: Omniscient and Omnipotent&& Stupid "Post-Open Source "The era has come: the license has expired and cannot serve the general public. China Unicom Broadband suddenly limited the upload speed, and a large number of users complained. Windows executives promised improvements: Make the Start Menu great again. Niklaus Wirth, the father of Pascal, passed away.
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/5472636/blog/10322294