Difference between revisions of "Formatting Categories and Values"

From Explore Analytics: The Wiki
Jump to navigation Jump to search
Line 85: Line 85:
 
<code>2 days 05:44:50</code>
 
<code>2 days 05:44:50</code>
  
{{Template:TOC|Pivot Drill Through to Details|Pivot Coloring Rules}}
+
{{Template:TOC|Pivot Coloring Rules|Visualization}}

Revision as of 12:14, 19 December 2016

Introductions

Explore Analytics automatically formats numbers, dates, duration values, and empty categories. I most cases, it means that a new report is immediately ready to be shared and published to your users.

In some cases, you may want some more control over the formatting of these values. This page provides a summary of the options that allow you to control the formatting.

Formatting Empty Categories

In a pivot or chart, empty categories are specified as [empty] or (empty). The value [empty] is used when the category value is empty and the value (empty) is used when the category value is not specified (a null value). There’s usually no semantic difference between the two. If you’d like to change how empty categories are displayed, use the Format button on the settings dialog for the category field.

Category field settings.png

When you click the format button, you’ll see the Category Format Options dialog

Category format.png

If you check the “Specify a label for empty value” you can then specify a new label to replace both [empty] and (empty).

Formatting Numbers

Explore Analytics automatically provides the appropriate formatter for integer, decimal, or percent value. In some cases, you may want to customize that format to show a percent or dollar sign, for example, or to control the number of digits after the decimal point. To customize the format of a numeric value, use the Format button on the field settings.

Numeric field settings.png

Clicking the Format button will display the Format Numeric Value dialog.

Number format.png

This dialog allows you to choose from predefined formats, or define a custom number format.

  • Default - let Explore Analytics select the appropriate formatter based on the type
  • Decimal – show the number with thousands separator (comma) and two decimal places
  • Integer – format the number as an integer, without a fractional part
  • Percent – display the number as a percent value by multiplying it by 100 and showing a percent sign
  • Duration – treat the number as a duration value and use the default duration formatter
  • Let me specify a custom format – allows you to specify a custom format. When selecting a custom format, you can enter formats based on the Java Decimal Format specifications.

Formatting Duration Values

Duration values are measured in seconds. For example, a value of 96,290 seconds translates to 1 day 2 hours 44 minutes and 50 seconds. By default, Explore Analytics will display this value as “1 day 02:44:50”.

Some data source, notably ServiceNow, have a duration data type. For other data sources you could still create duration values that are a result of a calculation. For example, when you subtract two dates to find the time duration between them.

When displaying duration as a value field in pivot or chart or as a list field, the Field Settings dialog will have a Format button.

Duration field settings.png

For a duration field, this will bring up the Duration Format dialog.

Duration format.png

D days HH:MM:SS

This is the default formatting for duration. With our example, it will display:

1 day 02:44:50

D days HH:MM

Similar to the default format, but without the second. The seconds will be rounded, so in our example, we’ll round up to the next minute and display:

1 day 02:45

D days H hours M minutes S seconds

This is the verbose format. To keep it relatively short, it will omit the seconds unless there duration is less than one minute. It will omit any leading zeroes and any part that’s zero. For our example it will display:

1 day 2 hours 45 minutes

HHH:MM:SS

Similar to the default format, but instead of showing days, it shows the total number of hours even if there are more than 24 hours. In our example, because 1 day and 2 hours is 26 hours it will display:

26:44:50

Hours per Day

When formatting duration, we normally consider every 24 hours to be one day. This is reasonable for elapsed time, but may not be correct if we’re measuring work. Because people typically work 8 hours per day, a duration of more than 8 hours could be considered to be more than one day. In our example, with 8 hours per day, 96,290 seconds would translate to:

3 days 02:44:50

Any with 10.5 hours per day:

2 days 05:44:50