Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{anchor:top}
{toc: class=contents}
h2. Overview
{styleclass: Class=topLink}[top|#top]{styleclass}
Calculated fields allow you to create basic calculations with the fields available in your report.  The
calculated field option will create new unique fields for your report.

{color:#C00000}*Note:*{color} a calculated field that you create in the report builder cannot be used across multiple reports.  It is unique to your report only.  If you create a set of calculated fields and you wish to use them across moremultiple thanreports one report you can either:
# Request the calculations to be included in the viewView by your administrator or
# Copy the template report containing the calculations using the copy functionsfunction - the copied report will contain the new calculated fields as well.

h3. Why Use Calculated Fields?
When an administrator designs youra reporting viewView they domay not have the capacity to create all the variables that you are likely to need in the course of your report writing.  The intention of a view is to provide you with sufficient fields for you to be able to write the report you need and to use some of these fields as the basis for more complex calculations.

Youh2. createSimple calculatedFormula
fields when you need to derive data from fields such as ratios or subtractions.  For example if you wish to know the ratio of outstanding invoice amounts.  For this you may need to divide the amount received with the amount invoiced.  

h2. Add a Calculated Field with the Formula Builder
{styleclass: Class=topLink}[top|#top]{styleclass}
# Click the Add calculated field link located at the bottom of the data fields panel{styleclass: Class=topLink}[top|#top]{styleclass}
Simple Formulas allow you to build calculations using the formula builder button interface. These may range from very simple addition or multiplication through to CASE statements.
# Click the *+* button at the bottom of the field list in the Data step of the report builder.
!01addCalc.png|thumbnail,border=1!
# AThe calculatedCalculated fieldField popupwindow will now open.  Insertappear. You will need to define the following:
## Provide a name for your new column. And use the formula builder to build your calculation formula in the *Calculated Field Name* box. This will be used as the field name in your table and/or chart output.  
## ChooseSelect a '*Simple* Formula' from the formula*Formula typeType* drop down list. 
## SelectUse the fields you want formula buttons and field drop down list to add components to theyour calculation. You Thecannot reporttype fields list shows you alldirectly into the fieldscalculation youarea haveof currentlythe addedwindow, toeach your report.  
## Usepart of the +-*/ () buttonsformula needs to addbe inadded theusing arithmetic calculationsbuttons. ## Yellowfin will not permit you to select combinations of variables that are incompatible - therefore options that are greyed out will become active as you add in elements.
# You can validate{color:#CC0000}*Note:*{color} if you wish to type your calculation you may need to determine whether it will work correctly.  Click the validation link to do this. use the [Freehand SQL|Calculations#Freehand SQL] option discussed later.
# Once finished click the *Validate* button to ensure your calculation is not missing any components. 
!02forumlaBuilder.png|thumbnail,border=1!
# Click OK*Save* to savecomplete your new calculated fieldcalculation.  It will now be available in a folder called calculated fields. at Youthe will have to dragbottom of the newfield fieldlist fromin the Calculated Fields folder onto your report.Data step.  
!03addToReport.png|thumbnail,border=1!
 

h2. Create a Calculation using a Predefined Formula
{styleclass: Class=topLink}[top|#top]{styleclass}
Using a pre-defined formula you can add calculation to your report that will be based on formula rules.  
# Click the Add calculated field link located at the bottom of the data fields panel.
# A calculated field popup will open.  Insert a name for your new column. And use the formula builder to build your calculation.  
## Choose a 'Pre-Defined Formula' from the formula type drop down.  
## Choose the formula you wish to apply - the selection is specific to the type of database that your data is sourced from.
## Once you have chosen your formula you will be prompted to select the appropriate fields for the formula.  
# You can validate your calculation to determine whether it will work correctly.  Click the validation link to do this.
# Click Save & Close to save your new calculated field.  It will now be available in a folder called calculated fields.  You will have to drag the new field from the Calculated Fields folder onto your report.

h2. Edit a Calculated Field
{styleclass: Class=topLink}[top|#top]{styleclass}
# To edit a formula for a calculated field open the Calculated Fields folder.
# Select the field you wish the edit.  It should be highlighted and an edit icon will be visible at the right of the field's name.
# Click the edit icon and the formula popup will open.
# Edit your formula and click OK when completed to close the popup and save your changes.

h2. Delete a Calculated Field
{styleclass: Class=topLink}[top|#top]{styleclass}
To delete a calculated field from your report entirely 
# Select the field from the calculated field category
# Click the edit icon and the formula popup will open
# Click the delete link to delete the field.  The popup will close and return you to the report page.

\\
\\
{horizontalrule}
{styleclass: Class=topLink}[top|#top]{styleclass}