<?xml version="1.0" encoding="UTF-8"?>
<!--Arbortext, Inc., 1988-2015, v.4002-->
<!DOCTYPE pubsConcept PUBLIC "-//PTC//DTD PUBS DITA Concept//EN"
 "pubsConcept.dtd">
<?Pub UDT template _font?>
<?Pub Inc?>
<pubsConcept id="_what_are_comp_expressions_78662" xml:lang="en"
xmlns:import="http://www.oberontech.com/import"
import:style="0_TopicSub"
import:map-object="2Heading_to_concept_in_conceptH1">
<title>Computed Expression Types</title>
<prolog>
<metadata><keywords>
<indexterm>computed expression<indexterm>types</indexterm></indexterm>
<indexterm>intra-item expression<indexterm>described</indexterm></indexterm>
<indexterm>aggregation expression<indexterm>described</indexterm></indexterm>
</keywords></metadata>
</prolog>
<pubsConbody>
<p>You can perform calculations in fields, charts, and reports by
creating two types of computed expressions: intra-item or inter-item.</p>
<section id="_what_are_comp_expressions_305483"
import:style="0_TopicSub2"><title>Intra-item Computed Expressions</title
><!--None of the "fields" mentioned in this topic are found in UI control checks. Format as codeph.--><p
>Intra-item computed expressions perform calculations between <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> fields in a single item, storing the result in a read-only computed
field. The computed field also stores the computed expression. For
example, you could create an intra-item expression that adds the values
of the <codeph import:style="GUI">QA Estimated Time</codeph> and <codeph
import:style="GUI">Development Estimated Time</codeph> fields in a
Feature item to produce a value in the <codeph import:style="GUI"
>Total Estimated Time</codeph> field (the computed field).</p><p>Computed
fields are created by administrators in the <ph
conref="../common/text_variables.dita#text_variables/ProdName06"></ph
>. To users, computed fields display as read-only fields in items;
however, administrators can configure the field visibility. Administrators
can also configure how and when computed fields calculate.</p><p>Intra-item
expressions can also retrieve information from an item using external
information functions. For example, the <codeph import:style="Literal"
>CPECount()</codeph> external information function counts the number
of change package entries in an item. External information functions
are useful for retrieving workflow data, for example, how long a Customer
Request item has been in a state of <codeph import:style="Literal"
>Submit</codeph>.</p><fig>
<image href="../images/computed_field1a.png"></image>
<lq translate="yes" xml:lang="en">The computed expression for a computed
field in the <ph
conref="../common/text_variables.dita#text_variables/ProdName06"></ph
> (left) and the computed field as it displays in the Item Details
view of an item (right).</lq>
</fig><p>Once you define an intra-item expression using external information
functions, you can use queries, charts, reports, and dashboards to
collect the metric data and report on it.</p></section>
<section id="_what_are_comp_expressions_305503"
import:style="0_TopicSub2"><title>Inter-item Computed Expressions</title
><p>Inter-item computed expressions (or aggregate computed expressions)
perform calculations against <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> fields in a list of <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> items. To do this, you create a computed expression using an aggregate
function, such as <codeph import:style="Literal">sum</codeph> or <codeph
import:style="Literal">average</codeph>. For example, you could create
an inter-item expression in a report that uses the <codeph
import:style="Literal">sum(field)</codeph> aggregate function to add
the <codeph import:style="GUI">Estimated Cost</codeph> field in a
list of Project items and produce a value in a new <codeph
import:style="GUI">Total Estimated Cost</codeph> field in the report.</p
><p>Aggregate expressions can be created in a chart or report by any
user in the <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> client or <ph
conref="../common/text_variables.dita#text_variables/ProdName06"></ph
>. Inter-item computed expressions are useful for generating aggregate
data from <ph
conref="../common/text_variables.dita#text_variables/ProdName01"></ph
> fields in a report or chart. </p><fig>
<p><image href="../images/aggregate_expression.png"></image></p>
<lq translate="yes" xml:lang="en">The aggregate expression in a chart’s
properties (left) and the results of the computation in the generated
chart (right). </lq>
</fig></section><?Pub Caret -2?>
</pubsConbody>
</pubsConcept>
