Report tool comparison selection series use cases-process calculation

We know that the data presented in reports is often not directly retrieved from the database (source), but some calculations are required. Reporting tools usually provide certain calculation capabilities (such as filtering, grouping, etc.) to meet this demand . However, when the situation is complicated, the calculation on the report data set may take multiple steps to complete. At this time, it is necessary to examine the degree of support of the report tool for procedural calculation.

Use case description

Statistical requirements

List the major customers in the specified time period. The so-called big customer is defined as the customer whose sales account for the first half, that is, after the customer's sales are sorted from large to small, the total sales of the previous customers constitute half of the total sales, and these customers are called large customers.

Report style

imagepng

data structure

[Sales Record Sheet]

imagepng

Characteristic analysis:

The report format is very simple. The main trouble is that you need to calculate the large customers from the original data set before presenting it. This calculation is not a simple one-step process.

Our focus is to examine the process computing power of the reporting tool, so it is assumed that the computing power of SQL or data sources is not used to complete.

Run dry report

Production process:

1. Configure and connect to the data source.

2. Set up the data set

Runqian Report provides an independent calculation engine that can calculate data through built-in scripts and return the results to the report data set. Add a new data set to the report. The data set type uses the script data set. The script is as follows:

imagepng

2.1 Cell A1: The cell is connected to the data source, and then cell A6 closes the connection after execution.

2.2 A2: Take the numbers from the customer sales table, here are summarized according to customer names, and sorted in descending order of sales.

2.3 A3: Perform a summation operation on the sales amount and impose a 2, and take out half of the total amount for judging large customers. B3 set the initial value to 0, which is used for accumulating sales

2.4 A4: Accumulate the sales, and take out the serial number of A2 whose accumulated amount is greater than A3

2.5 A5: Take the corresponding value in A2 according to the serial number and return it to the report as a result set

3. Design report template

imagepng

The data returned in the script data set is the data information of the major customers, so it is quite simple to make the report. The settings are as follows:

3.1. Cells A2 and B2 directly take the data in the data set

3.2. Cells B3 and B4 directly use the data set summary function to count the number of large customers in the data set, and use the avg function to get the average sales for sales.

3.3. Set the border and amount display format.

Operation result :

imagepng

Review after completion

1. In 0.5 hours, using the built-in syntax in the script data set, the processing of a few cells can quickly meet the requirements.

2. Script data sets can be used, rich grammatical rules are built-in, and various complex data statistics requirements can be quickly processed.

3. The report design is simple, no auxiliary cells are needed, and the report calculation efficiency is high.

Fan soft report

Production process:

1. Configure and connect to the data source.

2. Set up the data set

Increase database query, SQL is: SELECT customer, sum (sales) sales FROM DEMO. Customer sales table group by customer order by sales desc

3. Design report template

imagepng

3.1 The B2 cell takes half of the total sales for judging major customers. The sales are summed in the cell, and a custom display formula is set up. If FanRuan summarizes the fields and then calculates, it cannot Manually add expressions directly in the cell, and you can only set custom display formulas.

3.2 Cells A3 and B3 access the customer and sales fields in the data set.

3.3 C3: Find the accumulated amount, =B3+C3[A3:-1], increase the condition attribute, and hide the data of non-large customers.

imagepng

3.4 B4: Number of large customers, =count(B3[!0;!0]{C3 <= B2 || (C3[A3:-1] <B2 && C3 >= B2)}), use count function to count cumulative sales More than the general amount of total sales.

3.5 Average sales, =sum(B3[!0;!0]{C3 <= B2 || (C3[A3:-1] <B2 && C3 >= B2)}) / B4, set cell format retention Two decimal places.

3.6 Hide the rows and columns that do not need to be displayed.

Report result

imagepng

Review after completion

1. It takes 1 hour.

2. The accumulation can be realized through the built-in level function LAYERTOTAL(B1, C1, D1), or through level coordinates. This example uses the level table method, which has rich built-in functions.

3. You can dynamically set the dynamic hiding of the report rows and columns according to the conditional formula.

4. It is necessary to add auxiliary cells, which will increase the consumption of additional resources, especially when the number of customers is large, all customer information is taken out in the report (the number of small customers is often much more), and then the judgment is hidden. Computing performance will have an impact.

Smartbi

Production process

1. Configure and connect to the data source.

2. Set up the data set

Using native SQL data sets, just fetch data directly through SQL statements:

select customer, sum (sales) amount from customer sales table group by customer order by amount desc.

3. Design report template

imagepng

The design of the report is completed in excel. With the help of rich excel functions, smartbi is not too troublesome to solve this kind of inter-cell calculation. Such as several key calculations:

3.1 D1: The total sales amount of all customers, the expression written in D2 = D1/2, which is half of the total sales.

3.2 D3 cell: cumulative amount, =***_GetCell(D3,B3,-1)+C3.

3.3 E3: =IF(***_GetSubCells(D3,B3)>D2,1+***_GetCell(E3,B3,-1),0), according to the cumulative amount, identify when the cumulative amount is greater than half of the total amount When the mark is 1, the cumulative value is still greater than half of the total amount, and the cumulative value is 2/3/4 (used to hide unnecessary data later), etc.

3.4 C4 cell: =MATCH(1,***_GetSubCells(E3,A3),0), according to the identification of E3, find the serial number of the first occurrence of 1, which is the number of large customers.

3.5 Grid C5: The average sales is relatively simple, =D4/C4, and set the data display format in the report

3.6 Hidden row settings, you need to hide the data of non-large customers, and do not support the definition of hidden expressions in the table. Here, the hidden expressions are hidden according to the E3 value greater than 1. You must use the platform to set macros for the spreadsheet (you need to write js code) to achieve:

imagepng

operation result

imagepng

Comments after completion:

1. Duration: 1.5 hours.

2. It is completely operated in excel, easy to use and convenient to operate. Excel has rich functions, and this report is mainly the use of its search functions.

3. When hiding customer data that is not needed (except for large customers), it does not support the definition of hidden expressions in the table, which requires js code to achieve, which is more difficult.

4. It is necessary to add auxiliary cells, which will increase the consumption of additional resources, especially when the number of customers is large, all customer information is taken out in the report (the number of small customers is often much more), and then the judgment is hidden. Computing performance will have an impact.

Yonghong BI

Production process:

1. Configure and connect to the data source.

2. Set up the data set

Use SQL statement data set: select customer, sum (sales) amount from customer sales table group by customer order by amount desc

3. Design report template

imagepng

3.1 The first column adds a number of access by sales. In fact, it is found that although the data set is sorted by sales, when the customer name field is directly taken out, even if it is not sorted, it will not be sorted according to the original data of the data set, so the front Added a sales field, and set descending sort.

3.2 The total sales and the corresponding cumulative sales are taken out in the fourth column, and the cumulative sales are directly dragged, and the calculation in the lower grid is not cumulative.

3.3 The cell for the number of large customers uses inter-cell calculation, and the expression inside is:

var a = 0;

for(var i=1;i<=ridx-1;i++){

if(cell(i,3)>=cell(0,3)/2){

a=i;

break;

}

}

Through the js grammar, loop through the rows and columns to determine whether the cumulative value is greater than half of the total sales, and return the corresponding number of rows, which is the quantity.

3.4 The same approach for average sales of major customers:

var a = 0;

for(var i=1;i<=ridx-2;i++){

if(cell(i,3)>=cell(0,3)/2){

a=cell(i,3)/i;

break;

}

}

3.5 The first and fourth columns are auxiliary columns, and there is a hidden column setting on the right to hide these two columns

3.6 Hidden row settings, Yonghong does not support cell hidden row expressions. If you want to hide non-large customer data, you need to implement it through js statements. You can get the row attributes of the report after calculation in js. According to the data obtained in 3.3 The number of customers dynamically set the row height of non-large customers (rows with row numbers exceeding the number of large customers after the report calculation) to 0 to achieve the hidden effect. This is similar to Smartbi, so I will not implement it here.

operation result

imagepng

Review after completion

1. It takes 2 hours, and the processing time of several cells between grids is longer, which tests the development ability.

2. JS grammar can be used to calculate data in grid calculations, which is suitable for developers to operate and is more flexible, but at the same time there are fewer built-in functions, which test the developer's ability.

3. The accumulation setting is more convenient, just use the built-in syntax directly.

4. There is a problem with the sorting setting. The sorting of the data is set in the data set, but the report will not be sorted in the corresponding order by default (or no method may be found).

5. Need to add auxiliary columns to achieve, such as cumulative columns, if the amount of data is too large to occupy additional memory space.

6. The hidden column can be set, but after setting, the design interface cannot see the column and cannot be restored. If the data set changes and the hidden column references the field before the change, it is difficult to change.

7. The need to add auxiliary cells will increase the consumption of additional resources, especially when the number of customers is large, all customer information is taken out in the report (the number of small customers is often much more), and then judged to hide, when the amount of data is large, the report Computing performance will have an impact. And when hiding non-large customer information, you need to write complex js, which is more difficult.

Billion letter

Production process

1. Configure and link the data source

2. Set up the data set

Just fetch the numbers directly through the SQL statement: The SQL statement is: select customer,sum(sales) as sales from sales group by customer order by sum(sales) desc

3. Design report template

imagepng

3.1 A1: =sum(TEST.sales)/2 Calculate half of the total sales amount of all customers, and set the hidden attribute in the right attribute

3.2 A3: =TEST.customer floating dimension field, and set the sorting basis on the right side is B3.

3.3 C3: =self.leftcell.value+self.upcell.value to realize the cumulative calculation of the amount

3.4 D3: =if(GRID1.C3.upcell.value<GRID1.A1,1,null) The data whose cumulative amount is greater than the value of A1 cell is marked as 1, and the unqualified mark is marked as null, which is convenient for subsequent statistics.

3.5 B4: =sum(GRID1.D3$), count the number of major customers based on the D3 logo (return 1 for medium and large customers in D3, and sum to 1 is the number of major customers)

3.6 B5: =GRID1.D3$.select(@.value=1).select(true,@.leftcell(2).value).avg() First use the array method to filter out the corresponding data, and then perform the search Average calculation

3.7 Select the third row and set the display expression as: <#=if(GRID1.D3=1,1,0)#>, cell D3 identifies whether this piece of data is a major customer, here is controlled based on the value of cell D3 Whether the line is displayed (if it is 1, return 1 to indicate display, otherwise return 0 to not display)

operation result

imagepng

Comments after completion:

1. Production time: 1.5 hours

2. The built-in functions are relatively rich, and the common operations in this table are basically implemented through built-in functions.

3. It is more convenient to dynamically set the dynamic hiding of the report row and column according to the conditional formula.

4. It is necessary to add auxiliary cells, which will increase the consumption of additional resources, especially when the number of customers is large, all customer information is taken out in the report (the number of small customers is often much more), and then the judgment is hidden. Computing performance will have an impact.

to sum up

  1. The report result format of this example is relatively simple, and all report tools can basically be realized.

  2. For the process calculations examined in this example, the implementation methods of Fanruan, Smartbi, Yonghong, and Yixin are basically the same. They all use auxiliary ranks to extract the total sales and cumulative sales, and then perform data judgments to determine which customers It is a big customer and counts the data, and finally hides the auxiliary ranks. The whole process has a certain degree of difficulty and cumbersomeness. This is because the report can only perform state-based calculations, and it can only take this roundabout way to process calculations.

  3. Among these products, Fanruan, Smartbi, and Yixin are basically the same. They are all implemented using built-in functions or methods, and it is more convenient to hide the ranks. Yonghong is easy to implement and can be set directly with the mouse. However, it is necessary to write complex javascript grammar for statistics when doing data statistics. This is more difficult to implement, and it is not convenient to hide rows and columns. The complex report function of Yonghong is weaker than the other three models, and Fanruan is relatively better in these four models, which is also consistent with the conclusions of other cases tested before.

  4. Run-drying can actually be achieved by using hidden grid methods, but here we provide a different approach. Runqian adds a calculation layer, using script data sets, can more easily achieve procedural calculations, return to the report is the processed data results, no special processing in the report, the overall process is simpler and consumes resources Much less than using auxiliary grids, the performance will be better. It is still consistent with the conclusions of the previous test cases. Runqian is the product with the strongest computing power among these products. The computing layer has clearly opened the gap with other products, which is essential for the efficient development of complex reports.

Further example

Let's look at the meaning of the calculation layer through an example, and query the longest consecutive days of rising stocks:

imagepng

The data source is a text that records the daily closing price of each stock:

imagepng

The style of this report is also very simple, but the calculation process is more cumbersome: you need to group the data set filtered by date by stock code, and then calculate the number of consecutive days that each group of stocks have risen, and then filter out more than 5 days stock.

This kind of complicated process, without the assistance of the calculation layer, using hidden lattices is a very troublesome process, which is roughly described as follows:

1. Take out the text data set and put it into the cell

2. Set the sort, sort by stock code and date

3. Group by stock code to make a two-level report

4. Add an auxiliary grid in the detail row to calculate the number of consecutive rising days

5. Calculate the maximum consecutive rise days in the grouping row

6. Hide the detail line

7. Hide non-specified dates and groups that do not meet the conditions.

This process is just cumbersome for FanRuan, a reporting tool with strong inter-grid computing capabilities; Smartbi, Yonghong and Yixin are not just cumbersome problems, and the intermediate calculations are also difficult to express. Moreover, no matter which tool it is, it will cause the entire report to be bloated, with a large number of hidden grids (far more than the grids presented).

To avoid this, the actual method often uses a custom data source, reads the data in Java to calculate the result set, or imports the data into the database to use SQL to calculate. Either way, it is still very cumbersome and seriously affects development efficiency.

However, if there is a calculation layer that can be interpreted and executed like the run-dry report, it will be very simple, and it does not require a few lines of code to implement this logic:

A1 :=file("F:/Stock Information.txt").import@t().select(left(string(Date),7)==rq), read the data in the stock information, and according to the report The incoming rq parameter is used for data filtering, and data of a certain month is taken

A2: =A1.sort(Date).group(SID), sort by date, and group by SID field

A3:, go=A2.new(SID, ~.group@i(Closing>Closing\[-1\]).max(~.len()):ts)Closing[-1] takes the closing price of the previous record in the current record. In A3, the maximum number of consecutive rising days is based on the same stock's closing price of the day being greater than the previous day's closing price.

A4: return A3.select(ts>=5), take out the data in A3 with the largest number of consecutive rising days greater than 5, and return it to the report data set for use.

Since the data has been processed in the script data set, the preparation of the report is quite simple, and there is no need for specific explanation.

The final conclusion of the complex report

We used three articles to compare these five reporting tools with complex reporting capabilities as a promotional point:
Report tool comparison and selection series of use cases-multi-source fragmented reports

Report tool comparison selection series use cases-ranking and cross-bank group statistics The
overall conclusion is as follows:

  1. The advantages of Runqian are very obvious. Even without considering its unique computing layer, its complex reporting capabilities are the strongest among these five products. Coupled with the computing layer, it can be said that it is far ahead, and it is already out of grade compared with several other products.

  2. FanRuan takes the second place. If you put aside Runqian’s unique calculation layer, FanRuan’s complex reporting capabilities will still be weaker than RunQian’s, but the difference is not too great. In addition, FanRuan’s friendly interface can add points. It is considered that Runqian and Fanruan are the first products, and it is worthy of the name to use complex reports as promotional points.

  3. Smartbi is weaker, the model is basically realized, but the expression details are quite different from the softness of Runganfan, which can be regarded as a second-grade product. Using complex reports as a promotional point is still barely justified in the BI field.

  4. Strictly speaking, Yonghong and Yixin's complex reporting capabilities are still in the introductory stage, and the gap with other products is very large. It can only be counted as the third grade or even undocumented products. In fact, these two products are originally BI products with strong colors. It is a bit of a misnomer to use complex reports as promotional points.


Guess you like

Origin blog.51cto.com/12749034/2536324