On this page:

Visualization and Aggregation

Visualization is the ability within a the results of an instruction to view the data as a chart of some type, or types, in addition to the standard tables that would normally be returned. And we will now create visualizations of our own.
There are a number of options for Visualization, Line, pie, bar charts, and if you have used Tachyon you may already have seen these on some product packs.
Be aware this is not Excel so it is not possible to colour individual sections of the pie chart, or drill down into the data.
We will obtain some basic tabular data in TIMs and then create a visualization and upload to Tachyon and run the instruction and view the results. We will also look at device-centric aggregating instructions and create an example of this too.

Vizualization

Create the Basic Tabular Data

1ETRNW73
  1. If TIMS is not already open, launch it from the desktop, otherwise clear any current queries
  2. In the Instruction window, enter and run the following query:
  3. @Updates = OperatingSystem.GetInstalledUpdates();
    Select Substr(Title, Instr(Title, "KB"), 9) as KB from @Updates;
  4. Here we have selected all updates installed on the OS, into the table @Updates, and then carried out a Substr on title to just return the KB number, and displayed the output. as a single column.

Create the Aggregation


    We need to do two things within TIMS to support visualisation
    1. Define aggregation for the data
    2. Define a visualisation template to be used
  1. In TIMS Click Schema from the menu bar and accept the suggested schema (we have to create a schema prior to Aggregating) close the window
  2. Now Click Aggregation from the menu bar and open the Aggregation screen
  3. Check the Enable aggregation of response data for this instruction definition checkbox
  4. In the Aggregation Operation Section on the right of the screen, select Count as the Operation, and enter NoOfInstalls as the Name, click Add
  5. Highlight KB and click Group By when it enables. Click OK to close the screen, the aggregation has now been saved
  6. Note that for the data set in question this does not affect the rows returned, for visualization to work, you must define aggregation criteria.

Create the Response Template


  1. Now Click Templates from the menu bar and open the Response Template Editor
  2. Enter the following code:
  3. {
      "Name": "default",
      "TemplateConfigurations": [
        {
          "Id": "column1",
          "Title": "How many Patch Installs",
          "Type": "Column",
          "X": "KB",
          "Y": "NoOfInstalls",
          "PostProcessor": "processingFunction",
          "Size": 1,
          "Row": 1
        }
      ],
      "PostProcessors": [
        {
          "Name": "processingFunction",
          "Function": "ProcessSingleSeries('KB', 'NoOfInstalls', '15', 'NoOfInstalls', 'false')"
        }
      ]
    }


    The configuration entries are:

    Requires a name – this is not specifically used but is required
    Takes an array of template configurations (i.e what’s inside the first set of square brackets).
    Each template configuration entry is one graph. You can have multiple graphs based on the same data set

    Template configuration entries:-

    • Id – required but not specifically used (we specified ‘column1’ here)
    • Title – the displayed title for the graph
    • Type – graph type (can be Pie, SmartBar, Line, Bar, Column, Area or StackedArea)
    • X – the result column which will be used as the graph X (horizontal) axis – in this case, KB
    • Y – the result column which will be used as the graph Y (vertical) axis – in this case No of Installs
    • PostProcessor – the name of the processing function which will be used to process the dataset.
    • Size – the relative size of the graph in terms of ‘horizontal slots’. Graphs are flowed in tabular style
    • Row – the row on which the graph is to be displayed

    The PostProcessors function has the following arguments:

    • Column to use as X axis – in this case we chose ‘KB’, Note can be any datatype
    • Column to use as Y axis – in this case, NoOfInstalls. Note: must be numeric
    • Number of entries – we set ‘15’. Number of entries. If this number is positive TOP entries will be selected. If this number is negative BOTTOM entries will be selected. Results will be sorted in descending order if the value of that parameter is positive and sorted in ascending order when the value is negative.
    • Name of the series – we chose ‘NoOfInstalls’
    • OPTIONAL: Flag indicating whether ‘other’ results will be included, if true they are put into a data point called ‘Others’, default value is true
    We now need to save and upload the instruction, we cannot view the results of the Visualization in TIMs
  4. In the Instruction Definition panel enter the following:
  5. Description: Installed Updates by KB
    Name: 1ETRN-InstalledUpdatesbyKB
    ReadablePayload: Installed Updates by KB
  6. Click SaveAs and save the instruction as: c:\tools\1ETRN-InstalledUpdatesbyKB.xml
  7. Copy the xml to the ConfigMgr Content folder, the shortcut is on the desktop

Uploading the Instruction

1ETRNAP

  1. Log into 1ETRNAP as 1ETRN\AppInstaller
  2. Launch the ConfigMgr Content Source shortcut from the desktop
  3. Copy the 1ETRN-InstalledUpdatesbyKB.xml and paste it into C:\Temp
  4. If not already running, navigate to HTTPS://Tachyon.1ETRN.local/Tachyon to open the Tachyon Portal.
  5. Navigate to the Settings Application
  6. Navigate to Instructions-> Instruction sets
  7. Click Upload and select C:\Temp\1ETRN-InstalledUpdatesbyKB.xml
  8. Ensure that the Instruction is uploaded successfully.
  9. Select the Unassigned Instruction Set and check the box next to the Installed Updates by KB in the middle pane and click Move
  10. Drop down to the 1ETRN Instruction Set and click Move

Run the Instruction

1ETRNW71
  1. Navigate to the Explorer Application from the Tachyon Portal or use the Switch app menu
  2. Type the word Installed in the I want to know box and select the Installed Updates by KB Instruction
  3. Click Ask this question
  4. Wait for the results to return. The Chart View is the selected option here. We have a table displayed of the results (it may be necessary to switch between table and chart view)

Aggregation

Device Centric Aggregating Instructions

This is a common scenario, we want to create an aggregating query that returns the device results, but we want to see the results aggregated at the device level, and be able to drill down in Tachyon. This is where aggregation really comes into its own and is quite a separate feature from visualization.


1ETRNW73

  1. If TIMS is not already open, launch it from the desktop, otherwise clear any current queries
  2. In the Instruction window, enter and run the following query:
  3. @host = NativeServices.RunCommand(CommandLine: "hostname");
    @Updates = OperatingSystem.GetInstalledUpdates();
    SELECT (SELECT output FROM @host) Device, Substr(Title, Instr(Title, "KB"), 9) as KB, Title, InstallDate FROM @Updates;
    Here we have selected the host name in to the @host table, and all updates installed on the OS, into the table @Updates, carried out a Substr on title to return the KB number, and displayed the output. using a sub query (this should be familiar from the SCALE - The Relational Model exercise)

Create the Aggregation


  1. In TIMS Click Schema from the menu bar and accept the suggested schema (we have to create a schema prior to Aggregating) close the window
  2. Now Click Aggregation from the menu bar and open the Aggregation screen
  3. Check the Enable aggregation of response data for this instruction definition checkbox
  4. Highlight Device and click Group By when it enables.
  5. In the Aggregation Operation Section on the right of the screen, select Count as the Operation, and enter NoOfInstalls as the Name, click Add. Click OK to close the screen, the aggregation has now been saved
  6. Note that for the data set in question this does not affect the rows returned, for visualization to work, you must define aggregation criteria.
    We now need to save and upload the instruction, we cannot view the results of the Visualization in TIMs
  7. In the Instruction Definition panel enter the following:
  8. Description: Installed Updates by Device
    Name: 1ETRN-InstalledUpdatesbyDevice
    ReadablePayload: Installed Updates by Device
  9. Click SaveAs and save the instruction as: c:\tools\1ETRN-InstalledUpdatesbyDevice.xml
  10. Copy the xml to the ConfigMgr Content folder, the shortcut is on the desktop

Uploading the Instruction

1ETRNAP

  1. Log into 1ETRNAP as 1ETRN\AppInstaller
  2. Launch the ConfigMgr Content Source shortcut from the desktop
  3. Copy the 1ETRN-InstalledUpdatesbyDevice.xml and paste it into C:\Temp
  4. If not already running, navigate to HTTPS://Tachyon.1ETRN.local/Tachyon to open the Tachyon Portal.
  5. Navigate to the Settings Application
  6. Navigate to Instructions-> Instruction sets
  7. Click Upload and select C:\Temp\1ETRN-InstalledUpdatesbyDevice.xml
  8. Ensure that the Instruction is uploaded successfully.
  9. Select the Unassigned Instruction Set and check the box next to the Installed Updates by Device in the middle pane and click Move
  10. Drop down to the 1ETRN Instruction Set and click Move

Run the Instruction

1ETRNW71

  1. Navigate to the Explorer Application from the Tachyon Portal or use the Switch app menu
  2. Type the word Installed in the I want to know box and select the Installed Updates by KB Device
  3. Click Ask this question
  4. Wait for the results to return. The Aggregated table view is shown, click on a Device and the raw data for the machine is displayed
Lab Summary

In this lab, we learned to create our own Visualizations, and to configure an Aggregation and create a response template and upload the instruction in Tachyon. We then created a Device Centric aggregation and uploaded and ran that in Tachyon, you should now have an understanding of how to create your own depending on your own requirements, the documentation for all of the functionality of Tachyon is available on help.1e.com