I am a data analyst (1): Fake husband mentions the need for automatic update of Excel data - Introduction to Quick BI novice

Abstract: Making reports based on Excel data is a very basic BI method, but my husband suddenly said last night that it would be great if Excel could automatically generate all the data he wanted every day. I was stunned and thought about it for a while, and it seemed to make sense... Looking back, Quick BI seemed to be fine, so I started to try it.

Author: violin Original link: https://zhuanlan.zhihu.com/p/23787228

Scenario Introduction

Last night, my husband suddenly said that it would be great if Excel could automatically generate all the data he wanted every day.

I was stunned for a moment, my husband was actually going to make a report, did I meet a fake husband! However, he seems to be quite reasonable. In the process of dealing with excel, you will inevitably encounter these problems:

1. Repeated operations

Finally , the data in excel has been analyzed and made into a report. After a few days, the same data will be updated. However, the report data will not be updated automatically, and you have to start again based on the new data;

2. Ability to spell code

If you don’t want to repeat the operation manually, you have to write VB macro definitions in Excel, or you can directly write the code, spelling But code.

Looking back, Quick BI seems to support local files for reporting, so I started to try it.

The scenario is as follows: There is an excel sales order table that is updated every week: company_sales_record, you need to check the daily order volume and sales amount by time, and look at the sales and profits of each province.

When the weekly sales order table data is updated, the report data also needs to be updated synchronously.

The implementation steps are roughly as follows:

1. Prepare data

I now have an excel sales order table that is updated weekly, so I save the excel as a .csv file in UTF-8 encoding (currently supports Excel, so this step can be omitted) and upload it to QuickBI.



Note: If the data source is changed to other databases such as Mysql, Sqlserver, etc., the following operation steps are similar and still apply.

2. Data modeling

2.1 Select the local csv file, and after the upload is successful, a dataset will be created automatically.



In this example, I need to create a new calculation field and convert characters such as provinces into geographic dimensions so that they can be displayed on the map , so I first click [Edit] to enter the data modeling interface.

Note: If you do not need to do the above processing, you can directly click [New Dashboard] and then [Analyze] to create a report interface.
2.2 To create a new calculation field,

I need to do some simple calculations on the fields in the csv file. For example, I need to calculate the average profit per order _ yuan, so I click "Edit" in the above figure, enter the data modeling, right-click to select [New Calculated Metric]





2.3 Convert provinces, cities, etc. into geographic latitude, as shown below:



2.4 Click OK to save the dataset

3. Create a dashboard

3.1 In the upper menu of the dataset modeling interface, click [New Dashboard] , you can go directly to the dashboard interface



3.2 Make a daily order sales trend chart

1) Select the data set you just saved: company_sales_record, configure the data source and the displayed dimensions and measures,

2) Select the order quantity and order amount, and click on the right In the side style, select dual Y-axis display,

3) In order to facilitate the query by date range, drag in the query control, and set the date control as a time interval. The chart display is shown in the following figure:


3.3 Order volume and profit distribution in each province and sales details in each province Data view

1) Drag in the bubble map and crosstab from the component bar on the left



2) Select the data source for both legends: company_sales_record, and configure the fields to be displayed

3) Set the linkage between the two legends

Select bubble map legend - configuration on the right "Advanced" - multi-graph association, select the corresponding fields displayed in the two legends respectively. Figure



4 below) If you want the above date control range to cover the sales and detailed data of each province, you can select the date control, and in the configuration box on the right, configure the scope of the date.

5) Save the dashboard. The effect is shown as follows: The order data in this csv file is as of 2016.12.24.



4. The dashboard is completed.

Click Preview to view the effect of the dashboard. After confirming that there is no problem, you can select public release to achieve free login.



5. There is one last question.

If I have an updated sales order table a week later, do I have to do the above operations again?

The answer is no.

Just make sure:

1) The updated sales order table: company_sales_record uses the same table name

2) The table field information remains unchanged

So how to operate?

1) Upload the updated order table company_sales_record file to the exploration space, the system will prompt whether to overwrite the original data, click overwrite



Note : csv currently only supports full data overwrite update, does not support automatic appending, the format is still: utf- 8 encoded csv files. 2) Refresh the dashboard made before: daily order sales summary, you can see that the data has changed automatically, and the updated data has been automatically displayed.



Yeah! Get it, you can also query according to the date to achieve linkage.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326337668&siteId=291194637