Single dimension ranked

In this use case, you want to display a table and simple bar visualization that shows the purchases and purchases revenue for product names over 2023.

Customer Journey Analytics

An example Single Dimension Ranked panel for the use case:

Customer Journey Analytics Single dimension ranked 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 daterange.
    2. Select product_name.
    3. Select sum purchase_revenue.
    4. Select sum purchases.

    You see an empty table displaying only the column headers for the selected element. For better visibility, enlarge the visualization.

  2. In the Filters pane:

    1. Select the daterange is (All) from Filters on this visual.
    2. Select Relative date as the Filter type.
    3. Define the filter to Show items when the value is in the last 1 calendar years.
    4. Select Apply filter.

    You see the table updated with the applied daterange filter.

  3. In the Visualization pane:

    1. Use CrossSize75 to remove daterange from Columns.
    2. Drag and drop Sum of purchases_revenue underneath Sum of purchases in Columns.
  4. On the Table visualization:

    1. Select Sum of purchase_revenue to sort the product names in descending purchase revenue order. Your Power BI Desktop should look like below.

    Power BI Desktop Use Case 5 Table status

  5. In the Filters pane:

    1. Select product_name is (All).
    2. Set Filter type to Top N.
    3. Define the filter to Show items Top 10 By value.
    4. Drag and drop purchase_revenue into By value Add data fields here.
    5. Select Apply filter.

    You see the table updated with values for purchase revenue in sync with the Freeform table visualization in Analysis Workspace.

  6. In the Visualizations pane:

    1. Select the Line and stacked column chart visualization.

    A line and stacked column chart visualization replaces the table while using the same data as the table.

  7. Drag and drop purchases onto Line y-axis in the Visualizations pane.

    The line and stacked column chart is updated. Your Power BI Desktop should look like below.

    Power BI Desktop Use Case 5 Graph

  8. On the Line and stacked column 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.

    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 - 31/12/2023. Select Apply and OK.

      Tableau Desktop Filter

    4. Drag and drop Product Name from the Tables list in the Data pane and drop the entry in the field next to Rows.

    5. Drag and drop Purchases 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(Purchases).

    6. Drag and drop Purchase Revenue from the Tables (Measure Names) list in the Data pane and drop the entry in the field next to Columns and left from SUM(Purchases). The value is automatically converted to SUM(Purchase Revenue).

    7. To order both charts in descending purchase revenue order, hover over the Purchase Revenue title and select the sort icon.

    8. To limit the number of entries in the charts, select SUM(Purchase Revenue) in Rows and from the drop-down menu select Filter.

    9. In the Filter [Purchase Revenue] dialog select Range of values and enter appropriate values. For example: 1,000,000 - 2,000,000. Select Apply and OK.

    10. To convert the two bar charts to a dual combination chart, select SUM(Purchases) in Rows and from the drop-down menu, select Dual Axis. The bar charts transform into a scatter plot.

    11. To modify the scatter plot to a bar chart:

      1. Select SUM(Purchases) in the Marks area and select Line from the drop-down menu.
      2. Select SUM(Purchase Revenue) in the Marks area and select Bar from the drop-down menu.

    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 Data.

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

  5. Ensure that the Data sheet is selected.

    1. Select Show me at the top right and select Text table (upper left top visualization) to modify the content of the two charts to a table.
    2. To order purchase revenue in descending order, hover over Purchase Revenue in the table and select SortOrderDown .
    3. Select Entire View from the Fit drop-down menu.

    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 Dashboard 1 view 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 ‣ Cc Data View section in the left rail, select Product Name.

  6. From the ‣ Custom Fields section in the left rail:

    1. Select Custom Measure from the + Add drop-down menu.

    2. In the Create custom measure dialog:

      1. Select Purchase Revenue from the Field to measure drop-down menu.
      2. Select Sum from the Measure type drop-down menu.
      3. Enter a custom field name for Name. For example: Purchase Revenue.
      4. Select the Field details tab.
      5. Select Decimals from the Format drop-down menu and ensure 0 is entered in Decimals.
        Looker custom metric field
      6. Select Save.
    3. Select Custom Measure once more from the + Add drop-down menu. In the Create custom measure dialog:

      1. Select Purchases from the Field to measure drop-down menu.
      2. Select Sum from the Measure type drop-down menu.
      3. Enter a custom field name for Name. For example: Sum of Purchases.
      4. Select the Field details tab.
      5. Select Decimals from the Format drop-down menu and ensure 0 is entered in Decimals.
      6. Select Save.
    4. Both fields are automatically added to the Data view.

  7. Select + Filter to add another Filters and to limit the data.

  8. In the Add Filter dialog, select ‣ Custom Fields, then Purchase Revenue.

  9. Make the appropriate selections and enter the proposed values, so the filter reads is between inclusive 1000000 AND 2000000.

  10. Select Run.

  11. Select ‣ Visualization to display the line visualization.

  12. Select Edit in Visualization to update the visualization. In the popup dialog:

    1. Select the Series tab.
    2. Scroll down to see Purchases and change the Type to Line.
    3. Select the Y tab.
    4. Drag Purchases from the **Left 1 ** container to where it reads Drag series here to create a new left axis. This action creates a Left 2 container.
      Looker visualization configuration
    5. Select CrossSize75 next to Edit to hide the popup dialog

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-none
    import seaborn as sns
    import matplotlib.pyplot as plt
    data = %sql SELECT product_name AS `Product Name`, SUM(purchase_revenue) AS `Purchase Revenue`, SUM(purchases) AS `Purchases` \
                FROM cc_data_view \
                WHERE daterange BETWEEN '2023-01-01' AND '2024-01-01' \
                GROUP BY 1 \
                LIMIT 10;
    df = data.DataFrame()
    df = df.groupby('Product Name', as_index=False).sum()
    plt.figure(figsize=(15, 3))
    sns.barplot(x='Purchase Revenue', y='Product Name', 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
    library(tidyr)
    
    ## Single dimension ranked
    df <- dv %>%
       filter(daterange >= "2023-01-01" & daterange < "2024-01-01") %>%
       group_by(product_name) %>%
       summarise(purchase_revenue = sum(purchase_revenue), purchases = sum(purchases)) %>%
       arrange(product_name, .by_group = FALSE)
    dfV <- df %>%
       head(5)
    ggplot(dfV, aes(x = purchase_revenue, y = product_name)) +
       geom_col(position = "dodge") +
       geom_text(aes(label = purchase_revenue), vjust = -0.5)
    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