15.08.2013 Views

Ektron CMS200/300 User Manual

Ektron CMS200/300 User Manual

Ektron CMS200/300 User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4. Continue replacing all variables in the formula.<br />

Notes<br />

Referencing Other Calculated Fields<br />

Explanation of Examples<br />

Using the Data Designer<br />

If an XML document contains several occurrences of a field<br />

that is referenced in a formula, the value is derived as follows:<br />

- When using the XPath functions sum() and count(), all<br />

values with the field name are considered. For example, a<br />

document includes three books whose prices are $10, $20<br />

and $30. In this case, sum’s value is $60.<br />

- When using all other functions, the first value is used. For<br />

example, a document includes three books whose prices<br />

are $10, $20 and $30. If a calculation formula refers to<br />

, its value is $10.<br />

You can replace a variable with a number instead of a field. For<br />

example, replace {X} * {Y} with ../price * 1.15.<br />

The expression can be complex, such as (round(Field1 * 0.80)<br />

+ (1 div Field2)) - 2.<br />

You can use a string expression that creates a text message.<br />

For example, to calculate a full name from its parts: concat(<br />

title, ' ', givenname, ' ', familyname), which could produce<br />

"Dr. Jonathan Smythe".<br />

A calculated field can only reference other calculated fields that<br />

appear before it in a document. For example, a document collects<br />

a series of numbers.<br />

One calculated field counts the number of numbers.<br />

Another totals their values.<br />

A third computes the average by dividing the total by the count.<br />

In this example, you must place the third field below or to the right<br />

of the first two fields. Calculated fields that are defined later in a<br />

document do not appear in the Select Field or Group dialog.<br />

The following table explains the standard examples that appear in<br />

the Examples drop-down list of the Calculated Field dialog. Note<br />

<strong>Ektron</strong> <strong>CMS200</strong>/<strong>300</strong> <strong>User</strong> <strong>Manual</strong>, Version 4.5, Revision 3 396

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!