Add analytics

In the previous section, you created the first of three pagelets of your Overview dashboard. This section shows you how to create the second pagelet. This pagelet will display all the purchase orders that have been completed during the current day. 

1. Create a dashboard analytic for completed purchase orders

First, let's start by creating an analytic that will count the completed purchase orders. This procedure is very similar to the one for creating the Orders Received Today pagelet.

Make space for your pagelet on the dashboard

Start by splitting your dashboard to create enough space for all your pagelets.

Step Action
1

With your Overview dashboard in edit mode, click the Split horizontally icon. Your dashboard is now comprised of three pagelet areas.

2 Take a moment to resize the pagelets so that each one is 33% of the total width.

Configure the pagelet

Now, you can start configuring the pagelet. 

Step Action
1 In the middle pagelet, click Click here to configure the pagelet.
2  In the Enter title here text box, enter Orders Completed Today.
3 Select the Instance component.
4 Use Global as the instance dimension and select Global in the instance selection area.
5 In the Values area, click Add value.
6 Click the select an attribute hyperlink.
7 Click the Follow hyperlink for the 2order attribute.
8 As you have seen in the previous section, you now have the option to aggregate an attribute. Click the Aggregate hyperlink for the instance attribute.
9

Aside from the fact that you are aggregating rather than deriving, most of the screen options should look familiar. Can you follow down the sections and make the correct selections – at least until you come to the reference time link at the bottom of the page?

If you can, complete the fields yourself, then move straight to step 13. Otherwise, keep following the instructions.

10 In the Settings area, for Space, select OP Analysis.
11 For Compute, select Every 5 minutes.
12 In the Time range area, you want the pagelet to display all the purchase orders completed today. In the Current drop-down, select 1 day.
13 In the Time configuration area, click the at Reference time link.
14 In the 2Order tab, select the radio button for Retrieve occurrences of 2Order that end during Time Range.
15 On the left menu, click the instance tab under Attribute.
16 In the Dimension to correlate with drop-down, select GLOBAL 2Order ORDER.
17 Select the radio button for Retrieve instance when and in the drop-down, select the relation 2order is last available during the time range.
18 Click Done.
19

As you did with your Derived attribute, give this Aggregated attribute a meaningful name and description. An appropriate name might be Aggregate-Count-instance-order-ref2Global-end-time-range-current-day.

20 Click Save. You will see the same warning about computing. Click Yes.
21

From the Select an Attribute page, click the Select hyperlink for the attribute you just created. You are brought back to the Edit Value page.

22

Click Done to accept your new attribute. Decision Insight returns to the Orders Completed Today pagelet page.

23

Before you click Done, click the Instance representation to preview your results.

24

What do you see? What is the value for Orders Completed Today? Zero? Click Done for now.

Troubleshoot the pagelet

Don't click Save yet. Resolve the issue with the zero value first.To double-check your results, follow these steps.

Step Action
1

Set your time machine control to be after the last Payment Received event.

2

For this example, set your time control to December 01, 23:50; that is safely within the concept of "today" and after all events for the day.

3

Your Overview dashboard should now show a value of 4 for Orders Received Today (and that's correct). It will also show 0 for Orders Completed Today – and that is incorrect.

4

There is something wrong with the definition of your Aggregated attribute. Go back into edit mode for the incorrect pagelet and see if we can find the problem.

Explore: aggregation this time, not derivation

In the previous pagelet, you derived the count of instances of the relation between Global and Order.

Observed v Reverse Relations

Because you had started at the Global entity, it made sense to derive the count of instances of the reverse relation. To compute the value of the attribute for completed purchase orders, you will aggregate the count of observed relations. To do that, you need to first follow the reverse relation to Order and then "look" back at Global.

The selection you want to make will be the one that identifies instances of ref2Global that "complete" during the selected interval (hopefully you selected "current 1 day" as the interval when you had the chance). The visual hint will look like the one below. When you have that configuration, click on Done to go back to the aggregation page.

Yet Another Visual Hint

Reminder: Here is the data from your resource:

Timestamp,CustomerName,CustomerReference,CycleNumber

2016-12-01T15:24:14,Utensil Systems,9558RQ,16040022
2016-12-01T16:36:38,Springbok Space,ORDN051,16040023
2016-12-01T17:49:02,Triangle Technologies,1711,16040024

Question: What date and time should you pick to make sure you are looking at a time after the last order was completed?

Answer: There are many correct answers. The earliest setting you could use is December 01, 2016 at 17:50. The latest time you could use would be December 02, 00:00.

Wait.

Isn't December 2nd "tomorrow" for the events you injected?

Yes, and no.

In Decision Insight, you must tie the concepts of time and time machine to the concept of rhythms. Th information displayed on your dashboard is always refreshed at the conclusion of a rhythm, not during the span of said rhythm. Based on your 5-minute rhythm, this means that all the information that exists for display or computation after 23:55:00.000 is reported at the end of that cycle – 00:00:00.000, in other words. Remember to look at the end of a cycle to see your data.

2. Fix the analytic for counting completed purchase orders

The Derived attribute for new purchase orders looks like it is producing correct results. The Aggregated one for completed purchase orders does not. There is a reason, but it was easy to overlook.

Step Action
1

Your Overview dashboard should still be in edit mode. Click the pencil icon to edit the Orders Completed Today pagelet.

2

Click the box for your aggregated attribute in the Values section.


 

3 Click the pencil icon to edit your attribute.
4

One way to debug the erroneous result would be to walk through the settings on the Edit Attribute – Aggregate page.

In this tutorial, we can take a shortcut. The issue lies in the time configuration settings at the bottom of the screen. Click the that end during Time Range hyperlink.The Time Configuration screen is displayed.

In the Summary area, you can see that the second statement - 2orders when Time Range starts - does not seem to be the appropriate one to get the results we want.

The combination of the two statements instructs Decision Insight to aggregate the count of ref2Global that end during the time range for all instances of 2order that exist at the start of the time range.

How many of the purchase orders that completed on June 1 were active before midnight that same day? None of them, which is why the pagelet is displaying a count of zero. The value is correct for the settings, but it does not reflect what you want to see on your dashboard.

5

To change the selection for 2orders, on the left menu, click 2Orders.

6 Use the same time configuration settings as the ones you used for instance.
7

Click Done, Yes, then Done to complete the editing process for the Orders Completed Today pagelet.

If your Time machine controls are still set to the correct values, you should see a count of 3 for your count of orders completed today.

3. Add the count for active purchase orders

You now have pagelets that count both received and completed purchase orders. You must still add a count for purchase orders that have been received but are not completed yet. 

Step Action
1

While in edit mode for the Overview dashboard, click the Click here to configure the pagelet hyperlink for the right pagelet.

2 In the Enter title here text box, enter Orders In Process. Configure the pagelet to use Global and then add a value to the pagelet.
3 Select the Instance component.
4 From the available entities area, drag and drop Global to the instance dimensions area.
5 In the Instance selection area, select Global.
6 Click the Add value button. Use whatever method you choose for your value and save the changes to your pagelet and dashboard. If you're a bit lost, see Tips below.
7

Your dashboard should look like this:

 If it does, this task is complete.

Tips

Beyond deciding if your need to derive or aggregate the count (and the count of what it is you might be deriving or aggregating), what might be the correct time configuration?

That comes down to three different questions:

  1. Which time configuration makes the most sense for the count of orders currently being processed?
  2. Should you use derive or aggregate?
  3. Which attribute should you select?

Which leads to a follow-up question: how would you find out the answers?

As with many things with Decision Insight, the best answer is to explore and see what you find.

Here are some answers to the questions:

  1. First, the time configuration you want is going to be at time machine instant. This option selects any value that exists at the moment in time defined by the time machine configuration. 
  2. Next, if you explored you will have found that you can use either derive or aggregate, although one is more direct than the other. As far as which attribute to select, that depends on the method you want to use to calculate the value:
    • To derive the value, click the Derive hyperlink for 2orders. Select over interval and current 5 minutes in the time range section for the derive function. Modify the time configuration to correlate with Reference time. That method works but is a bit complicated.
    • To aggregate the value, follow the link for 2orders, then click the Aggregate hyperlink for the instance attribute. All the time references default to the correct values.

Either method produces the correct result, but the method to Follow 2orders and then Aggregate on instance is more direct.

Now you are ready to proceed to the next step.

Related Links