WinSPC Knowledgebase Home | Glossary | Favorites | Contact | Login WinSPC Knowledgebase Home | Glossary | Favorites | Contact | Login
Search the WinSPC Knowledgebase Browse by Category
How do I use the Expression Calculator component in the Report Designer (RAVE)?
Article Details

Last Updated
11th of October, 2010

Applies to
WinSPC 8.0

The Expression Calculator component can be used to perform calculations on one or more data fields from a DataView.  This report designer component is not a visible component (meaning it will not show up in the designer, but will show up in the object tree on the right side of the report template designer).

For example, you might want to calculate the difference between the USL and LSL of a list of variables.  The Expression Calculator component will help you do this.  The report might look something like this:

expcalcexample2.png


To create this report:
  1. Create a new Report Template (choose the 'Banded Portrait' master template).
  2. Edit the report template and launch the report designer by clicking on the 'Run Report Designer' button.
  3. Select the 'ReportDataBand' in the design window and set the following properties:
    1. DataView : Variable_ (since this is where the specification information is located).
  4. Add a 'DataText' component (from the 'Report' tab) to the 'ReportDataBand' (for aesthetics purposes to display the variable name), and set the following properties:
    1. DataView : Variable_
    2. DataField : Name
  5. Create a new parameter to hold the result of the calculation.  To do this:
    1. Select one of the top level components in the 'Report Library' tree on the right side of the screen.  For example, select the page ('Page1'). 
    2. On the left side of the screen, select the 'Parameters' property, and open up the editor dialog by clicking on the '...' button.
    3. Add the desired parameter name.  In this case, enter the text 'MyCalcResult' (without the single quotes) and press 'Enter'.
    4. mycalcresult.png
    5. Click 'OK' to close the editor.
  6. Add an 'Expression Calculator' component (from the 'Reports' tab) to the 'ReportDataBand' (click on the 'Expression Calculator' button, then single click on the desired destination band).  Set the following properties:
    1. DestPara : MyCalcResult
    2. Expression : (open up the editor by clicking on the '...' button and enter the following calculation:) Variable_.USLValue - Variable_.LSLValue
    3. expressioneditorcalc.png
    4. Click 'OK' to close the editor.
  7. To display the result (stored in the parameter), we need to add another 'DataText' component.  Add a 'DataText' component to the 'ReportDataBand' and set the following properties:
    1. DataField : (click on the '...' button, select 'MyCalcResult' from the 'Project Parameters' drop down, and click on the 'Insert Parameter' button.  Click 'OK' to save the changes.
The report template can now be saved and previewed against any folder, part, variable or dataset.  It will display each variable's name and the difference between the variable's configured USL and LSL values.  You might add other useful information (such as column headings or other data columns) to the report.  You can also download an exported version of this report below.  To learn how to import this report template, visit this knowledgebase article.

The Expression Calculator supports the standard mathematical operators (+, -, *, /), constants, and a variety of functions.  For example, the following expression could be used:
Variable_.USLValue * 100 + Variable_.LSLValue - 1

The following functions, constants, and operators can be used in the Expression Calculator:

Functions
  • Abs(x) : Absolute value of x (can also use |x| to get the same result)
  • ACos(x) : ArcCosine of x
  • ASin(x) : ArcSine of x
  • ATan(x) : ArcTangent of x
  • Cos(x) : Cosine of x
  • Dec(x) : Decrement x by 1
  • Exp(x) : Exponential of x (i.e., e raised to the power of x)
  • Inc(x) : Increment x by 1
  • Ln(x) : Natural log of x
  • Log(x) : Log of x
  • Sign(x) : returns -1 if x < 0, 0 if x = 0, and 1 if x > 0
  • Sin(x) : Sine of x
  • SqRt(x) : Square root of x
  • Tan(x) : Tangent of x

Constants
  • Pi : constant for Pi (i.e. 3.1415...)

Operators
  • + : addition
  • - : negation and subtraction
  • * : multiplication
  • / : division
  • ^ : power (i.e., x^y = x raised to the y power)

Note: This sample report template does NOT take into account variables with uni-lateral specifications.  It is simply an example to demonstrate the use of the 'Expression Calculator' component.
Attachments
Related Articles
Visitor Comments
No visitor comments posted. Post a comment
Post Comment for "How do I use the Expression Calculator component in the Report Designer (RAVE)?"
To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Your Name:
   Email Address:
* Your Comment:
* Enter the code below:
 

All Content 2010-2019 DataNet Quality Systems. All Rights Reserved.