Sie sind auf Seite 1von 21

IRF Business Objects

Using Formulas in Desktop Intelligence July, 2009

Why use formulas?


Extend the objects in the universe Take advantage of analytical capabilities Doing in BO what you used to do in Excel

Table of Contents
Calculations, Formula Toolbar and Editor Using Formulas in Reports:
Creating titles and headers that combine query prompts and text Using formulas to create local variables
Simple calculations (variances and percentages) Running averages For grouping data To create a projection based on a running average To setup Alerters

Caveats with using Formulas Troubleshooting Formula Results

Using formulas to create dynamic Filters

Calculations
You can create simple formulas by adding calculations on a column;
Sum total of column values Count count of unique values Count All count of all values in column Average average of column values Minimum the lowest value of a column Maximum the largest value of a column Percentage adds a percentage of total in a new column
4

Formula Toolbar
Variable editor opens variable window if currently selected cell contains a variable Define as Variable defines current cell formula as a variable, allows capturing of context Cancel cancels current changes made to cell (if not validated) Validate validates the formula in the current cell (if valid saves cell) Formula Editor opens formula editor window (if currently selected cell contains a formula Formula Display shows the current formula (or text) in the selected cell, allowing for immediate editing
5

Formula/Variable Editor
Formula/Variable Editor
Always start a formula with an = sign (otherwise it is just a text constant) Objects (and other variables) will have arrow brackets on either end i.e. <SLAcct6> String constants are enclosed with double quotes i.e. Text Numeric constants are not surrounded by quotation marks and should be entered without any formatting other than a decimal place

Formula/Variable Editor
Best Practices when creating local variables or formulas
Always start a local variable name with My so you can tell it apart from universe objects Give local variables clear and easily understood names Spaces between components makes it easier to read the formula and avoids errors Carriage returns can be added to the formula using Ctrl+Enter to make it easier to read Document your local variable in the report, so others can see the logic and/or process
7

Using Formulas in Reports


Creating titles and headers that combine query prompts and text Insert a prompt formula from the main menu:
Insert | Special Fields | Prompt Value

Add text in quotes and combine with a + or & sign


="Accounts: " + UserResponse ("ControlPage" , "C01. SL Acct6 No(s) (nnnnnn;...):")

For multiple prompts, create a cell, insert the prompt formula and cut and paste it into the formula (deleting cell afterwards)
8

Using Formulas in Reports


Using formulas to create a local variable;
For simple calculations in tables Insert a column in the table From the menu Select Data | Variables Click the Add button Create the variable in the Editor;
My Proj % of Budget Spent =<Proj Inception Amt (SL10)>/<Revised Budget Amt (SL10)> To Handle #DIV/0 results, add an IF clause = If <Revised Budget Amt (SL10)> = 0 Then 0 Else <Proj Inception Amt (SL10)>/<Revised Budget Amt (SL10)>
9

Using Formulas in Reports


Using formulas to create a local variable;
To create running averages
Insert a column in the table From the menu Select Data | Variables Click the Add button Create the variable in the Editor;
My Curr Mo Amt Running Average =RunningAverage(<Curr Mo Amt (SL10)>)

10

Using Formulas in Reports


To create your own local variable to group data (vs. creating a grouping)
Insert a column in the table From the menu Select Data | Variables Click the Add button Create the variable in the Editor; My Expense Type
=If ToNumber(<SubAcct No>) Between (9100 ,9179) Then "InDirect" Else "Direct"

Add a Break and totals on the new variable


11

Using Formulas in Reports


To create a Projection based on a running average; Months remaining in FY year
My Months left in FY =12 - ToNumber(Max(<Fiscal Mo>))

Multiplied by the running average of the current month amount, plus the FYTD Amt
My Projected FY End Amt =<My Curr Mo Amt Running Avg>*<My Months left in FY>+<Fiscal YTD Amt (SL10)>

The Projected FY End Amt is a snapshot and should not be totaled. The variance to the budget balance would show the Projected FY End balance

12

Using Formulas in Reports


To setup Alerters;
Example from
FR-GrantsAndContracts-ForDept.rep Uses days between dates to show when a Financial report is potentially out-of-date
MyDaysBetweenReportFileandDue =If(Not IsNull(<Fin Rpt File Dt>)) Then DaysBetween(<Fin Rpt File Dt> ,<Fin Rpt Due Dt>) Else 0

13

Using Formulas in Reports


To Setup Alerters;
For Alternating Row Coloring Create a Local variable
ALT-Row-Color =Even(RunningCount(<SL Acct6 No>) )

Select the entire row of data and add an alerter for when the value of the variable is equal to one In this example The <SL Acct6 No> object is used. If your table is based on sub accounts or dates you should use the appropriate object that is in each row of your table.
14

Using Formulas in Reports


Using formulas with Filters;
Use formulas with a filter to dynamically select data, regardless of the current data in the report Or when multiple filters need to be placed on the same object Commonly formulas are used to; Select a range of values Eliminate null, blank or zero values Pattern match values These filters are commonly kept as part of the report and should be documented in the report tab name and titles

15

Using Formulas in Reports


Using Formulas with Filters (example); Select Table to be filtered From the menu select Format | Filters Select the table to be filtered and click the Add button Select the field to create a filter on and click the OK button Click on the Define button and enter the formula to filter the data
=<Trans SubAcct No> Between ("5000" ,"5999") =Not(<Trans Amt>=0) =Not(IsNull(<PO/Encum No>)) And Not (<PO/Encum No>=" =Match(<Trans Desc> ,"*MAC*") ")

Note that account numbers and Calendar YrMo are string values and must be in quotes After you click OK to save the formula, the results that match the formula should be highlighted.

16

Caveats with using Formulas


On the report manager data tab;
When viewing by data provider, variables and formulas will appear in the data provider section they are based on, if based on multiple providers they will appear in the common section Broken variables or formulas wont be displayed, you will find them in the variables list (Data > Variables on the main menu) notated with a caution symbol (red triangle with an exclamation mark inside).
17

Caveats with using Formulas


Dates cannot be subtracted in Business Objects. Use the DaysBetween() function. Note this will only return the whole days between the dates, not the partial days MATCH(string1,string2) When using this function the documentation says to use % as a wildcard for any number of characters. This is incorrect, use * instead.

18

Troubleshooting Formula Results


If you get a results of #DIV/0 this indicates you are dividing by zero and should consider either adding a IF clause to the formula or if you are using the correct objects in your formula If you get a result of #MULTIVALUE this indicates there is more than one value that can be displayed in the cell. If the values are the same for each row you may need to add =max(<object>) or =min(<object>) to the formula. Otherwise you should consider adding the object to the table that will create separate rows for each value. If you get a result of #COMPUTATION this generally indicates that the formula cannot be resolved with the current context.
19

Troubleshooting Formula Results


Context (or qualification) by location
Measurement objects, formulas or local variables will automatically aggregate by their location; On the page header or outside of the sections;
In a section;
total for the report total for the section

In a table break footer; In a table row;


total for the break level total for the row

Unless specified in the Formula


20

Questions?
NSIT/Business Information Services Support (BIS) Email: IRF-support@lists.uchicago.edu or check out NSIT/BIS Website
(http://nsit.uchicago.edu/groups/bis/)

For additional information check out chapter 16 of the Data Access and Analysis (PDF) from Business Objects on the BIS website
21

Das könnte Ihnen auch gefallen