Administrator Guide 2017
Item Type - Calculated value
From Add Item in Template Maintenance select the Calculated Value button shown here.

From Add Item in Template Maintenance select the Calculated Value button shown here.

The Calculated value item allows the results of simple calculations to be displayed. These are often arithmetical calculations (eg. adding the values of two other items together) but they can also be used to fill in text values. Numerical calculations can relate to whole numbers, to decimals, to times or to financial values.

Main

Main screen for creating/amending a Calculated value
Main screen for creating/amending a Calculated value

Main screen for creating/amending a Calculated value

*Question This is the text “label” that is specifying the information that needs to be entered or the question to be answered. Although this is not necessarily a question in all cases, Question is used as the general term to cover the text shown next to an input field. The text should be as short as possible whilst still being self-explanatory. Over-long questions take up a lot of space on PDA screens with their restricted size, so try and make them concise. This text should be an aid to help guide the user through the screen. Any more explanatory text can be made available as “Auditor’s notes” or “Full question text”.
Calculation Specify the calculation to be performed using this field. To refer to the value of another item in the document use the unique name of the item (this is a scenario where default unique names generated by the system are usefully replaced by something more user-friendly). Types of calculations:
  • Total score – if you leave the calculation field empty then the calculation will act as a “total score” for any drop-down list/multiple choice items which have associated numeric values or scores. For example, you may have a set of questions with drop-down list values and these values may have numeric scores associated with them.
  • Arithmetic (2 values) - the calculation syntax is

    [unique name of item 1][space][operator][space][unique name of item 2]

    where operators are: + (for addition), - (for subtraction), * (for multiplication) and “/” (for division).

    For example:

    Risk_Weighting * Hazard_Value

    InsideScore + OutsideScore
  • Lookup – this calculation is used to display a numeric result associated with another item on the form. Use @uniquename where uniquename is replaced by the actual “unique name” of the item whose result you wish to display. When looking up values from table items or repeating sections you can also use the syntax:

    @[unique name of table]:sum([unique name of column])

    to add up all the values in the column identified by the unique name.
  • Lookup header – this calculation allows you to display general form information (customer, location, date) and sequence numbers. Multiple pieces of information can be displayed together. To specify the information to display use the syntax

    $[form information]($[form information]$[form information]...)

    where form information can be
    • : followed by the text to be displayed (no quotes required)
    • seq: followed by a sequence name to display the next sequence number for the sequence in question. Any unknown sequence names are created before the form is first displayed and user may specify an initial value. For more information see how-to guide.
    • customer – the customer name
    • location – the location name
    • address – the address of the location
    • date – the date of the form
    • timestamp – the current date in YYYYMMDD form
    • time – the current time in HH:MM form
    • user – the username of the logged on user
    For example

    $:Call out to $location will produce "Call out to Bridlington Depot"
    $user$seq:thisDevice:1000:1 gives Bob1001 for this user's first form, Bob1002 for their second, Bob1003 for their third, etc
Result format Chose between Whole Number (integer), Time (hours:minutes), Decimal (2 places) or Financial (2 decimal places)

Formatting

Format the calculated value

Additional display class

Display class changes the way that template items are displayed.  For more information look at the Display Classes how-to guide.

Advanced

Advanced features of a Calculated value.
Advanced features that can be applied to a Calculated value.

Advanced features that can be applied to a Calculated value.

Currency symbol The currency symbol to be displayed with calculations of type “lookup”. If a lookup result is numeric and a currency symbol is specified, the result will be divided by 100 and displayed as a currency value.
Allow sequence numbers to be reset Tick this box to allow sequential numbers to be reset - leave unticked if you wish them to be locked.
Text for reset option If the box above has been ticked, this text will appear on the device with a link to the reset page. It is usually used for job numbers and can be adjusted so that the number appears on 1 line.

Auditor's notes

If you wish to offer the end-user guidance and direction on how to answer a question then use the Auditor’s notes field. This allows you to input any necessary text expanding on the basic question. For the end-user, the auditor’s notes are available via the “right click” option on the device – tap and hold the stylus on the question text.

Full question (for report)

The question text mentioned above should be framed in such a way as to indicate to the user the information that needs to be input. However, when this information is output on a report via the web site or a PDF additional wording may well be required. Use this field to phrase the original question in a way suitable for the report.

Cross reference

This field is output on reports to cross-reference the information with any relevant legislation etc.

Don't keep previous result when part of a document lifecycle

Tick this box if you DO NOT wish data to be collected in this template item to be copied to any jobs created directly from the original form.  This is useful for a repeated task (such as booking in/out a rental item or repeated delivery) where the data remains the same but a sign-off is required so this box may be ticked for Date, Surname and Signature.  Please note that if a transformation option is applied to the newly created job, this setting may be over-ruled.

Item flag

Template item flags are used to apply display classes to template item in a consistent and efficient way.  They are set up in a system list called Template item flags and might be given names such as Danger so the text appears in red, Disclaimer for smaller text, Long answer to give extra space to the answer.  This means that changing the display class can be done in one place rather than on all template items.

*Unique name

A unique name must exist for everything in a magic5 template.  It is so important that magic5 pre-fills the prompt with a non-meaningful name which it will use by default.  This does not need to be changed.

However, if the data associated with the unique name is to be used elsewhere (for example as part of a calculation, imported or exported, or carried over to a new job), it is helpful to use a meaningful name (such as RefNo, QuantityOrdered, ItemTotal, ContactName, ReasonForReferral) and this meaningful name must be entered before the template is used with real data.

If the unique name is changed at a later date, existing data will not be lost but it may no longer be accessible by magic5, in which case it cannot be displayed, used in calculations or exported.  It is therefore recommended that this is done only as a last resort and that the original template is duplicated before changes are made - this means that existing data can still be retrieved if necessary.  If in any doubt, please contact magic5 support for the best way to deal with this.

Display conditions (advanced)

Display conditions for a template item.
Display conditions that can be applied to a template item.

Display conditions that can be applied to a template item.

Only show when the following condition is true (1)-(4) Enter a conditional statement that affects whether the input item is displayed on the device such as whether a previous answer has been yes or no.
For more help on using Display Conditions view the how-to guide.
Record results when section isn't displayed Tick this box if you wish results to be recorded when section isn't displayed.