Monthly trend

In this use case, you want to display a table and simple line visualization that shows a monthly trend of occurrence (events) for 2023.

Customer Journey Analytics

An example Monthly Trend panel for the use case:

Customer Journey Analytics Monthly Trend visualization

BI tools
note prerequisites
PREREQUISITES
Ensure you have validated a successful connection, can list data views, and use a data view for the BI tool for which you want to try out this use case.
tabs
Power BI Desktop
  1. In the Data pane:

    1. Select daterangemonth.
    2. Select sum occurrences.

    You see a table displaying the occurrences for the current month. For better visibility, enlarge the visualization.

  2. In the Filters pane:

    1. Select the daterangemonth is (All) from Filters on this visual.
    2. Select Advanced filtering as the Filter type.
    3. Define the filter to Show items when the value is on or after 1/1/2023 And is before 1/1/2024. You can use the calendar icon to pick and select dates.
    4. Select Apply filter.

    You see the table updated with the applied daterangemonth filter.

  3. In the Visualizations pane:

    1. Select the Line chart visualization.

    A line chart visualization replaces the table while using the same data as the table. Your Power BI Desktop should look like below.

    Power BI Desktop Use Case 2 Date range filter

  4. On the Line chart visualization:

    1. Select More .
    2. From the context menu, select Show as a table.

    The main view is updated to show both a line visualization and a table. Your Power BI Desktop should look like below.

    Power BI Desktop Use Case 2 Final Daily Trend visualization

Tableau Desktop
  1. Select the Sheet 1 tab at the bottom to switch from Data source. In the Sheet 1 view:

    1. Drag the Daterange entry from the Tables list in the Data pane and drop the entry onto the Filters shelf.

    2. In the Filters Field [Daterange] dialog, select Range of Dates and select Next >.

    3. In the Filter [Daterange] dialog, select Range of dates and specify a period of 01/01/2023 - 01/01/2024.

      Tableau Desktop Filter

    4. Drag and drop Daterangeday from the Tables list in the Data pane and drop the entry in the field next to Columns.

      • Select MONTH from the Daterangeday drop-down menu, so that the value is updated to MONTH(Daterangeday).
    5. Drag and drop Occurrences from the Tables (Measure Names) list in the Data pane and drop the entry in the field next to Rows. The value is automatically converted to SUM(Occurrences).

    6. Modify Standard to Entire View from the Fit drop-down menu in the toolbar.

      Your Tableau Desktop should look like below.

      Tableau Desktop Graph

  2. Select Duplicate from the Sheet 1 tab context menu to create a second sheet.

  3. Select Rename from the Sheet 1 tab context menu to rename the sheet to Graph.

  4. Select Rename from the Sheet 1 (2) tab context menu to rename the sheet to Data.

  5. Ensure that the Data sheet is selected. In the Data view:

    1. Select Show me at the top right and select Text table (upper left top visualization) to modify the content of the Data view to a table.

    2. Drag MONTH(Daterangeday) from Columns to Rows.

    3. Modify Standard to Entire View from the Fit drop-down menu in the toolbar.

      Your Tableau Desktop should look like below.

      Tableau Desktop Data

  6. Select New Dashboard tab button (at the bottom) to create a new Dashboard 1 view. In the Dashboard 1 view:

    1. Drag and drop the Graph sheet from the Sheets shelf onto the Dashboard 1 view that reads Drop sheets here.

    2. Drag and drop the Data sheet from the Sheets shelf below the Graph sheet onto the Dashboard 1 view.

    3. Select the Data sheet in the view and modify Entire View to Fix Width.

      Your Tableau Desktop should look like below.

      Tableau Desktop Dashboard 1

Looker
  1. In the Explore interface of Looker, ensure you do have a clean setup. If not, select Setting Remove fields and filters.

  2. Select + Filter underneath Filters.

  3. In the Add Filter dialog:

    1. Select ‣ Cc Data View
    2. From the list of fields, select ‣ Daterange Date then Daterange Date.
      Looker filter
  4. Specify the Cc Data View Daterange Date filter as is in range 2023/01/01 until (before) 2024/01/01.

  5. From the left Cc Data View rail,

    1. Select ‣ Daterangemonth Date, then Month from the list of DIMENSIONS.
    2. Select Count underneath MEASURES in the left rail (at the bottom).
  6. Select Run.

  7. Select ‣ Visualization to display the line visualization.

You should see a visualization and table similar as shown below.

Looker result daily trend

Jupyter Notebook
  1. Enter the following statements in a new cell.

    code language-python
    import seaborn as sns
    import matplotlib.pyplot as plt
    data = %sql SELECT daterangemonth AS Month, COUNT(*) AS Events \
                FROM cc_data_view \
                WHERE daterange BETWEEN '2023-01-01' AND '2024-01-01' \
                GROUP BY 1 \
                ORDER BY Month ASC
    df = data.DataFrame()
    df = df.groupby('Month', as_index=False).sum()
    plt.figure(figsize=(15, 3))
    sns.lineplot(x='Month', y='Events', data=df)
    plt.show()
    display(data)
    
  2. Execute the cell. You should see output similar to the screenshot below.

    Jupyter Notebook Results

RStudio
  1. Enter the following statements between ```{r} and ``` in a new chunk.

    code language-r
    ## Hourly Events
    df <- dv %>%
       filter(daterange >= "2023-01-01" & daterange < "2023-01-02") %>%
       group_by(daterangehour) %>%
       count() %>%
       arrange(daterangehour, .by_group = FALSE)
    ggplot(df, aes(x = daterangehour, y = n)) +
       geom_line(color = "#69b3a2") +
       ylab("Events") +
       xlab("Hour")
    print(df)
    
  2. Run the chunk. You should see output similar to the screenshot below.

    RStudio Results

recommendation-more-help
080e5213-7aa2-40d6-9dba-18945e892f79