Difference between revisions of "Reporting on ServiceNow Variables"

From Explore Analytics: The Wiki
Jump to navigation Jump to search
Line 63: Line 63:
 
Using variables in a Pivot works exactly the same as in a list. You select a "Variables" field, for example the Request Variables fields, and drag it to the desired pivot area. The settings dialog pops up and you type the name of the variable (e.g., "memory") into the Variable Name field. The following image shows the process.
 
Using variables in a Pivot works exactly the same as in a list. You select a "Variables" field, for example the Request Variables fields, and drag it to the desired pivot area. The settings dialog pops up and you type the name of the variable (e.g., "memory") into the Variable Name field. The following image shows the process.
  
===A useful tip===
+
[[File:requested_items_pivot.png]]
  
The functionality available in the list opens up many possibilities if you realize that you can save that list and then use it as a regular table in which you can filter, sort, pivot and chart all the list fields including the ones that were created from variables. There are a couple of ways to turn your list into a table in Explore Analytics.
+
==Using Variables in a Chart==
  
# You can export the view data (File | Export this view's data) into a CSV file. You can then turn around and upload this file and store it as a table in Explore Analytics.
+
You can use Variables in a chart anywhere you can use a table field. For example, you can use Variables such as "memory" as a category field to show the number of computer orders by the amount of memory requested by the user with the order.
# The track trend feature allows you to run a view and save its output into a table. You can simply create a track trend job that runs once.
+
 
 +
[[File:requested_items_chart.png]]
 +
 
 +
===Limitations with Variables in Pivot and Chart===
 +
 
 +
As with lists, you cannot filter using a variable. This also means that you can't drill-through to details or focus and drill down.
  
 
{{Template:TOC|Working with Lists|Pivot}}
 
{{Template:TOC|Working with Lists|Pivot}}

Revision as of 09:06, 22 January 2014

Introduction

This page applies to views using a ServiceNow data source.

Variables

ServiceNow has a special type of field called Variables. This field holds a set of names and values (questions and answers).

Variables are commonly used in the Service Catalog. When a user makes a service request such as requesting the purchase of a new computer, they fill a form in which they answer questions such as the amount of memory required and the size of the hard drive. These questions and answers are placed in variables.

Variables may also be used in tasks such as incidents and in workflow. The name of the variables field in all these ServiceNow tables is "variables".

The Challenge with Variables in Reporting

Variables are not like normal fields. They hold multiple names and values (questions and answers). To display several variables in columns of a list, you need to select "variables" multiple times, each time selecting another variable name (question).

Support for Variables in Explore Analytics

Explore Analytics supports variables in all view types: list, pivot, and chart. The following section shows an example of creating a list of Requested Items. We then see how to create a pivot and a chart.

Using Variables in a List

To see how to use variables in a list, let's see an example, and then show how to create it. This example shows requests for computers. For each request, we show four variables (the last four columns in the list):

  • Memory
  • CPU
  • Hard Drive
  • Operating System

Requested items.png

Step-by-Step: Adding a Variable to the List

Step 1: select the "variables" field

To add a variable to the list, drag the "Variables" field from the list of fields to the Selected Fields below. This is depicted in the following picture.

Variables1.png

The variables field may be a direct field of the table, or may be a field of a related table as shown in the next image.

Variables2.png

Step 2: select a variable name

After we drag the "Variables" field to the Selected Fields, the field settings dialog pops up. To display the amount of memory for the requested computer, we need to specify the variable name: "memory". We type that into the Variable Name field. A label (column heading) is automatically generated, but you can change it if you like.

Variables3.png

That's all it takes to show the memory variable as a column in our list.

Step 3: repeat for any additional variable name

We go back to step 1 and select "Variables" again. The settings dialog appears (step 2) and this time we'll enter the variable name "cpu_speed" and give it the label "CPU".

Variables4.png

Limitations

Currently, variables cannot be used in filters and therefore the options to "Show Matching" and "Exclude" are not available for those columns. Sorting is also not currently available for those columns.

Using Variables in a Pivot

Using variables in a Pivot works exactly the same as in a list. You select a "Variables" field, for example the Request Variables fields, and drag it to the desired pivot area. The settings dialog pops up and you type the name of the variable (e.g., "memory") into the Variable Name field. The following image shows the process.

Requested items pivot.png

Using Variables in a Chart

You can use Variables in a chart anywhere you can use a table field. For example, you can use Variables such as "memory" as a category field to show the number of computer orders by the amount of memory requested by the user with the order.

Requested items chart.png

Limitations with Variables in Pivot and Chart

As with lists, you cannot filter using a variable. This also means that you can't drill-through to details or focus and drill down.