Purpose: to query the registered users through which the system registers. What are the numbers of different channels?
The metric value used is to convert a user dimension table to a fact table.
Three report parameters are received. The start time, end time, and agent.
The OLAP query results are as follows:
The expected results are as follows.
Step.
Get
This is obviously not what we want. Therefore, the group adds the group header or the group end based on the selected
In fact, we only need to draw the line of the Red Line. Because we only need the summary After grouping, we get
Set it to distinctcount aggregation. The result is.
Let's take a look at the picture on the left. We just deleted the detailed information under the row group. what is left is the end of the summary row grouped by the row group ~! You can also right-click (details) and select Delete.
OK. We have achieved initial results. Now we need to add a column group.
Delete the rightmost column. Right-click or left-click the cell in the gray box to ensure that the cell is selected. Then, drag the year, month, and day dimensions into the group.
See the figure below.
The result is.
OK. Now we add the drill-by-level function to the column.
Right-click "calendardate", select attributes, and select "hide" for "visibility". Select "and set" display "for" calendarmonth1 ". The calendar month line is also set.
The result is as follows:
This ...... Obviously not the result we wanted. We got it wrong. We just selected the text box attribute. The fact is that the text box of Month and year is missing.
We should click the group attribute of the column group here and set it here.
Preview. The expected result is displayed. modify.
Next, let's talk about an important topic. What is the difference between selecting these two cells.
That is. The Count of countdistinct (userid) below. It belongs to the column group and belongs to the row group. It is divided by two groups. The one above is outside the row group. It only belongs to the column group.
And.
Okay. Today's course is here.