Using Functions, Formulas and Calculations in Web Intelligence Content
Total Page:16
File Type:pdf, Size:1020Kb
SAP BusinessObjects Business Intelligence Suite Document Version: 4.2 Support Package 2 – 2016-03-07 Using functions, formulas and calculations in Web Intelligence Content 1 Document History: Web Intelligence Functions, Formulas and Calculations..................5 2 About this guide...............................................................6 3 Using standard and custom calculations.............................................7 3.1 Standard calculations............................................................ 7 3.2 Using formulas to build custom calculations............................................ 8 Using variables to simplify formulas................................................8 3.3 Working with functions........................................................... 8 Including functions in cells...................................................... 9 Function syntax..............................................................9 Examples of functions..........................................................9 Function and formula operators..................................................14 4 Understanding calculation contexts............................................... 16 4.1 The input context...............................................................16 4.2 The output context..............................................................17 4.3 Default calculation contexts.......................................................19 Default contexts in a vertical table................................................20 Default contexts in a horizontal table.............................................. 21 Default contexts in a crosstab table............................................... 21 Default contexts in a section....................................................22 Default contexts in a break..................................................... 23 4.4 Modifying the default calculation context with extended syntax..............................24 Extended syntax operators.....................................................24 5 Calculating values with smart measures............................................28 5.1 Grouping sets and smart measures..................................................28 Management of grouping sets...................................................29 5.2 Smart measures and the scope of analysis............................................ 29 5.3 Smart measures and SQL........................................................ 30 Grouping sets and the UNION operator............................................ 30 5.4 Smart measures and formulas.....................................................32 Smart measures and dimensions containing formulas..................................32 Smart measures in formulas....................................................32 5.5 Smart measures and filters....................................................... 33 Restrictions concerning smart measures and filters....................................33 Smart measures and filters on dimensions..........................................33 Using functions, formulas and calculations in Web Intelligence 2 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Content Filtering smart measures...................................................... 34 Smart measures and drill filters..................................................35 Smart measures and nested OR filters.............................................35 6 Functions, operators and keywords................................................36 6.1 Functions....................................................................36 Custom formats.............................................................37 Aggregate functions..........................................................40 Character functions..........................................................80 Date and Time functions......................................................103 Data Provider functions.......................................................120 Document functions......................................................... 137 Logical functions............................................................147 Numeric functions...........................................................157 Set functions.............................................................. 182 Misc functions.............................................................203 6.2 Function and formula operators...................................................225 Mathematical operators......................................................226 Conditional operators........................................................226 Logical operators...........................................................227 Function-specific operators....................................................230 Extended syntax operators....................................................239 Set operators..............................................................242 6.3 Extended syntax keywords.......................................................243 The Block keyword..........................................................243 The Body keyword..........................................................244 The Break keyword..........................................................245 The Report keyword.........................................................246 The Section keyword.........................................................247 6.4 Rounding and truncating numbers................................................. 248 6.5 Referring to members and member sets in hierarchies...................................249 7 Troubleshooting formulas......................................................251 7.1 Automatic rewrite formula mechanism...............................................251 7.2 Formula error and information messages.............................................252 #COMPUTATION...........................................................252 #CONTEXT...............................................................252 #DATASYNC..............................................................253 #DIV/0..................................................................253 #ERROR................................................................. 253 #EXTERNAL.............................................................. 254 #INCOMPATIBLE...........................................................254 Using functions, formulas and calculations in Web Intelligence Content © 2016 SAP SE or an SAP affiliate company. All rights reserved. 3 #MIX....................................................................254 #MULTIVALUE.............................................................254 #N/A....................................................................255 #OVERFLOW..............................................................255 #PARTIALRESULT..........................................................255 #RANK.................................................................. 255 #RECURSIVE..............................................................256 #REFRESH............................................................... 256 #SECURITY...............................................................256 #SYNTAX................................................................ 256 #TOREFRESH............................................................. 257 #UNAVAILABLE............................................................257 8 Comparing values using functions................................................258 8.1 Comparing values using the Previous function.........................................258 8.2 Comparing values using the RelativeValue function..................................... 258 Slicing dimensions and the RelativeValue function....................................259 Slicing dimensions and sections.................................................261 Order of slicing dimensions....................................................262 Slicing dimensions and sorts...................................................264 Using RelativeValue in crosstabs................................................265 Using functions, formulas and calculations in Web Intelligence 4 © 2016 SAP SE or an SAP affiliate company. All rights reserved. Content 1 Document History: Web Intelligence Functions, Formulas and Calculations The following table provides an overview of the most important document changes. Version Date Description SAP BusinessObjects Web Intelligence March 2016 The following section has been added to 4.2 Support Package 2 the guide: ● Description of Comment function Comment [page 204] SAP BusinessObjects Web Intelligence November 2015 The following sections have been added 4.2 to the guide: ● Description of Automatic Formula Rewrite mechanism Automatic rewrite formula mechanism [page 251] ● SAP HANA Online mode formulas, functions and operators restrictions Function and formula operators [page 14] ● Strings to create custom formats for weeks Custom formats [page 37] ● Time zone can be displayed on a date/time value Custom formats [page 37] ● New ToDecimal function added ToDecimal [page 179] ● Updated Concatenation function behavior Concatenation [page 82] Using functions, formulas and calculations in Web Intelligence Document History: Web Intelligence Functions, Formulas and Calculations © 2016 SAP SE or an SAP affiliate company. All rights reserved. 5 2 About this guide The Using Functions, Formulas and Calculations in Web Intelligence