+ All Categories
Home > Documents > DA_FunctionReference

DA_FunctionReference

Date post: 04-Sep-2014
Category:
Upload: nilesh-patil
View: 27 times
Download: 3 times
Share this document with a friend
Popular Tags:
330
Data Analyzer Calculation and Function Reference Informatica PowerCenter ® (Version 8.0)
Transcript
Page 1: DA_FunctionReference

Data Analyzer Calculation and Function Reference

Informatica PowerCenter® (Version 8.0)

Page 2: DA_FunctionReference

PowerCenter Data Analyzer Calculation and Function ReferenceVersion 8.0December 2005Copyright © 2001-2005 Informatica Corporation.All rights reserved. Printed in the USA.

This software and documentation contain proprietary information of Informatica Corporation, and are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright law. Reverse engineering of the software is prohibited. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without the prior written consent of Informatica Corporation.

Use, duplication, or disclosure of the Software by the U.S. Government is subject to the restrictions set forth in the applicable software license agreement and as provided in DFARS 227.7202-1(a) and 227.7702-3(a) (1995), DFARS 252.227-7013(c)(1)(ii) (OCT 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14 (ALT III), as applicable.

The information in this product or documentation is subject to change without notice. If you find any problems in the software or documentation, please report them to us in writing. Informatica Corporation does not warrant that this product or documentation is error free.

Informatica, Data Analyzer, PowerMart, PowerCenter, PowerChannel, PowerCenter Connect, MX, and Metadata Manager are trademarks or registered trademarks of Informatica Corporation in the United States and in jurisdictions throughout the world. BEA and WebLogic are registered trademarks of BEA Systems, Inc. All other company and product names may be trade names or trademarks of their respective owners. U.S. Patent Pending.

Portions of this software and/or documentation are subject to copyright held by third parties, including without limitation: Copyright © Sun Microsystems. All rights reserved. Copyright © 2001 BEA Systems, Inc. All rights reserved. © Copyright IBM Corp. 2000, 2001. All rights reserved. Copyright © 1991-2000 DataDirect Technologies, Inc. All rights reserved. Isomorphic SmartClient presentation layer © 2002 Isomorphic Software, Inc. All rights reserved. Copyright © Palm, Inc. All rights reserved. Copyright © Research In Motion Limited. All rights reserved. Copyright © Unisys. All rights reserved. Copyright © GoAmerica Communications Corp. All rights reserved. Copyright © Microsoft Corp. All rights reserved. Copyright © 1998-1999 Aandacht c.v. All rights reserved. Copyright © 2001-2004 Panscopic Corporation, Inc. All rights reserved.

This product includes software developed by the Apache Software Foundation (http://www.apache.org/). The Apache Software is Copyright © 1999-2004 The Apache Software Foundation. All rights reserved.

The Qexo software included with this software is Copyright © 1996-1999 Per Bothner. All Rights Reserved. Your right to use such software is set forth in a modified GNU Public License, which may be found at http://www.gnu.org/software/kawa/License.html. The software is provided free of charge by Informatica, “as is”, without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.

InstallAnywhere is Copyright © 2005 Zero G Software, Inc. All Rights Reserved.

Portions of the Data Analyzer component contain copyrighted material from The JBoss Group, LLC. Your right to use such materials is set forth in the GNU Lesser General Public License Agreement, which may be found at http://www.opensource.org/licenses/lgpl-license.php. The JBoss materials are provided free of charge by Informatica, “as is”, without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.

DISCLAIMER: Informatica Corporation provides this documentation “as is” without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of non-infringement, merchantability, or use for a particular purpose. The information provided in this documentation may include technical inaccuracies or typographical errors. Informatica could make improvements and/or changes in the products described in this documentation at any time without notice.

Page 3: DA_FunctionReference

Table of Contents

List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvNew Features and Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi

Informatica Distributed Services Architecture . . . . . . . . . . . . . . . . . . . . xvi

Command Line Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

Data Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xviii

Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xviii

Integration Service (PowerCenter Server) . . . . . . . . . . . . . . . . . . . . . . .xix

Globalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx

Performance Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx

Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi

Transformation Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii

Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii

XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii

Usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxiii

PowerCenter Data Analyzer (PowerAnalyzer) . . . . . . . . . . . . . . . . . . .xxiii

PowerCenter Metadata Manager (SuperGlue) . . . . . . . . . . . . . . . . . . .xxiii

PowerCenter Connect for IBM MQSeries . . . . . . . . . . . . . . . . . . . . . .xxiii

PowerCenter Connect for SAP NetWeaver mySAP Option (PowerCenter Connect for SAP R/3) . . . . . . . . . . . . . . . . . . . . . . . . . xxiv

PowerCenter Connect for SAP NetWeaver BW Option (PowerCenter Connect for SAP BW) . . . . . . . . . . . . . . . . . . . . . . . . . xxiv

PowerCenter Repository Reports (PowerCenter Metadata Reporter) . . . xxv

About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi

Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi

Other Informatica Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii

Visiting Informatica Customer Portal . . . . . . . . . . . . . . . . . . . . . . . . xxvii

Visiting the Informatica Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii

Visiting the Informatica Developer Network . . . . . . . . . . . . . . . . . . . xxvii

Visiting the Informatica Knowledge Base . . . . . . . . . . . . . . . . . . . . . xxvii

i i i

Page 4: DA_FunctionReference

Obtaining Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxviii

Chapter 1: Using Calculations in Data Analyzer . . . . . . . . . . . . . . . . .1Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

Types of Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Custom Metric Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Custom Aggregate Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

Calculated Metric Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Custom Attribute Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Precision for a Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

Currency Decimals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Chapter 2: Expression Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

General Rules of Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Nulls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Function Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Date Format Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Chapter 3: Setting the Context for a Function . . . . . . . . . . . . . . . . . .21Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Types of Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Layout Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Value Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Syntax for the Context Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Equal (=) Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Separators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

$AGGREGATE_BY$ Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

iv Table of Contents

Page 5: DA_FunctionReference

Setting the Context for Functions of Running Category . . . . . . . . . . . . . . . 29

Chapter 4: Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Function Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Day Count Basis Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Supported Units of Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

AccrInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

AccrIntM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

AddToDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

AmorDegrC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

AmorLinC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

And . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

ArcCos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

ArcCosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

ArcCot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

ArcCoth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

ArcCsc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

ArcCsch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

ArcSec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

ArcSech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

ArcSin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

ArcSinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

ArcTan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

ArcTanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

AveDev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Avg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

BinomDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

BinomInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Ceiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

ChiDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

ChiInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

ChiTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Clean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Concat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Confidence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

Table of Contents v

Page 6: DA_FunctionReference

Correl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

Cos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

Cosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

Cot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Coth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

CountAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

CountUnique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

CoupDayBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

CoupDayS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

CoupDaySNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

CoupNCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

CoupNum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

CoupPCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

Covar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

Csc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Csch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

CumIPmt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

CumPrinc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

DB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

DDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

DateString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

DateValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

DevSq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

DfToRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

Disc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

Divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

Effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

ElapsedDays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

ElapsedHours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

ElapsedYears . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

EndOfMonth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

Equals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

EqualsIgnoreCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

Exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

ExponDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

FDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

vi Table of Contents

Page 7: DA_FunctionReference

FInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

FV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

Factorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

Find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

Fisher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

FisherInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

Floor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

Forecast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

GammaDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

GammaInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

GammaLog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

GeoMean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

GreaterThan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

GreaterThanEquals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

HarMean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

Hour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

HypGeomDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

IRR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

If . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

IfNull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

IntDivide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

IntRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

Kurt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

Len . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

LessThan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

LessThanEquals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

Log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

Log2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

Lower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

Max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

Max2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

Median . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

Min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

Min2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

Minute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

Mod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

Table of Contents vii

Page 8: DA_FunctionReference

Month . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

MovingAvg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

MovingSum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

NPV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

NPer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

Negate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

NextDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

Nominal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

NormDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

NormInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

NormSDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

NormSInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

Not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

NotEquals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

Now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

NumberString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

Or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

PV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

Pearson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

PercentContribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

Percentile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

PeriodsPerYear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

Pmt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

Previous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

Price . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

PriceDisc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

PriceMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

RateToDf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

Rept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

Round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

viii Table of Contents

Page 9: DA_FunctionReference

RoundDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

RoundUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

RunningAvg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

RunningSum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

SLn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

SYD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

Sec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

Sech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

Second . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

Sign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

Sin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

Sinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

Skew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

Slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

Sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

Square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

Standardize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

Stdev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

StdevP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

Steyx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

Substitute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

Substring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

TBillEq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

TBillPrice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

TBillYield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

TDist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

TInv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

TTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

Tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

Tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

Today . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

TriMean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

Trim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

Trunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

Table of Contents ix

Page 10: DA_FunctionReference

Upper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

VDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242

ValueOf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

Var . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245

VarP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

WeekNum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

Weekday . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

Weibull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

Within . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

XIRR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

XNPV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254

Year . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

Yield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

YieldDisc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

YieldMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260

ZTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

Appendix A: Function Quick Reference . . . . . . . . . . . . . . . . . . . . . . 263Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264

Boolean Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

Comparative Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

Conditional Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

Conversion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

Date & Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

Fetch Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

Financial Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

Rounding Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

Running Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284

Statistical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291

Unary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

x Table of Contents

Page 11: DA_FunctionReference

List of Figures

Figure 1-1. Custom Metrics Page in Advanced Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Figure 1-2. Custom Aggregates Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Figure 1-3. Calculated Metric Properties Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Figure 1-4. Create Custom Attribute Page in Advanced Mode . . . . . . . . . . . . . . . . . . . . . . . . . 6

List of Figures xi

Page 12: DA_FunctionReference

xii List of Figures

Page 13: DA_FunctionReference

List of Tables

Table 2-1. Expression Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Table 2-2. Operators in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Table 2-3. Arithmetic Operators in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Table 2-4. Comparison Operators in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Table 2-5. Logical Operators in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Table 2-6. Date Format Letters in Data Analyzer Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Table 3-1. Time Attributes Used in Setting Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Table 3-2. Keywords for Specifying the Context Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Table 4-1. Values of the DayCountBasis Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Table 4-2. Arguments for the Units Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Table A-1. Functions in the Aggregate Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264

Table A-2. Functions in the Boolean Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

Table A-3. Functions in the Comparative Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

Table A-4. Functions in the Conditional Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

Table A-5. Function in the Conversion Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

Table A-6. Functions in the Date & Time Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

Table A-7. Functions in the Fetch Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

Table A-8. Functions in the Financial Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

Table A-9. Functions in the Mathematical Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

Table A-10. Functions in the Rounding Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

Table A-11. Functions in the Running Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284

Table A-12. Functions in the Statistical Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

Table A-13. Functions in the String Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Table A-14. Functions in the Trigonometric Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291

Table A-15. Functions in the Unary Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

List of Tables xiii

Page 14: DA_FunctionReference

xiv List of Tables

Page 15: DA_FunctionReference

Preface

Welcome to PowerCenter, the Informatica software product that delivers an open, scalable data integration solution addressing the complete life cycle for all data integration projects including data warehouses, data migration, data synchronization, and information hubs. PowerCenter combines the latest technology enhancements for reliably managing data repositories and delivering information resources in a timely, usable, and efficient manner.

The PowerCenter repository coordinates and drives a variety of core functions, including extracting, transforming, loading, and managing data. The Integration Service can extract large volumes of data from multiple platforms, handle complex transformations on the data, and support high-speed loads. PowerCenter can simplify and accelerate the process of building a comprehensive data warehouse from disparate data sources.

xv

Page 16: DA_FunctionReference

New Features and Enhancements

This section describes new features and enhancements to PowerCenter 8.0. New features and enhancements are described in the following sections:

♦ Informatica Distributed Services Architecture, xvi

♦ Command Line Programs, xvii

♦ Datatypes, xvii

♦ Data Profiling, xvii

♦ Documentation, xviii

♦ Installation, xviii

♦ Integration Service (PowerCenter Server), xix

♦ Globalization, xx

♦ Performance Improvements, xx

♦ Repository, xxi

♦ Transformation Language, xxii

♦ Transformations, xxii

♦ XML, xxii

♦ Usability, xxiii

♦ PowerCenter Data Analyzer (PowerAnalyzer), xxiii

♦ PowerCenter Metadata Manager (SuperGlue), xxiii

♦ PowerCenter Connect for IBM MQSeries, xxiii

♦ PowerCenter Connect for SAP NetWeaver mySAP Option (PowerCenter Connect for SAP R/3), xxiv

♦ PowerCenter Connect for SAP NetWeaver BW Option (PowerCenter Connect for SAP BW), xxiv

♦ PowerCenter Repository Reports (PowerCenter Metadata Reporter), xxv

Informatica Distributed Services Architecture♦ Domains and nodes. PowerCenter 8.0 allows you to scale services and share resources

across multiple machines. PowerCenter introduces a PowerCenter domain, the primary unit of administration for the PowerCenter environment, and a PowerCenter node, the logical representation of a machine in a domain.

♦ Services. PowerCenter provides application and core services. Application services represent PowerCenter server-based functionality such as the Repository Service, Integration Service, and SAP BW Service. Core services support the domain and application services. Core services include a Log Service, Licensing Service, and Domain Service.

xvi Preface

Page 17: DA_FunctionReference

♦ High availability. You can use the high availability option to eliminate single points of failure in the PowerCenter environment and reduce service interruptions in the event of failure. High availability provides resilience, failover, and recovery for services.

♦ Administration. PowerCenter provides centralized administration through the Administration Console. You perform all administration tasks for the domain and services in the Administration Console. This includes administration of the Repository Service.

♦ Authentication Service. PowerCenter uses the Authentication Service to authenticate users for the Administration Console and the repository. For repository authentication, you can use LDAP or native authentication. To use LDAP authentication, you configure authentication at the domain level and register the module with each repository you want to use LDAP authentication.

♦ Licensing Service. PowerCenter uses the Licensing Service to enable features, such as PowerCenter options and connectivity. You assign each application service to a license to enable the service.

♦ Log Service. The Log Service is a core service of the PowerCenter domain. It captures log events for all services within the domain. Log types include domain, services, workflows, and sessions. You can view logs in the Administration Console and in the Workflow Monitor.

Command Line Programs♦ infacmd. infacmd is a new command line program that allows you to administer

PowerCenter domains and services. You can perform tasks such as enabling and disabling services and purging log events.

♦ infasetup. infasetup is a new command line program that allows you to configure domains and nodes. Use infasetup to define domains and nodes, join domains, and configure node passwords, domain licenses, and domain service ports.

♦ pmcmd. pmcmd includes new commands to support Integration Service functionality and new syntax to connect to a domain.

♦ pmrep. pmrep now includes former pmrepagent commands and new syntax to connect to a domain.

Datatypes♦ Flat file definitions. You can configure flat file definitions to use the Integer or Double

datatype.

Data Profiling♦ Functional Dependencies Analysis function. You can use the Functional Dependencies

Analysis function to determine exact and approximate dependencies between columns in a source.

Preface xvii

Page 18: DA_FunctionReference

♦ Inter-Source Structure Analysis function. You can use the Inter-Source Structure Inference function to determine primary key-foreign key relationships among multiple sources.

♦ Candidate key and redundancy column analysis. Data Profiling can return column sets of up to seven columns for candidate key and redundancy analysis. Also, the column precision to evaluate candidate keys and analyze redundancies is increased.

♦ Domain Inference function. The Domain Inference function can infer the source datatype and categories of inferred patterns. Data Profiling reports show results for the new types of data in this function.

♦ Column Lookup domain. You can use a flat file or relational source column as a domain.

♦ Multiple join columns. You can specify up to six join conditions in the Referential Integrity Analysis and Join Complexity Evaluation functions.

♦ Reporting. Data Profiling provides reporting enhancements such as improved paging capabilities and a consistent layout between custom profile reports and auto profile reports. In reports for the column-level Business Rule Validation function, you can click the Drill Down link on the Verbose Report Summary to view the source rows.

DocumentationPowerCenter documentation includes the following new books:

♦ Administrator Guide. Provides information for administrators to manage the domain and services.

♦ Command Line Reference. Provides syntax and description for infacmd, infasetup, pmcmd, and pmrep.

♦ Performance Tuning Guide. Provides information about tuning the performance in PowerCenter.

♦ Upgrade Guide. Provides information about new and changed functionality in PowerCenter, including tasks that you might need to perform after upgrading to a new version.

Installation♦ Installation packaging. The PowerCenter installation DVD installs Informatica

Distributed Services and the PowerCenter Client. PowerCenter also includes a documentation CD that you can use to install PowerCenter documentation.

♦ PowerCenter Editions. Based on the license you have, you can install PowerCenter Standard Edition or PowerCenter Advanced Edition.

♦ Configuration. The installation program can create a domain, add a node to an existing domain, and create a Repository Service and Integration Service. For PowerCenter Services, Data Analyzer, and Metadata Manager, you can use an existing repository or create a new repository. It also provides configuration options.

xviii Preface

Page 19: DA_FunctionReference

♦ Upgrade. You can manually upgrade an existing PowerCenter Server or Repository Agent to an Integration Service or Repository Service.

Integration Service (PowerCenter Server)

Architecture♦ Service-oriented architecture. The Integration Service replaces the PowerCenter Server. If

you have the high availability option, you can configure the Integration Service to fail over to another node if the current node becomes unavailable.

♦ Load Balancer. The Load Balancer dispatches tasks. If you run tasks on a grid, the Load Balancer dispatches Session and Command tasks to nodes that can run the tasks.

♦ Resources. PowerCenter requires resources to run tasks. Resources can include plug-ins, connection objects, file directories, and shared libraries. You define resources for nodes and tasks. The Load Balancer dispatches tasks to nodes where the resources are available.

♦ Grid object. The server grid is updated to incorporate a grid object into the PowerCenter domain. You create a grid object in the Administration Console, and you assign one or more nodes to run on the grid.

♦ Run workflow on a grid. You can configure a workflow to run on an Integration Service associated with the grid. When you run a workflow on a grid, the Integration Service distributes the workflow tasks to available nodes.

♦ Run session on a grid. You can configure a session to run on a grid if the parent workflow is associated with a grid. When you run a session on a grid, the Integration Service distributes reader, writer, and transformation threads to available nodes.

Partitioning♦ Database partitioning. You can use the database partitioning partition type with Oracle

and DB2 sources.

♦ Dynamic partitioning. The Integration Service can determine the number of partitions at run time based on the dynamic partitioning session property.

FTP♦ Partitioned FTP file targets. For partitioned target instances, the Integration Service

writes to a remote merge file. For merged targets, the Integration Service creates a local merge file and transfers the merge file to the FTP host.

♦ Indirect FTP file sources. You can use an indirect file list for a flat file source instance located on a remote machine.

Recovery♦ Workflow recovery. If you have high availability, you can recover an interrupted workflow

in the Workflow Manager or Workflow Monitor. When you recover a workflow, the

Preface xix

Page 20: DA_FunctionReference

Integration Service attempts to complete the original workflow run. The Integration Service restores the last good state of the workflow and restarts or resumes the interrupted tasks.

− Session task recovery. You can configure the recovery strategy to recover an interrupted session in a workflow. You can choose to resume, restart, or skip the Session task. When you recover the workflow, the Integration Service uses the recovery strategy to recover the session.

− Command task recovery. You can configure the recovery strategy to restart or skip the Command task when you recover a workflow.

Environment SQL♦ Transaction environment SQL. You can use transaction environment SQL to execute an

SQL statement at the beginning of each transaction. This is in addition to the current connection environment SQL that executes each time the Integration Service connects to the database.

Globalization♦ Unicode repository. PowerCenter now supports a Unicode repository. You can choose the

UTF-8 character set as the repository code page to store metadata from multiple languages.

♦ Code page validation. With expanded support for Unicode, PowerCenter code page validation rules are now less restrictive.

Performance Improvements♦ Pushdown optimization. The Integration Service can execute SQL against the source or

target database instead of processing the transformation logic within the Integration Service.

♦ Partitioned flat file targets. The Integration Service can create an individual target file for all partitions, a merge file for all partitioned flat file target instances, and a file list that references the individual target files for all target partitions.

♦ Append to flat file targets. The Integration Service can append data to existing flat file target and reject files.

♦ Flat file source and target commands. You can specify a command for any flat file source or target instance in a session. You can use a command to generate source data and you can use a command to process target data.

♦ Data compression. Repository data is compressed during communication among the Repository Service, Integration Service, and PowerCenter Client.

xx Preface

Page 21: DA_FunctionReference

RepositoryThis section describes changes to the repository functionality.

Administration♦ Administration tool. You use the browser-based PowerCenter Administration Console to

perform administrative tasks that were formerly done in the Repository Server Administration Console.

Architecture♦ Service-oriented architecture. In the Informatica distributed services architecture, each

Repository Service manages a single repository. A Repository Service process is an instance of the Repository Service running on a particular node. If you have the high availability option, you can configure the Repository Service to fail over to another node if the current node becomes unavailable.

Meta Integration Model Bridge♦ Additional import/export functionality. You can use the Meta Integration Model Bridge

from Meta Integration Technology, Inc. to exchange data with the following business intelligence and data modeling tools:

− CA AllFusion ERwin Data Modeler 4.x

− CA ERwin 3.x (ERX) and CA ERwin 3.5x (export only)

− Embarcadero ER/Studio

− Oracle Designer

− Sybase PowerDesigner

Object Queries♦ Non-versioned repositories. You can create and run queries against repositories that are

not enabled for versioning.

♦ Label parameter. The following operators are added to the label parameter: Contains, Does Not Contain, Starts With, Does Not Start With, Ends With, and Does Not End With.

Versioned Objects♦ Checking out and checking in objects. You can explicitly check out versioned repository

objects. You can view checked-in objects in the workspace.

♦ Viewing older versions of objects. You can view older versions of objects in the workspace.

Preface xxi

Page 22: DA_FunctionReference

Deployment♦ Assign owner and group to a folder. You can assign an owner and owner group when you

copy a folder or deployment group.

♦ Generate a deployment control file. You can generate a deployment control file when you copy a folder or deployment group with the Copy Wizard.

Security♦ Extended repository privileges. You can assign additional extended repository privileges to

manage repository objects. Privileges include Manage Connection, Manage Label, and Manage Folder.

Transformation Language♦ User-defined functions. You can create user-defined functions in the Designer to use in

transformations and workflow tasks. You can include the functions in expressions or other user-defined functions.

♦ Custom Functions SDK. You can develop functions written in C Language and integrate them using a set of API calls that come with PowerCenter. You can include the functions in mapping and workflow expressions.

♦ New functions. The transformation language has 23 new built-in functions such as COMPRESS, DECOMPRESS, and REVERSE.

Transformations♦ Custom transformation. The Custom transformation has the following enhancements:

− Procedures with thread-specific operations. You can include thread-specific operations in Custom transformation procedures and configure the transformation to process each partition using one thread.

− Partitioning enhancements. You can partition a Custom transformation or any transformation created from a Custom transformation locally or across a grid.

− Java and C++ API. You can use Java and C++ to create the Custom transformation procedures. You can use the new API to access data in block mode and perform datatype conversions at the column level.

♦ Java transformation. You can use the Java transformation to create, compile, and debug Java code snippets that execute in-line Java code in the mapping. You can also use Java to call expressions in a Java transformation.

XML♦ Filter data with query predicate. You can filter XML source data in a session by including

an XPath query predicate in an XML definition. You can use string, numeric, and boolean XPath functions to filter source data.

xxii Preface

Page 23: DA_FunctionReference

♦ Create a default namespace. You can use a default namespace to eliminate the namespace prefix in an XML target.

♦ Import part of an XML schema. You can import part of an XML schema when you import an XML file that uses the schema, but only contains some of the schema components.

♦ Use anySimpleType. You can import an XML schema that contains anySimpleType elements.

Usability♦ Propagate port description. In the Designer, you can edit a port description and propagate

the description to other transformations in the mapping.

♦ Link ports in the workspace. In the Designer, you can link ports by dragging all ports from one mapping object to another mapping object in the workspace.

♦ Show background in iconic view. In the Designer and Workflow Manager, you can enable background colors for objects in iconic view.

PowerCenter Data Analyzer (PowerAnalyzer)♦ PowerAnalyzer renamed. PowerAnalyzer is renamed PowerCenter Data Analyzer.

PowerCenter Metadata Manager (SuperGlue)♦ SuperGlue renamed. SuperGlue is renamed PowerCenter Metadata Manager.

♦ 64-bit operating systems. Metadata Manager supports 64-bit operating systems.

♦ XConnects. The PowerCenter XConnect extracts additional metadata from the PowerCenter repository. PowerCenter XConnects now support parameterized connections, and data lineage is displayed for these connections.

♦ Data lineage diagrams. Data lineage diagrams display the following information:

− If the container of the data structure or transformation box is different from the actual parent, the actual parent name of the data structure or transformation displays in the lineage diagram.

− Stored procedures are displayed as object structures.

− Public synonyms are displayed for all database tables across domains.

♦ Metadata Manager Configuration Console. Metadata Manager Configuration Console now works on the PowerCenter 8.0 platform. You can now register multiple source repository instances under the corresponding repository type.

PowerCenter Connect for IBM MQSeries♦ Improved real-time performance. The Integration Service can now commit source

messages to the target at the end of a millisecond flush latency period. By default, the

Preface xxiii

Page 24: DA_FunctionReference

integer n in the FlushLatency(n) function represents seconds. However, you can configure an MQSeries session to change the value to milliseconds.

PowerCenter Connect for SAP NetWeaver mySAP Option (PowerCenter Connect for SAP R/3)

♦ PowerCenter Connect for SAP R/3 renamed. PowerCenter Connect for SAP R/3 is renamed PowerCenter Connect for SAP NetWeaver mySAP Option.

♦ Improved performance. The Integration Service creates caches in memory for sessions for inbound IDoc mappings or DMI mappings. You can configure the total cache size and cache directory.

♦ Outbound IDoc syntax validation. You can configure an outbound IDoc session to check for invalid IDocs and write them to a relational or flat file target.

♦ Mandatory segments and groups in IDoc and DMI mappings. In the SAP/ALE IDoc Prepare transformation, SAP/ALE IDoc Interpreter transformation, and SAP DMI Prepare transformation, you can view mandatory segments and groups to help you understand which segments the transformations require in the IDoc or DMI message.

♦ Scheduling Business Content Integration. The listener workflow controls the scheduling of the processing workflows. The listener workflow receives DataSource data from SAP, loads the data to staging targets, and then starts the appropriate processing workflow for the received data.

PowerCenter Connect for SAP NetWeaver BW Option (PowerCenter Connect for SAP BW)

♦ PowerCenter Connect for SAP BW renamed. PowerCenter Connect for SAP BW is renamed PowerCenter Connect for SAP NetWeaver BW Option.

♦ PowerCenter Integration Server for SAP BW (PCISBW) renamed. PowerCenter Integration Server for SAP BW is renamed to SAP BW Service.

♦ Loading by packet size. PowerCenter Connect for SAP NetWeaver BW Option loads BW data as a packet based on the packet size value you set in the session.

♦ Load balancing. To support load balancing, the SAP BW Service records the BW host requesting data from PowerCenter. The Integration Service loads the data to the same requesting host.

♦ Process chains to load into SAP BW. You can create a BW Process chain to start a PowerCenter workflow that loads data into SAP BW.

♦ Improved logging. The SAP BW Service can capture messages from SAP BW when you run a BW session. You can view these log events in the PowerCenter Administration Console or in the SAP BW monitor.

♦ Recovery. You can enable a BW session for recovery. If the session fails, you can restart it in the Workflow Manager.

xxiv Preface

Page 25: DA_FunctionReference

PowerCenter Repository Reports (PowerCenter Metadata Reporter)

♦ PowerCenter Metadata Reporter renamed. PowerCenter Metadata Reporter is renamed PowerCenter Repository Reports.

♦ Server Grid List report. The Server Grid List report is replaced with the following reports:

− Integration Service List. Displays a list of all Integration Services that run on the grids and nodes configured in PowerCenter.

− Repository Information. Displays a list of all Repository Services that run on nodes configured in PowerCenter. It also provides information about whether a node is a primary node or a backup node.

♦ Metadata Extensions Usage report. The Metadata Extensions Usage report is replaced with the following reports:

− Metadata Extensions Usage (Mapping and Mapplet). Displays a list of all reusable metadata extensions. The report is organized by repository and folder and shows the number of mappings or mapplets that use each metadata extension.

− Metadata Extensions Usage (Source, Target and Transformation). Displays a list of all reusable metadata extensions. The report is organized by repository and folder and shows the number of sources, targets, or transformations that use each metadata extension.

− Metadata Extensions Usage (Workflow, Worklet and Session). Displays a list of all reusable metadata extensions. The report is organized by repository and folder and shows the number of workflows, worklets, or sessions that use each metadata extension.

Preface xxv

Page 26: DA_FunctionReference

About This Book

The Data Analyzer Calculation and Function Reference is written for information providers who want to perform advanced calculations on metrics and attributes. The Calculation and Function Reference provides information on writing mathematical expressions to create metric and attribute calculations in Data Analyzer. The Calculation and Function Reference also provides information on the syntax and usage of the functions available for the expressions.

The material in this book is also available online.

Document ConventionsThis guide uses the following formatting conventions:

If you see… It means…

italicized text The word or set of words are especially emphasized.

boldfaced text Emphasized subjects.

italicized monospaced text This is the variable name for a value you enter as part of an operating system command. This is generic text that should be replaced with user-supplied values.

Note: The following paragraph provides additional facts.

Tip: The following paragraph provides suggested uses.

Warning: The following paragraph notes situations where you can overwrite or corrupt data, unless you follow the specified procedure.

monospaced text This is a code example.

bold monospaced text This is an operating system command you enter from a prompt to run a task.

xxvi Preface

Page 27: DA_FunctionReference

Other Informatica Resources

In addition to the product manuals, Informatica provides these other resources:

♦ Informatica Customer Portal

♦ Informatica web site

♦ Informatica Developer Network

♦ Informatica Knowledge Base

♦ Informatica Technical Support

Visiting Informatica Customer PortalAs an Informatica customer, you can access the Informatica Customer Portal site at http://my.informatica.com. The site contains product information, user group information, newsletters, access to the Informatica customer support case management system (ATLAS), the Informatica Knowledge Base, and access to the Informatica user community.

Visiting the Informatica Web SiteYou can access the Informatica corporate web site at http://www.informatica.com. The site contains information about Informatica, its background, upcoming events, and sales offices. You will also find product and partner information. The services area of the site includes important information about technical support, training and education, and implementation services.

Visiting the Informatica Developer Network You can access the Informatica Developer Network at http://devnet.informatica.com. The Informatica Developer Network is a web-based forum for third-party software developers. The site contains information about how to create, market, and support customer-oriented add-on solutions based on interoperability interfaces for Informatica products.

Visiting the Informatica Knowledge BaseAs an Informatica customer, you can access the Informatica Knowledge Base at http://my.informatica.com. Use the Knowledge Base to search for documented solutions to known technical issues about Informatica products. You can also find answers to frequently asked questions, technical white papers, and technical tips.

Preface xxvii

Page 28: DA_FunctionReference

Obtaining Technical SupportThere are many ways to access Informatica Technical Support. You can contact a Technical Support Center by using the telephone numbers listed the following table, you can send email, or you can use the WebSupport Service.

Use the following email addresses to contact Informatica Technical Support:

[email protected] for technical inquiries

[email protected] for general customer service requests

WebSupport requires a user name and password. You can request a user name and password at http://my.informatica.com.

North America / South America Europe / Middle East / Africa Asia / Australia

Informatica Corporation Headquarters100 Cardinal WayRedwood City, California 94063United States

Toll Free 877 463 2435

Standard RateUnited States: 650 385 5800

Informatica Software Ltd.6 Waltham ParkWaltham Road, White WalthamMaidenhead, BerkshireSL6 3TNUnited Kingdom

Toll Free 00 800 4632 4357

Standard RateBelgium: +32 15 281 702France: +33 1 41 38 92 26Germany: +49 1805 702 702Netherlands: +31 306 022 797United Kingdom: +44 1628 511 445

Informatica Business Solutions Pvt. Ltd.Diamond DistrictTower B, 3rd Floor150 Airport RoadBangalore 560 008India

Toll Free Australia: 00 11 800 4632 4357Singapore: 001 800 4632 4357

Standard RateIndia: +91 80 51889000

xxviii Preface

Page 29: DA_FunctionReference

C h a p t e r 1

Using Calculations in Data Analyzer

This chapter includes the following topics:

♦ Overview, 2

♦ Types of Calculations, 3

♦ Precision for a Calculation, 7

1

Page 30: DA_FunctionReference

Overview

You can perform advanced calculations on metric and attribute data, such as rounding values or calculating the sum of specific metric values in a column. To perform an advanced calculation, you must write a mathematical expression that modifies data and returns a result.

An expression can include any combination of the following components:

♦ Functions

♦ Metrics

♦ Attributes

♦ Constants

♦ Variables

♦ Keywords

♦ Operators

The following custom metric expression uses some of the preceding components:

ROUND({Revenue},1) + ABS({Sales Qty})/SUM({Cost})

The expression contains the following components:

♦ Metrics: Revenue, Cost, and Sales Qty

♦ Functions: ROUND(), ABS(), and SUM()

♦ Operators: / and +

2 Chapter 1: Using Calculations in Data Analyzer

Page 31: DA_FunctionReference

Types of Calculations

You can write expressions to create the following calculations:

♦ Custom metrics

♦ Custom aggregates

♦ Calculated metrics

♦ Custom attributes

Custom Metric CalculationsYou can create custom metrics for reports on the Create Report wizard or the Analyze tab. When you create a custom metric in advanced mode, you can use Data Analyzer functions. In custom metric expressions, you can use metrics, attributes, or constants with functions.

Figure 1-1 shows the Custom Metrics page, in advanced mode, where you can enter the custom metric expression:

For more information about custom metrics, see “Adding Calculations to a Report” in the Data Analyzer User Guide.

Figure 1-1. Custom Metrics Page in Advanced Mode

Types of Calculations 3

Page 32: DA_FunctionReference

Custom Aggregate CalculationsYou can create custom aggregates for reports on the Create Report wizard or the Analyze tab. When you create a custom aggregate, you can use Data Analyzer functions. In custom aggregate expressions, you can use metrics, attributes, or constants with functions.

Figure 1-2 shows the Custom Aggregates page where you can enter the custom metric expression:

For more information about custom aggregates, see “Adding Calculations to a Report” in the Data Analyzer User Guide.

Calculated Metric CalculationsYou can create calculated metrics in the Schema Directory on the Administration tab. When you create a calculated metric, you can use Data Analyzer functions. In calculated metric expressions, you can use metrics or constants with functions.

Figure 1-2. Custom Aggregates Page

4 Chapter 1: Using Calculations in Data Analyzer

Page 33: DA_FunctionReference

Figure 1-3 shows the Calculated Metric Properties page where you can create calculated metric expressions:

For more information about calculated metrics, see “Working with Calculated Metrics” in the Data Analyzer Schema Designer Guide.

Custom Attribute CalculationsYou can create custom attributes for your reports on the Analyze tab. You can also create custom attributes in the Schema Directory on the Administration tab. When you create a custom attribute in advanced mode, you can use Data Analyzer functions that belong to the following categories:

♦ Boolean

♦ Comparative

♦ Conditional

♦ Date and Time

Figure 1-3. Calculated Metric Properties Page

Types of Calculations 5

Page 34: DA_FunctionReference

Figure 1-4 shows the Custom Attributes page, in advanced mode, where you can enter the custom attribute expression:

For more information about custom attributes you can create for a report, see “Working with Metrics and Attributes” in the Data Analyzer User Guide. For more information about custom attributes you can create in the Schema Directory, see “Managing the Schema Directory” in the Data Analyzer Schema Designer Guide.

Figure 1-4. Create Custom Attribute Page in Advanced Mode

6 Chapter 1: Using Calculations in Data Analyzer

Page 35: DA_FunctionReference

Precision for a Calculation

Precision is the number of digits after the decimal point in a numeric value. When any of the values in an expression has a precision of two or more, Data Analyzer assigns the return value the same precision as that of the value with the highest precision. For example, you have the metric Sales Price with a value of 402.86 in the custom metric expression:

{Sale Price} + .2586)

Sales Price has a precision of two, while .2586 has a precision of four. The value of the custom metric is 403.1186, with a precision of four.

If none of the values in the expression has a precision of two or more, the custom metric or custom aggregate has two as the default precision.

Calculations that involve multiplication and division may result in higher precision than the values included in the operation. For example, you have the metric Sales Price with a value of 402.86 in the custom metric expression:

{Sale Price} *.258)

Sales Price has a precision of two, while .258 has a precision of three. The result of the calculation is 103.9379. Data Analyzer uses the precision of the value with the highest precision. Data Analyzer rounds the value to the highest precision in the expression. Therefore, the value of the custom metric is 103.938.

Currency DecimalsCertain financial functions return a monetary value. For example, the CumIPmt function returns the cumulative interest paid for a loan between two specified periods of time. When you use a function that returns a monetary value, you can enter a value for the currency digits to the right of the decimal point. The value you enter overrides the precision of the return value. Data Analyzer rounds the return value to the specified value for the currency digits.

Precision for a Calculation 7

Page 36: DA_FunctionReference

8 Chapter 1: Using Calculations in Data Analyzer

Page 37: DA_FunctionReference

C h a p t e r 2

Expression Syntax

This chapter includes the following topics:

♦ Overview, 10

♦ Function Syntax, 12

♦ Constants, 13

♦ Operators, 14

♦ Dates, 17

9

Page 38: DA_FunctionReference

Overview

When you write an expression, use the correct syntax and write a valid mathematical expression. Although Data Analyzer provides syntax validation, you must enter valid values in the expression.

General Rules of SyntaxTable 2-1 lists the general rules of syntax that apply when writing all expressions:

NullsNULL indicates that a value is either unknown or undefined. NULL is not equivalent to a blank or empty string (for character columns) or zero (for numerical columns).

If any metric used in the expression has a null value, the expression returns NULL. For example if a custom metric has the expression:

({Sale Price} - ({Sale Price} * .25)) - {Product Price}

Table 2-1. Expression Syntax

Syntax Rule Syntax Rule

Enclose metric or attribute names in curly brackets as follows: {metric_name}

{Sales}

When a metric or attribute name occurs more than once in the repository, clarify which to use with the folder name and a pipe, as follows:{folder_name|metric_name}Note: Unnecessary use of the pipe may produce unexpected results.

{Sales|Sales}

Use parentheses to define the order of execution. Data Analyzer evaluates the innermost set of parentheses before proceeding to the next.

To find the sum, then the product: (6*(4+8))

Surround arguments in parentheses as follows: function(argument).When using a metric or attribute, also use curly brackets: function({metric_name}).

ABS({Profit})

When you pass an optional argument to a function, you must also pass any other optional arguments that occur ahead of it in the function syntax.

For the AmorDegrC function, if you pass the CurrencyDecimals argument, you must also pass the DayCountBasis argument.

Data Analyzer does not support nested statistical functions. The following functions are not supported:STDEV(ABS({Sales Qty}))VAR(ROUND({Sales Qty},2))

Do not nest functions within aggregate functions. Functions not supported:SUM(ABS({Sales Qty}))MEDIAN(ROUND({Profit}))

10 Chapter 2: Expression Syntax

Page 39: DA_FunctionReference

and the value of Product Price is NULL, the value of the custom metric is NULL.

Null Handling in FunctionsIf you use a function in the expression, null handling depends on the function being used. For most functions, if you pass a null value, the function returns a NULL.

For aggregate functions, by default, Data Analyzer ignores null values. For example, in the following custom metric expression:

Avg(Sale Price)

if any of the sale price values is NULL, Data Analyzer ignores that value when calculating the average sale price. If you pass an entire row or column of null values, the function returns NULL.

For more information about how specific functions handle null values, see “Functions” on page 31.

Null Values in the Context ArgumentYou can pass the Context argument to certain functions to set a scope for the function. If a value of the Context argument evaluates to NULL, the function does not select the row or column. If the Context evaluates to NULL for all rows or columns for a metric or attribute, the function returns NULL. The exceptions to this rule are the CountAll and CountUnique functions, which return zero.

Overview 11

Page 40: DA_FunctionReference

Function Syntax

A function manipulates values that you pass to it and returns a result. For example, you might use the Avg function to calculate the average salary of all your employees, or the Sum function to calculate the total sales for a set of metric values.

The values you pass to a function are known as arguments. Data Analyzer uses the following syntax for a function in an expression:

function name(argument1, argument2 ...)

You can also pass optional arguments to many functions. Optional arguments display within square brackets ([ ]) in the syntax:

function name(argument1, argument2 ...[, argument x, argument y ...])

When you enter the function in the expression text box, do not enter the square brackets.

Depending on the function, an argument takes any of the following values:

♦ Metric name

♦ Attribute name

♦ Variable

♦ String literal

♦ Numeric literal

♦ Date value

Certain functions take the Context argument. The Context argument is a special type of argument that sets the scope for a function. For more information about the Context argument, see “Setting the Context for a Function” on page 21.

Data Analyzer provides a point-and-click interface for all functions to help you enter expressions. To minimize syntax errors, use the point-and-click method to enter expressions. When you point and click instead of manually entering the expression, Data Analyzer supplies any necessary additional characters, such as brackets and pipes.

When you use the point-and-click method to add a function to the expression, Data Analyzer displays the names of the required arguments in the expression. You can replace the argument names with the values you want to pass to the function. You can also enter values for any optional argument you want to pass to the function.

12 Chapter 2: Expression Syntax

Page 41: DA_FunctionReference

Constants

Use the following constants anywhere in an expression:

♦ E. E is a mathematical constant that is the base of the natural logarithm. The value of E is equal to 2.718281828459. Use the E constant to calculate the natural logarithm of a numeric value. For example, you have an expression that returns the straight-line depreciation of an asset for one year. You want to calculate the natural logarithm of the depreciation of the asset in each year. Use the following expression where, the cost of the asset is $1,000, salvage value is $175, and the life of the asset is 8 years:

SLn(1000, 175, 8)*E

♦ PI. PI is a real number that is used in many mathematical calculations. The value of PI is equal to 3.14159265359. Use the PI variable in trigonometric functions to covert radians to degrees or degrees to radians. For example, the following expression returns 0.707 radians as the cosine of 45 degrees:

Cos(45*PI/180)

Use the following constants as the arguments for certain functions:

♦ FALSE

♦ TRUE

TRUE and FALSE are logical values that determine the form of the function in which they are being used. For example, in the BinomDist function, you can use TRUE or FALSE as the value of the Cumulative argument. If Cumulative is TRUE, the function returns the cumulative binomial distribution; otherwise it does not return the cumulative binomial distribution.

Note: The constants are not case sensitive. For example, within an expression, PI is the same as pi.

Constants 13

Page 42: DA_FunctionReference

Operators

Data Analyzer supports the use of multiple operators and the use of operators within nested expressions. If you write an expression that includes multiple operators, Data Analyzer evaluates the expression in the following order:

1. Arithmetic operators

2. Comparison operators

3. Logical operators

Data Analyzer evaluates operators in the order they appear in the following table. It evaluates operators in an expression with equal precedence to all operators from left to right.

Table 2-2 lists the precedence for all operators:

You can also use operators within nested expressions. When expressions contain parentheses, Data Analyzer evaluates operations inside parentheses before operations outside parentheses. Operations in the innermost parentheses are evaluated first.

For example, depending on how you nest the operations, the equation 8 + 5 - 2 * 8 returns different values:

Table 2-2. Operators in Expressions

Operator Meaning

( ) Parentheses

+, - Unary plus and minus

^ Power

*, /, % Multiplication, division, modulus

+, - Addition, subtraction

<, <=, >, >= Less than, less than or equal to, greater than, greater than or equal to

=, <> Equal to, not equal to

! Logical NOT operator

& Logical AND operator, used when specifying conditions

| Logical OR operator, used when specifying conditions

Equation Return Value

8 + 5 - 2 * 8 -3

8 + (5 - 2) * 8 32

14 Chapter 2: Expression Syntax

Page 43: DA_FunctionReference

Arithmetic OperatorsUse arithmetic operators to perform mathematical calculations on numeric data.

Table 2-3 lists the arithmetic operators, in order of precedence, you can use in expressions:

If you perform arithmetic on a null value, the function returns NULL.

When you use arithmetic operators in an expression, all of the operands in the expression must be numeric. For example, the expression 1 + “1” is not valid because it adds an integer to a string. The expression 1.23 + 4 / 2 is valid because all of the operands are numeric.

Note: Data Analyzer provides Date and Time functions that let you perform arithmetic on date/time values. For further information on built-in date functions, see “Dates” on page 17.

Comparison OperatorsUse comparison operators to compare character or numeric strings, manipulate data, and return a TRUE (1) or FALSE (0) value.

Table 2-4 lists the comparison operators you can use in expressions:

When you use comparison operators in an expression, the operands must be the same datatype. For example, the expression 123.4 > “123” is not valid because the expression compares a numeric value with a string. The expressions 123.4 > 123 and “a” <> “b” are valid because the operands are the same datatype.

Table 2-3. Arithmetic Operators in Expressions

Operator Meaning

+, - Unary plus, unary minus. Unary plus indicates a positive value. Unary minus indicates a negative value.

^, *, /, % Power, multiplication, division, modulus. A modulus is the remainder after dividing two integers. For example, 13 % 2 = 1 because 13 divided by 2 equals 6 with a remainder of 1.

+, - Addition, subtraction.The addition operator (+) does not concatenate strings. To concatenate strings, use the Concat function. To perform arithmetic on date values, use the date functions.

Table 2-4. Comparison Operators in Expressions

Operator Meaning

= Equal to

> Greater than

< Less than

>= Greater than or equal to

<= Less than or equal to

<> Not equal to

Operators 15

Page 44: DA_FunctionReference

If you compare a value to a null value, the result is NULL.

For information on how to compare dates, see “Dates” on page 17.

Logical OperatorsUse logical operators to manipulate numeric data. Expressions that return a numeric value evaluate to TRUE for non-zero values, FALSE for zero, and NULL for NULL.

Table 2-5 lists the logical operators you can use in expressions:

Expressions that combine a null value with a Boolean expression produce results that are ANSI-compliant. For example, Data Analyzer produces the following results:

♦ NULL AND TRUE = NULL

♦ NULL AND FALSE = FALSE

Table 2-5. Logical Operators in Expressions

Operator Equivalent SQL Operator Meaning

! NOT Negates result of an expression. For example, if an expression evaluates to TRUE, the ! operator returns FALSE. If an expression evaluates to FALSE, the ! operator returns TRUE.

& AND Joins two conditions and returns TRUE if both conditions evaluate to TRUE. Returns FALSE if one condition is not true.

| OR Connects two conditions and returns TRUE if any condition evaluates to TRUE. Returns FALSE if both conditions are not true.

16 Chapter 2: Expression Syntax

Page 45: DA_FunctionReference

Dates

Data Analyzer provides Date and Time functions that help you perform calculations on dates. With the Date and Time functions you can round, truncate, or compare dates, extract one part of a date, or perform arithmetic on a date. For information on each function, see “Functions” on page 31.

In addition to Date and Time functions, other functions also take dates as arguments. For example, financial functions AccrInt and AccrIntM take date arguments. As a value for a date argument, you can pass a date in one of the following ways:

♦ Pass a date attribute. A date attribute contains date values that are recognized by Data Analyzer functions. You do not need to manipulate the date attribute values before passing them to a function. The following expression is an example of a function that takes date arguments. Begin Date and End Date are date attributes:

ElapsedDays({Begin Date}, {End Date})

♦ Enter a date by using another function that generates a date. Functions that generate a date are Date, DateValue, EndOfMonth, Today, NextDate, and AddToDate. The following expression is an example of a function that takes date arguments. The expression uses the DateValue function to enter dates for the Disc function:

Disc(DateValue("4/1/2004"), DateValue("6/15/2004"), 95, 100)

You cannot directly enter a date string as the value for a date argument. For example, the following expression is invalid:

Disc("4/1/2004", "6/15/2004", 95, 100)

For more information about function usage and syntax, see “Functions” on page 31.

CalendarData Analyzer supports dates in the Gregorian calendar system only. Dates expressed in a different calendar system are not supported. Data Analyzer recognizes leap years and accepts any date in the Gregorian calendar.

Date Format StringsThe date format string defines the structure of a date. Use date format strings to convert input dates into other date formats.

Date format strings used in Data Analyzer functions are derived from the Java programming language. You must enter a date format string using certain date format letters, as specified in Java. Date format strings are case sensitive and must be enclosed within quotation marks.

Dates 17

Page 46: DA_FunctionReference

Using Date Format Strings in FunctionsYou can pass the DateFormat argument to certain functions. The value of the DateFormat argument is a case-sensitive date format string that defines the structure of a date. Use the DateFormat argument to pass the date format string to the following functions:

♦ DateString. The DateString function creates a string, when you provide date and format values. Use the DateFormat argument to provide the function information about the date you are passing. For example, the following expression returns the string “2003-Jan-13 AD”:

DateString(date(2003, 01, 13), “yyyy-MMM-dd G”)

♦ DateValue. The DateValue function creates a date, when you provide a date string value. Use the DateFormat argument to pass a date string in a format that is unrecognized by the function. For example, the following expression returns the date for 13th day of January, 2003 AD:

DateValue("13/January/2003 AD", "dd/MMMM/yyyy G")

Date Format LettersUse the date format letters to specify a date format string. You can also use the date format letters to change how date and timestamp attributes display in your reports. For more information, see “Managing Account Information” in the Data Analyzer User Guide.

Table 2-6 lists the date format letters you can use to specify a part of a date. The examples in the table are based on the following date:

August 20, 2004 4:35 PM GMT

Table 2-6. Date Format Letters in Data Analyzer Functions

Format Letter Description Examples

G Era designator. G returns AD.

y Year portion of date. yyyy returns 2004.yy returns 04.

M Month portion of date. If the number of letters is 3 or more, Data Analyzer interprets the month as text, otherwise, Data Analyzer interprets the month as a number.

M returns 8.MM returns 08.MMM returns Aug.MMMM returns August.

w Week number in year. w returns 34.

W Week number in month. W returns 3.

D Day number in year. D returns 233.

d Day number in month. d returns 20.

E Day of week, returned as text. E, EE, and EEE return Fri.EEEE returns Friday.

a AM or PM marker, returned as text. a returns PM.

18 Chapter 2: Expression Syntax

Page 47: DA_FunctionReference

Note: You must use the correct case for the format letters you use in your expressions. Data Analyzer does not validate the case of the format letters you use in an expression. For example, if you use “mm” instead of “MM” to specify the month portion of a date, you might see incorrect data in your report.

H Hour of day (0 to 23), where zero is 12 AM (midnight). H and HH return 16.

h Hour number in AM or PM (1 to 12). hh returns 4.hh returns 04.

m Minute number in hour. m and mm returns 35.

s Second portion of date. s returns 0.ss returns 00.

S Millisecond portion of date. S returns 000.

z Time zone, returned as text. z returns PMT.

Table 2-6. Date Format Letters in Data Analyzer Functions

Format Letter Description Examples

Dates 19

Page 48: DA_FunctionReference

20 Chapter 2: Expression Syntax

Page 49: DA_FunctionReference

C h a p t e r 3

Setting the Context for a Function

This chapter includes the following topics:

♦ Overview, 22

♦ Types of Context, 23

♦ Syntax for the Context Argument, 24

♦ Setting the Context for Functions of Running Category, 29

21

Page 50: DA_FunctionReference

Overview

You can use the Context argument with functions such as Count and Covar. When you create a custom metric or custom aggregate expression, you can use the Context argument as a filter condition to set a scope for the function. The function performs the calculation on only those values for which the condition is true.

Use the context argument to create a flexible expression by performing the calculation on a set of attribute values. For example, you have a report that displays the Sales Person and Region attributes and the Sales metric. To find out the total number of sales persons, use the Count function and pass a metric or attribute name as the value of the List argument:

Count(List [,Context])

To find out how many sales persons are from the Northern region, use the following syntax to pass a value for the Context argument:

Count({Sales Person}, "{Region}='Northern'")

The preceding expression counts the number of values in the Sales Person attribute for the Northern region.

Note: You cannot use the Context argument when using functions to create a calculated metric expression.

22 Chapter 3: Setting the Context for a Function

Page 51: DA_FunctionReference

Types of Context

Context can be one of the following types:

♦ Layout context

♦ Value context

Layout ContextUse layout context to perform the calculation on rows, columns, or sections in the report. Use layout keywords to set the layout context. For example, you can use the ROW keyword to perform the Sum calculation on each row in a report. For more information about layout keywords, see “Keywords” on page 26.

When you use a layout context in a custom metric expression, the custom metric is known as a layout-dependent custom metric. You cannot create filters or set rankings for layout-dependent metric calculations. For more information about layout-dependent metric calculations, see “Adding Calculations to a Report” in the Data Analyzer User Guide.

Value ContextUse value context to perform the calculation on specified attribute values. Use attributes and value keywords to set the value context. For example, you can use the THIS keyword to get the value of an attribute for the current row. For more information about value keywords, see “Keywords” on page 26.

Types of Context 23

Page 52: DA_FunctionReference

Syntax for the Context Argument

You must enclose the context within double quotation marks. You must enclose an attribute or metric value within single quotation marks.

The syntax for the Context argument can include any combination of the following elements:

♦ Equal (=) operator

♦ Separators

♦ Attributes

♦ Keywords

♦ $AGGREGATE_BY$ variable

Equal (=) OperatorUse the equal (=) operator when setting the context for a function. The Data Analyzer equal (=) operator is the same as the SQL IN operator. The function performs the calculation on any of the data values that match the condition. The following expression is an example of the equal (=) operator where Sales is a metric in the report and State is an attribute in the report:

Sum({Sales}, “{State}=‘CA’, ‘AZ’”)

The above expression calculates the total of all Sales values where the State attribute value is either CA or AZ.

SeparatorsUse the comma (,) symbol to separate multiple values within a condition. For example:

Avg({Sales}, “{Category}=‘Food’, ‘Drinks’, ‘Supplies’”)

You can include multiple conditions within the Context argument. Use the semicolon (;) symbol to separate multiple conditions. For example:

Sum({Sales}, “{State}=‘CA’;{Category}=‘Food’”)

AttributesUse attribute names and attribute values to set the value context. Use attribute names that are part of the report. Use the point-and-click interface to add attribute names and attribute values to the expression. If you manually enter the attribute names in the expression, you must enclose attribute names within curly brackets ({}).

For reports with time settings, you can use time attributes as keywords when you set the value of the Context argument. Time attributes allow you to track time periods in reports. Your Data Analyzer system administrator must set up the time attributes in the time dimension table before you can use them in your expressions. For more information about setting

24 Chapter 3: Setting the Context for a Function

Page 53: DA_FunctionReference

calendar attributes, see “Working with Time Dimensions” in the Data Analyzer Schema Designer Guide.

For reports with time settings, you can select the applicable time attributes for an expression. Applicable time attributes are the attributes that represent the time period selected for the report and any other time period of a higher granularity. For example, for a report for the Current Quarter, you can select QUARTER_NUM or YEAR_NUM time attributes for your expression.

Use the point-and-click interface to add the time attribute name and attribute values to the expression. If you manually enter the time attribute name in the expression, you must enter the at (@) symbol before the time attribute name.

Table 3-1 lists the time attributes that you can use when passing the Context argument:

Table 3-1. Time Attributes Used in Setting Context

Time Attribute Name Meaning Example

HOUR_NUM Refers to the hour number in day. To calculate the total sales made between 10:00 and 11:00 am, use the following expression:Sum({Sales}, “{@HOUR_NUM}=10”)

YEAR_DAY_NUM Refers to the day number in year. To calculate the total sales made on the first day of the year, use the following expression:Sum({Sales}, “{@YEAR_DAY_NUM}=1”)

YEAR_WEEK_NUM Refers to the week number in year. To calculate the total sales made in the fourth week of the year, use the following expression:Sum({Sales}, “{@YEAR_WEEK_NUM}=4”)

YEAR_MONTH_NUM Refers to the month number in year. To calculate the total sales made in the month of June, use the following expression:Sum({Sales}, “{@YEAR_MONTH_NUM}=6”)

QUARTER_NUM Refers to the quarter number. To calculate the average sales made in the first quarter, use the following expression:Avg({Sales}, “{@QUARTER_NUM}=1”)To calculate the average sales made in the current quarter, use the following expression:Avg({Sales}, “{@QUARTER_NUM}=CURRENT”)

YEAR_NUM Refers to the year number. To calculate the total sales made in 2003, use the following expression:Sum({Sales}, “{@YEAR_NUM}=2003”)

Syntax for the Context Argument 25

Page 54: DA_FunctionReference

KeywordsUse the following types of keywords in expressions to set the value of the Context argument:

♦ Layout keywords. Allow you to set the layout context. For more information about the layout context, see “Layout Context” on page 23.

♦ Value keywords. Allow you to set the value context. For more information about the value context, see “Value Context” on page 23.

Use the point-and-click interface to add keywords to the expression. If you manually enter the keywords in the expression, you must enter the keywords in uppercase letters. You must enter the at (@) symbol before the layout keywords.

Note: You cannot use layout keywords with numeric attributes.

Table 3-2 lists the keywords you can use:

DATE_TIME Refers to the date and time values. In the expression, the value of the DATE_TIME time attribute must be in the following format:yyyy-MM-dd HH:mm:ssNote: The above is the ISO date format.

To calculate the total sales made on February 14, 2004 at 11:00 am, use the following expression:Sum({Sales}, “{@DATE_TIME}=2004-02-14 11:00:00”)

DATE_NO_TIME Refers to the date value. In the expression, the value of the DATE_NO_TIME time attribute must be in the following format:yyyy-MM-ddNote: The above is the ISO date format.

To calculate the total sales made on February 14, 2004, use the following expression:Sum({Sales}, “{@DATE_TIME}=2004-02-14”)

Table 3-2. Keywords for Specifying the Context Argument

Keyword Type of Keyword Meaning Example

COLUMN Layout Refers to all the column attributes.

To calculate the sum for the Sales column in a simple report table, use the following expression:Sum({Sales}, “@COLUMN”)

ROW Layout Refers to all the row attributes. Use ROW in reports with cross tabular report tables.

You have a report that displays as a cross tabular report table. The report displays the Sales for each product category for each state. Category is the column attribute and State is the row attribute. To calculate the sum for the Sales values for each row, use the following expression:Sum({Sales}, “@ROW”)

Table 3-1. Time Attributes Used in Setting Context

Time Attribute Name Meaning Example

26 Chapter 3: Setting the Context for a Function

Page 55: DA_FunctionReference

Performing a Calculation on a Set of ValuesWhen you use the COLUMN, ROW, or SECTION keywords, you can perform the calculation on a set of values. You can specify this set of values by entering the start and end positions. Use 1 for the first row or column, 2 for the second row or column, and so on. For example, if you want the Sum function to perform the calculation on rows two through six and columns five through seven, you can use the following expression:

Sum({Sales}, "@ROW=2,6; @COLUMN=5,7")

Note: The set of values must include values that display continuously in the report table.

$AGGREGATE_BY$ VariableWhen creating a custom aggregate expression, you can use the $AGGREGATE_BY$ variable to set the value of the Context argument. The variable works as a placeholder for the layout context in the expression. Use this variable to perform a calculation on rows, columns, and sections in a report.

SECTION Layout Refers to all the section attributes. Use SECTION in reports with sectional report tables.

You have a report that displays as a sectional report table. The report displays the Sales for each product category by region. Region is the section attribute and Category is the row attribute. To calculate the sum for the Sales values for each section, use the following expression:Sum({Sales}, “@SECTION”)

THIS Value Refers to a value at the current position in the processing of the function. You cannot use THIS in a custom aggregate expression.

You have a report that displays the sales for each state and each category. State and Category are row attributes. To calculate what percent of sales for each row contributed to the total sales for that state, use the following expression:{Sales}/Sum({Sales}, “{State}=THIS”)*100

CURRENT Value Refers to the current calendar. Use this keyword in reports with time settings. You cannot use CURRENT in a report with time settings that displays Hour by Hour granularity.

To calculate the total sales made in the current quarter, use the following expression:Sum({Sales}, “{@QUARTER_NUM}=CURRENT”)

NULL Value Checks whether a value is NULL.

You have a report that displays sales made in the current quarter by each sales person. If a sale was a result of a customer enquiry, the sales person attribute value is NULL. To calculate the total sales that resulted due to customer enquires, use the following expression:Sum({Sales}, “{Sales Person}=NULL”)

Table 3-2. Keywords for Specifying the Context Argument

Keyword Type of Keyword Meaning Example

Syntax for the Context Argument 27

Page 56: DA_FunctionReference

For example, in a cross tabular report table, to count metric values for the Sales metric by row and by column, use the following expression:

Count({Sales}, “$AGGREGATE_BY$”)

Use the point-and-click interface to add the variable to an expression. If you manually enter the variable, you must enclose the variable name within dollar ($) signs.

For more information about using variable in custom aggregates, see “Adding Calculations to a Report” in the Data Analyzer User Guide.

28 Chapter 3: Setting the Context for a Function

Page 57: DA_FunctionReference

Setting the Context for Functions of Running Category

Functions in the Running category allow you to perform calculations that display trends within a set of values. The following functions belong to the Running category:

♦ MovingAvg

♦ MovingSum

♦ PercentContribution

♦ RunningAvg

♦ RunningSum

For the functions in the Running category, you can use the Context argument to perform the calculation for a row, a column, or a time attribute used in the report. Use the following keywords to set the Context:

♦ Time attribute name. For a list of time attribute names, see Table 3-1 on page 25.

♦ COLUMN keyword. For more information about using the COLUMN keyword, see “Keywords” on page 26.

♦ ROW keyword. For more information about using the ROW keyword, see “Keywords” on page 26.

♦ SECTION keyword. Within each section, Data Analyzer performs the calculation for columns only. For more information about using the SECTION keyword, see “Keywords” on page 26.

If you do not pass a value for the Context argument, Data Analyzer performs the calculation for all values of the given metric or attribute. For a report with a tabular report table, Data Analyzer performs the calculation for the column. For a report with a cross tabular report table, Data Analyzer performs the calculation for all values across all rows and columns. For a report with a sectional report table, Data Analyzer performs the calculation for all values across all sections, including the Summary section.

When you use the Context argument for functions in the Running category, you cannot use attribute values in the Context argument.

For more information about each function, see “Functions” on page 31.

Setting the Context for Functions of Running Category 29

Page 58: DA_FunctionReference

30 Chapter 3: Setting the Context for a Function

Page 59: DA_FunctionReference

C h a p t e r 4

Functions

This chapter includes information on Data Analyzer functions that you can use in expressions. Each function description includes:

♦ Syntax

♦ Return Value

♦ Example

♦ Notes (optional)

31

Page 60: DA_FunctionReference

Function Categories

Data Analyzer provides the following types of functions:

♦ Aggregate. Perform calculations on a list of numeric values.

♦ Boolean. Perform boolean operations in calculations.

♦ Comparative. Compare values in calculations.

♦ Conditional. Check for conditions in calculations.

♦ Conversion. Convert one unit of measure to another unit of measure.

♦ Date & Time. Manipulate date and time values in calculations.

♦ Fetch. Get the next or previous value of a given metric or attribute.

♦ Financial. Perform common business calculations, such as determining the payment for a loan, the future value or net present value of an investment, and the values of various securities.

♦ Mathematical. Perform common arithmetic calculations on numeric values.

♦ Rounding. Round or truncate numeric values.

♦ Running. Perform calculations that display trends within a set of values.

♦ Statistical. Perform statistical analysis on sets of values.

♦ String. Manipulate text strings in calculations.

♦ Trigonometric. Perform common trigonometric calculations on numeric values.

♦ Unary. Manipulate the signs (+ or -) of numeric values.

♦ User Defined. The User Defined category lists additional functions that you create in Data Analyzer. If you have not created any functions, the User Defined category is empty.

Day Count Basis ArgumentYou can pass the DayCountBasis argument to certain financial functions. Day count basis is a method of interest calculation using a day count fraction, where the numerator is the elapsed days between two dates and the denominator is the number of days in an year.

Different countries and financial institutions use different day count fractions. Data Analyzer provides the commonly used day count fractions for use in expressions.

32 Chapter 4: Functions

Page 61: DA_FunctionReference

Table 4-1 lists the values you can use for the DayCountBasis argument:

Note: Values of the DayCountBasis argument are not case sensitive and must be enclosed within quotation marks.

Table 4-1. Values of the DayCountBasis Argument

Value Meaning

ACT/360 Actual number of days between dates divided by 360. When calculating the numerator, the first date is excluded and second date is included in the calculation. The fraction assumes that there are 360 days in the year.

ACT/365 Actual number of days between dates divided by 365. When calculating the numerator, the first date is excluded and second date is included in the calculation. The fraction assumes that there are 365 days in the year.

ACT/365L Actual number of days between dates divided by 365 or 366. When calculating the numerator, the first date is excluded and second date is included in the calculation. The fraction uses 366 as the denominator if the second date is in a leap year.

ACT/ACT Actual number of days between dates divided by actual number of days in the year. When calculating the numerator, the first date is excluded and second date is included in the calculation.

NASD 30/360 National Association of Securities Dealers (NASD) 30/360 day count fraction. This day count fraction calculates the elapsed days assuming all months have 30 days after adjusting the two dates based on the following conditions:- If the first date is the 31st of a month, it is adjusted to the 30th of the same month.- If the second date is the 31st of a month and the first date is earlier than the 30th of a month, the

second date is adjusted to the 1st of the next month.- If the second date is earlier than the 31st or if the first date is the 30th of a month, the second date

is adjusted to the 30th of the same month.

30/360 Day count fraction assumes that there are 30 days in each month and 360 days in the year. When calculating the numerator, the dates are adjusted based on the following conditions:- If the first date is the 31st of a month, the fraction adjusts it to the 30th of the same month.- If the second date is the 31st and if first date is the 30th or 31st, second date is adjusted to 30th of

the same month.

30E/360 European 30/360 day count fraction. The day count fraction assumes that there are 30 days in each month and 360 days in the year. When calculating the numerator, the dates are adjusted based on the following conditions:- If the first date is the 31st of a month, the fraction adjusts it to the 30th of the same month.- If the second date is the 31st, it is adjusted to 30th of the same month.

30E+/360 30E+/360 day count fraction assumes that there are 30 days in each month and 360 days in the year. When calculating the numerator, the dates are adjusted based on the following conditions:- If the first date is the 31st of a month, the fraction adjusts it to the 30th of the same month.- If the second date is the 31st, it is adjusted to 1st of the next month.

Function Categories 33

Page 62: DA_FunctionReference

Supported Units of MeasureThe Units function converts the value you specify in one unit of measure to another unit of measure.

Table 4-2 lists the units of measure you can use as arguments for the Units function:

Note: Unit names are not case sensitive and must be enclosed within quotation marks.

Table 4-2. Arguments for the Units Function

Type of Unit Supported Units

Angles gradient, grad, degree, deg, radian, rad

Area square millimeter, mm2, square centimetercm2, square decimeter, dm2, square meter, m2, hectare, square kilometer, km2, square inch, in2, square foot, square feet, ft2, square yard, yd2, square rod, acre, square mile

Computer storage byte, kilobyte, megabyte, gigabyte, terabyte, petabyte, exabyte

Length angstrom, nanometer, nm, micrometer, millimeter, mm, centimeter, cm, decimeter, dm, meter, m, kilometer, km, inch, in, foot, feet, ft, yard, yd, fathom, rod, chain, furlong, mile, mi, nautical mile, league, astronomical unit, au, light year, parsec

Mass milligram, mg, centigram, cg, decigram, dg, gram, g, kilogram, kg, grain, carat, pennyweight, dram, ounce, ou, newton, pound, lb, stone, quarter, cental, hundredweight, ton, tonne, long ton

Metric yocto, zepto, atto, femto, pico, nano, micro, milli, centi, deci, base, deka, hecto, kilo, mega, giga, tera, peta, exa, zetta, yotta

Semantic measures

millionth, thousandth, hundredth, eighth, quarter, half, tenth, one, pair, two, three, five, half dozen, ten, dozen, hundred, gross (equals 144), thousand, grand, million, billion, trillion

Speed cm/sec, m/min, km/h, ft/sec, mph, knot, yd/sec, m/sec, mi/min, mach, km/sec, mi/sec, light

Temperature F, fahrenheit, C, celcius, centigrade, K, kelvin

Time nanosecond microsecond, millisecond, ms, second, sec, minute, min, hour, hr, day, dy, week, wk, fortnight, month, year, decade, century, millennium

Volume cubic millimeter, mm3, milliliter, ml, cubic centimeter, cm3, centiliter, cl, liter, l, kiloliter, kl, cubic meter, m3, cubic inch, in3, cubic foot, cubic feet, ft3, cubic yard, yd3, tablespoon, tblsp, fluid ounce, cup, pint, pt, quart, qt, gallon, gal, UK ounce, UK pint, UK quart, UK gallon

34 Chapter 4: Functions

Page 63: DA_FunctionReference

ABS

Returns the absolute value of a number. You can use this function with a numeric metric, numeric attribute, or a calculated numeric value.

This function belongs to the Unary category.

SyntaxAbs(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns the absolute value of the Discount metric:

Abs({Discount})

Discount Return Value

-------- ------------

-1.56 1.56

-3.99 3.99

0.99 0.99

-3.49 3.49

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

Abs 35

Page 64: DA_FunctionReference

ACCRINT

Returns the accrued interest for a security that pays periodic interest. The interest rate (Rate argument) must be adjusted for the frequency of payments. To adjust the interest rate for frequency, divide the annual rate by the number of payments made in an year. For example, a coupon pays an annual interest rate of 15 percent and the frequency is "Quarterly". Calculate the value of the Rate argument by dividing 15% by 4.

This function belongs to the Financial category.

SyntaxAccrInt(IssueDate, FirstInterestDate, SettlementDate, Rate [, ParValue, Frequency, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns 25.42 as the accrued interest for a government savings bond:

Argument Datatype Description

IssueDate Date Required. Date when the security was issued. Must be less than SettlementDate.

FirstInterestDate Date Required. Date when the security will make its first interest payment.

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

ParValue Numeric Optional. Par value of a security. Default is 1,000. Must be greater than or equal to 0.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

36 Chapter 4: Functions

Page 65: DA_FunctionReference

AccrInt(Date(2000,3,31), Date(2000,9,30), Date(2000,6,1), 0.15, 1000, "semiannual", "30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

AccrInt 37

Page 66: DA_FunctionReference

ACCRINTM

Returns the accrued interest for a security that pays interest at maturity. The interest rate (Rate argument) must be adjusted for the frequency of payments. To adjust the interest rate for frequency, divide the annual rate by the number of payments made in an year.

This function belongs to the Financial category.

SyntaxAccrIntM(IssueDate, SettlementDate, Rate [, ParValue, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns 41.10 as the accrued interest for a note:

AccrIntM(DateValue("4/1/2004"), DateValue("6/15/2004"), 0.2, 1000, "ACT/365", 2)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

Argument Datatype Description

IssueDate Date Required. Date when the security was issued. Must be less than SettlementDate.

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

ParValue Numeric Optional. Par value of a security. Default is 1,000. Must be greater than or equal to 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

38 Chapter 4: Functions

Page 67: DA_FunctionReference

ADD

Returns the sum of two numeric values.

This function belongs to the Mathematical category.

SyntaxAdd(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression returns sum of quantity sold and quantity in stock:

ADD({Quantity Sold}, {Quantity in Stock})

Quantity Sold Quantity in Stock Return Value

------------- ----------------- ------------

200 252 452

9855 566 10421

6.89 3.52 10.41

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Add 39

Page 68: DA_FunctionReference

ADDTODATE

Adds years, months, and days to a date, and returns the adjusted date. You can use this function to pass a date value to another function.

This function belongs to the Date & Time category.

SyntaxAddToDate(Date, Years, Months, Days)

Return ValueDate

ExamplesTo add one months and five days to the Date Shipped attribute, use the following expression:

AddToDate({Date Shipped}, 0, 1, 5)

Date Shipped Return Value

------------ ------------

1/12/2001 2/17/2001

10/9/2002 11/14/2002

1/29/2004 3/5/2004

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

Years Numeric Required. Number of years.

Months Numeric Required. Number of months.

Days Numeric Required. Number of days.

40 Chapter 4: Functions

Page 69: DA_FunctionReference

AMORDEGRC

Returns the depreciation for each accounting period, based on a depreciation coefficient. If an asset is purchased in the middle of the accounting period, the function prorates the depreciation. This function is similar to the AmorLinC function, except that a depreciation coefficient is applied in the calculation depending on the life of the asset.

This function belongs to the Financial category.

SyntaxAmorDegrC(Cost, PurchaseDate, FirstPeriodDate, Salvage, Period, Rate [, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

PurchaseDate Date Required. Date asset was purchased. Must be less than FirstPeriodDate.

FirstPeriodDate Date Required. Date of the end of the first period. For example, if the first period for the calculation is the year 2004, the FirstPeriodDate is December 31st, 2004.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Period Numeric Required. Number representing the period for which you want to perform the calculation. Default is the same as the value of the Life argument. Must be greater than or equal to 0.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

AmorDegrC 41

Page 70: DA_FunctionReference

ExamplesYour company purchased a printer on September 10, 2003. The cost of the printer was 5000 F (French Francs) and the salvage value is 500 F. The depreciation rate is 15 percent. The following expression returns 1037 F as the depreciation for the second accounting period:

AmorDegrC(5000, Date(2003, 9, 10), Date(2003, 12, 31), 500, 2, 0.15)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

42 Chapter 4: Functions

Page 71: DA_FunctionReference

AMORLINC

Returns the depreciation for each accounting period. If an asset is purchased in the middle of the accounting period, the function prorates the depreciation.

This function belongs to the Financial category.

SyntaxAmorLinC(Cost, PurchaseDate, FirstPeriodDate, Salvage, Period, Rate [, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesYou purchased a printer on September 10, 2003. The cost of the printer was $5000 and the salvage value is $500. The depreciation rate is 15 percent. The following expression returns $750 as the depreciation for the second accounting period:

AmorLinC(5000, Date(2003, 9, 10), Date(2003, 12, 31), 500, 2, 0.15)

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

PurchaseDate Date Required. Date asset was purchased. Must be less than FirstPeriodDate.

FirstPeriodDate Date Required. Date of the end of the first period. For example, if the first period for the calculation is the year 2004, the FirstPeriodDate is December 31st, 2004.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Period Numeric Required. Number representing the period for which you want to perform the calculation. Default is the same as the value of the Life argument. Must be greater than or equal to 0.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

AmorLinC 43

Page 72: DA_FunctionReference

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

44 Chapter 4: Functions

Page 73: DA_FunctionReference

AND

Joins two conditions and returns TRUE if both conditions are true. Returns FALSE if any condition or both conditions are not true.

This function belongs to the Boolean category.

SyntaxAnd(BooleanValue1, BooleanValue2)

Return ValueBoolean

ExamplesThe following expression returns TRUE:

And(TRUE, TRUE)

The following expression returns FALSE:

And(TRUE, FALSE)

The following expression returns TRUE:

And(Equals(2+2, 4), Equals(2+3, 5))

Argument Datatype Description

BooleanValue1 Boolean Required. Boolean condition you want to pass to the function.

BooleanValue2 Boolean Required. Boolean condition you want to pass to the function.

And 45

Page 74: DA_FunctionReference

ARCCOS

Returns the arc cosine of a numeric value. The arc cosine is the trigonometric inverse of a cosine. The arc cosine is the angle whose cosine is the passed numeric value. As the argument for the ArcCos function, you must pass a value that is between -1 and 1.

This function belongs to the Trigonometric category.

SyntaxArcCos(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function. The value is in the range 0 to PI.

ExamplesThe following expression returns the value 120 (degrees):

ArcCos(-0.5)*180/PI

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

46 Chapter 4: Functions

Page 75: DA_FunctionReference

ARCCOSH

Returns the inverse hyperbolic cosine of a numeric value. The inverse hyperbolic cosine is the trigonometric inverse of a hyperbolic cosine. As the argument for the ArcCosh function, you must pass a real number that is greater than or equal to 1.

This function belongs to the Trigonometric category.

SyntaxArcCosh(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function.

ExamplesThe following expression returns the value 0:

ArcCosh(1)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

ArcCosh 47

Page 76: DA_FunctionReference

ARCCOT

Returns the arc cotangent of a numeric value. The arc cotangent is the trigonometric inverse of a cotangent. The arc cotangent is the angle whose cotangent is the passed numeric value.

This function belongs to the Trigonometric category.

SyntaxArcCot(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function. The value is in the range -PI/2 to +PI/2.

ExamplesThe following expression return the value 0.46 (radians):

ArcCot(2)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

48 Chapter 4: Functions

Page 77: DA_FunctionReference

ARCCOTH

Returns the inverse hyperbolic cotangent of a numeric value. The inverse hyperbolic cotangent is the trigonometric inverse of a hyperbolic cotangent. As the argument for the ArcCoth function, you must pass a value that is outside the range of -1 and 1.

This function belongs to the Trigonometric category.

SyntaxArcCoth(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function.

ExamplesThe following expression returns the value 0.20:

ArcCoth(5)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

ArcCoth 49

Page 78: DA_FunctionReference

ARCCSC

Returns the arc cosecant of a numeric value. The arc cosecant is the trigonometric inverse of a cosecant. The arc cosecant is the angle whose cosecant is the passed numeric value. As the argument for the ArcCsc function, you must pass a value that is outside the range of -1 and 1.

This function belongs to the Trigonometric category.

SyntaxArcCsc(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function. The value is in the range -PI/2 to +PI/2.

ExamplesThe following expression returns the value 1.57 (radians):

ArcCsc(1)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

50 Chapter 4: Functions

Page 79: DA_FunctionReference

ARCCSCH

Returns the inverse hyperbolic cosecant of a numeric value. The inverse hyperbolic cosecant is the trigonometric inverse of a hyperbolic cosecant.

This function belongs to the Trigonometric category.

SyntaxArcCsch(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function.

ExamplesThe following expression returns the value 0.10:

ArcCsch(10)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

ArcCsch 51

Page 80: DA_FunctionReference

ARCSEC

Returns the arc secant of a numeric value. The arc secant is the trigonometric inverse of a secant. The arc secant is the angle whose secant is the passed numeric value.

This function belongs to the Trigonometric category.

SyntaxArcSec(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function. The value is in the range 0 to PI.

ExamplesThe following expression returns the value 1.47 (radians):

ArcSec(10)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

52 Chapter 4: Functions

Page 81: DA_FunctionReference

ARCSECH

Returns the inverse hyperbolic secant of a numeric value. The inverse hyperbolic secant is the trigonometric inverse of a hyperbolic secant. As the argument for the ArcSec function, you must pass a value that is outside the range of -1 and 1.

This function belongs to the Trigonometric category.

SyntaxArcSech(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function.

ExamplesThe following expression returns the value 0.5:

ArcSech(1.32)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

ArcSech 53

Page 82: DA_FunctionReference

ARCSIN

Returns the arc sine of a numeric value. The arc sine is the trigonometric inverse of a sine. The arc sine is the angle whose sine is the passed numeric value. As the argument for the ArcSin function, you must pass a value that is between -1 and 1.

This function belongs to the Trigonometric category.

SyntaxArcSin(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function. The value is in the range -PI/2 to +PI/2.

ExamplesThe following expression returns the value 0.85 (radians):

ArcSin(0.75)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

54 Chapter 4: Functions

Page 83: DA_FunctionReference

ARCSINH

Returns the inverse hyperbolic sine of a numeric value. The inverse hyperbolic sine is the trigonometric inverse of a hyperbolic sine.

This function belongs to the Trigonometric category.

SyntaxArcSinh(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function.

ExamplesThe following expression returns the value -1.19:

ArcSinh(-1.5)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

ArcSinh 55

Page 84: DA_FunctionReference

ARCTAN

Returns the arc tangent of a numeric value. The arc tangent is the trigonometric inverse of a tangent. The arc tangent is the angle whose tangent is the passed numeric value.

This function belongs to the Trigonometric category.

SyntaxArcTan(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function. The value is in the range -PI/2 to +PI/2.

ExamplesThe following expression returns the value 1.11 (radians):

ArcTan(2)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

56 Chapter 4: Functions

Page 85: DA_FunctionReference

ARCTANH

Returns the inverse hyperbolic tangent of a numeric value. The inverse hyperbolic tangent is the trigonometric inverse of a hyperbolic tangent. As the argument for the ArcTanh function, you must pass a number that is between -1 and 1.

This function belongs to the Trigonometric category.

SyntaxArcTanh(NumericValue)

Return ValueNumeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians by 180/PI or use the Units function.

ExamplesThe following expression returns the value 0.42:

ArcTanh(0.4)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

ArcTanh 57

Page 86: DA_FunctionReference

AVEDEV

Returns the average of the absolute deviations of values in a list from their mean. The AveDev function determines the variability in a set of values.

This function belongs to the Aggregate category.

SyntaxAveDev(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 2695.35 as the average of the absolute deviations of the Amount Sold metric, where the Category attribute value is Drinks:

AveDev({Amount Sold}, "{Category}='Drinks'")

Category Amount Sold

-------- -----------

Drinks 13253.74

Drinks 6392.94

Drinks 10502.07

Snacks 550.05

Drinks 5420.59

Drinks 6974.26

Snacks 777.62

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

58 Chapter 4: Functions

Page 87: DA_FunctionReference

AVG

Returns the average of all values in a list.

This function belongs to the Aggregate category.

SyntaxAvg(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 4.16 as the average profit of all products:

Avg({Profit})

Profit

------

5.99

2.59

3.89

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Avg 59

Page 88: DA_FunctionReference

BINOMDIST

Returns the value for the statistical binomial distribution. Binomial distribution is the probability of observing X number of successes in a fixed number of independent trials.

This function belongs to the Statistical category.

SyntaxBinomDist(X, Trials, ProbabilityOfSuccess, Cumulative)

Return ValueNumeric

ExamplesA test consists of 16 questions. For each question, the answer can be true or false. The probability of getting a true answer for a question is 0.5. The following expression returns 0.89 as the binomial distribution for getting a true answer for at most 10 questions:

BinomDist(10, 16, 0.5, TRUE)

The following expression returns 0.12 as the binomial distribution for getting a true answer for exactly 10 questions:

BinomDist(10, 16, 0.5, FALSE)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be between 0 and Trials, inclusive.

Trials Numeric Required. Number of independent trials.

ProbabilityOfSuccess Numeric Required. Probability of a success on a single trial. Must be between 0 and 1, inclusive.

Cumulative Boolean Required. Logical value that determines the form of the function. If cumulative is TRUE, the function returns the cumulative answer. Otherwise, it does not return the cumulative answer.

60 Chapter 4: Functions

Page 89: DA_FunctionReference

BINOMINV

Returns the number (integer) for which the cumulative binomial distribution is greater than or equal to a criterion value. The cumulative binomial distribution is the first argument (Probability) that you pass to the function. The BinomInv function is the statistical inverse of binomial distribution (BinomDist) function.

This function belongs to the Statistical category.

SyntaxBinomInv(Probability, Trials, ProbabilityOfSuccess)

Return ValueNumeric

ExamplesIn an experiment, you flip a coin six times. For each flip, you can get heads or tails. The probability of getting heads for a coin flip is 0.5. The following expression returns 3 as the smallest number of coin flips for a cumulative binomial distribution of 0.75:

BinomInv(0.75, 6, 0.5)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution. Must be between 0 and 1, inclusive.

Trials Numeric Required. Number of independent trials.

ProbabilityOfSuccess Numeric Required. Probability of a success on a single trial. Must be between 0 and 1, inclusive.

BinomInv 61

Page 90: DA_FunctionReference

CEILING

Returns the value rounded up to the specified number of digits, towards positive infinity. The PowerAnalyzer Ceiling function differs from the Microsoft Excel Ceiling function. In the PowerAnalyzer Ceiling function, Significance is the number of digits to the right of the decimal point. In Excel, Significance is the multiple to which you want to round. The PowerAnalyzer Ceiling function rounds a number towards positive infinity, whereas the Excel Ceiling function rounds a number away from zero.

This function belongs to the Rounding category.

SyntaxCeiling(NumericValue [, Significance])

Return ValueNumeric

ExamplesThe following expression returns the number rounded up to the significance, towards positive infinity:

Ceiling({Number}, {Significance})

Number Significance Return Value

------ ------------ ------------

2.425 1 2.5

-2.425 1 -2.4

2.425 2 2.43

-2.425 2 -2.42

2.425 3 2.425

-2.425 3 -2.424

2.425 0 3

-2.425 0 -2

NotesIf you pass a negative number (-n) as the value of the Significance argument, the Ceiling function returns 10 raised to the nth power. For example, Ceiling(2.425, -2) returns 100.

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Significance Numeric Optional. Number of places to the right of decimal point. Negative value indicates number of places to the left of decimal point. Default is 0.

62 Chapter 4: Functions

Page 91: DA_FunctionReference

To generate the same result as the Excel Ceiling(value, significance) function, use the following expression:

RoundUp(value/significance) * significance

Ceiling 63

Page 92: DA_FunctionReference

CHIDIST

Returns the probability of the chi-squared distribution. The chi-squared distribution is associated with a chi-squared test and a certain number of degrees of freedom. The chi-squared test allows you to compare observed and expected values.

This function belongs to the Statistical category.

SyntaxChiDist(X, DegreesOfFreedom)

Return ValueNumeric

ExamplesIn an experiment involving the student test scores, the value of a chi-squared test is 2.5 and the degrees of freedom is 8. The following expression returns 0.96 as the probability of the chi-squared distribution:

ChiDist(2.5, 8)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be greater than or equal to 0.

DegreesOfFreedom Numeric Required. Whole number representing the degrees of freedom. Degrees of freedom is the number of values in a statistical calculation that are free to vary. Must be between 1 and 10,000, inclusive.

64 Chapter 4: Functions

Page 93: DA_FunctionReference

CHIINV

Returns the inverse of the probability associated with a chi-squared distribution. The ChiInv (Probability, DegressofFreedom) function returns the value X, where Probability is the return value of the ChiDist(X, DegressofFreedom) function.

This function belongs to the Statistical category.

SyntaxChiInv(Probability, DegreesOfFreedom)

Return ValueNumeric

ExamplesThe following expression returns 2.5 as the value of a chi-squared test:

ChiInv(0.96, 8)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution. Must be between 0 and 1, inclusive.

DegreesOfFreedom Numeric Required. Whole number representing the degrees of freedom. Degrees of freedom is the number of values in a statistical calculation that are free to vary. Must be between 1 and 10,000, inclusive.

ChiInv 65

Page 94: DA_FunctionReference

CHITEST

Returns the chi-squared goodness of fit between expected and observed lists. You can use this function to find out if results based on a hypothesis are verified by an experiment. Pass numeric metrics or attributes as the values for the ListExpected and ListObserved arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the ListObserved argument and the Context2 argument corresponds to the ListExpected argument.

This function belongs to the Aggregate category.

SyntaxChiTest(ListObserved, ListExpected [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 0.944 as the Chitest value between expected satisfaction rating and the actual satisfaction rating for customers in the 30-39 years age group:

ChiTest({Actual Rating}, {Expected Rating}, "{Age Group}='30-39'", "{Age Group}='30-39'")

Age Group Expected Rating Actual Rating

--------- --------------- -------------

30-39 5.5 6

30-39 3 3.5

20-29 8.5 9.9

30-39 6 6

20-29 7 12

Argument Datatype Description

ListObserved Numeric List Required. List of observed values. Use a metric or attribute name.

ListExpected Numeric List Required. List of expected results. Use a metric or attribute name.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

66 Chapter 4: Functions

Page 95: DA_FunctionReference

30-39 7 7

30-39 4.3 5

30-39 2 4

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

ChiTest 67

Page 96: DA_FunctionReference

CLEAN

Cleans a string of control characters. Removes all nonprintable characters from a string. You can use this function to remove control characters from a string. These control characters are characters that may not print with your operating system.

This function belongs to the String category.

SyntaxClean(String)

Return ValueString

Argument Datatype Description

String String Required. String value you want to pass to the function.

68 Chapter 4: Functions

Page 97: DA_FunctionReference

CONCAT

Concatenates two strings. If one of the strings is NULL, the Concat function ignores it and returns the other string. If both strings are NULL, the Concat function returns NULL.

This function belongs to the String category.

SyntaxConcat(String1, String2)

Return ValueString

ExamplesThe following expression concatenates the names in the First Name and Last Name attributes:

Concat({First Name}, {Last Name})

First Name Last Name Return Value

---------- --------- ------------

Beth Kelley BethKelley

Marin Jones MarinJones

george cash georgecash

Ally NULL Ally

NotesThe Concat function does not add spaces between the two strings. If you want to add a space between the strings, use an expression with two nested Concat functions:

Concat(Concat({First Name}, " "), {Last Name})

Argument Datatype Description

String1 String Required. String value you want to pass to the function.

String2 String Required. String value you want to pass to the function.

Concat 69

Page 98: DA_FunctionReference

CONFIDENCE

Returns the confidence range for the mean of a population. The confidence range is a value on either side of a sample mean, which allows you to determine the standard deviation with a particular level of confidence. The level of confidence determines the value of the Alpha argument. Alpha equals (1-confidence level/100). For example, for an 80 percent confidence level, Alpha equals 0.2.

This function belongs to the Statistical category.

SyntaxConfidence(Alpha, StdDev, Size)

Return ValueNumeric

ExamplesIn an experiment to determine the time taken to complete a test, you have a sample of 100 students. The average time taken to complete the test is 45 minutes. The population standard deviation is 5.5. Use the following expression to determine, with 90 percent confidence, the interval within which the population mean lies:

Confidence(0.1, 5.5, 100)

The above expression returns the value 0.90. Thus, you can say with 90 percent confidence that the average time taken to complete the test equals 45 plus/minus 0.90 minutes, or 44.1 to 45.9 minutes.

Argument Datatype Description

Alpha Numeric Required. The alpha variable.

StdDev Numeric Required. Standard deviation of a list of numbers.

Size Numeric Required. Number of elements for which you want to perform the calculation. Must be greater than or equal to 0.

70 Chapter 4: Functions

Page 99: DA_FunctionReference

CORREL

Returns the correlation coefficient of two sets of values. You can use the correlation coefficient to determine the relationship between two sets of values. Pass numeric metrics or attributes as the values for the first and second List arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

This function belongs to the Aggregate category.

SyntaxCorrel(List1, List2 [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 0.1685 as the correlation coefficient of Sales in 2003 and 2004 for products in the Drinks category:

Correl({2003 Sales}, {2004 Sales}, "{Category}='Drinks'", "{Category}='Drinks'")

Category 2004 Sales 2003 Sales

-------- ---------- ----------

Drinks 1500 2500

Drinks 5000 2250

Food 38088 10502

Drinks 6200 800

Drinks 750 150

Argument Datatype Description

List1 Numeric List Required. Name of a metric or attribute.

List2 Numeric List Required. Name of a metric or attribute.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Correl 71

Page 100: DA_FunctionReference

Drinks 2000 750

Food 28195 16974

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

72 Chapter 4: Functions

Page 101: DA_FunctionReference

COS

Returns the cosine of a numeric value.

This function belongs to the Trigonometric category.

SyntaxCos(Angle)

Return ValueNumeric. The value is in the range -1 to +1.

ExamplesThe following expression returns the cosine for all values of the Degrees metric:

Cos({Degrees}*PI/180)

Degrees Return Value

------- -----------------

0 1.0

90 0.0

70 0.342020143325593

NULL NULL

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

Cos 73

Page 102: DA_FunctionReference

COSH

Returns the hyperbolic cosine of a numeric value.

This function belongs to the Trigonometric category.

SyntaxCosh(Angle)

Return ValueNumeric

ExamplesThe following expression returns the hyperbolic cosine for all values of the Angles metric:

Cosh({Angles})

Degrees Return Value

------- ----------------

1.0 1.54308063481524

3.66 19.4435376920294

0 1.0

NULL NULL

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

74 Chapter 4: Functions

Page 103: DA_FunctionReference

COT

Returns the cotangent of a numeric value.

This function belongs to the Trigonometric category.

SyntaxCot(Angle)

Return ValueNumeric

ExamplesThe following expression returns the cotangent for all values of the Angles metric:

Cot({Angles})

Degrees Return Value

------- ------------

1.0 0.64

0.52 1.74653

5 -0.30

NULL NULL

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

Cot 75

Page 104: DA_FunctionReference

COTH

Returns the hyperbolic cotangent of a numeric value.

This function belongs to the Trigonometric category.

SyntaxCoth(Angle)

Return ValueNumeric

ExamplesThe following expression returns the value 2.16:

Coth(0.5)

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

76 Chapter 4: Functions

Page 105: DA_FunctionReference

COUNTALL

Counts the number of values within a given metric or attribute. You can use this function to get the number of rows in a column. The Context argument allows you to count only a specific set of metric or attribute values.

This function belongs to the Aggregate category.

SyntaxCountAll(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 2 as the number of values in the Sales Person attribute for the Northern region:

CountAll({Sales Person}, "{Region}='Northern'")

Sales Person Region

------------ --------

Roger Northern

Sean Eastern

Tim Northern

Pearce Western

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

CountAll 77

Page 106: DA_FunctionReference

COUNTUNIQUE

Counts the number of unique values within a given metric or attribute. You can use this function to get the number of unique rows in a column. The Context argument allows you to count only a specific set of metric or attribute values.

This function belongs to the Aggregate category.

SyntaxCountUnique(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 3 as the number of unique values in the Region attribute:

CountUnique({Region})

Region

--------

Northern

Eastern

Northern

Western

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

78 Chapter 4: Functions

Page 107: DA_FunctionReference

COUPDAYBS

Returns the total number of coupon days from the beginning of a coupon period to the settlement date.

This function belongs to the Financial category.

SyntaxCoupDayBS(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 121 as the number of days from the beginning of a coupon period to the settlement date:

CoupDayBS(Date(2003,3,31), Date(2004,11,30), "annual","30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CoupDayBS 79

Page 108: DA_FunctionReference

COUPDAYS

Returns the total number of coupon days in the coupon period that contains the settlement date.

This function belongs to the Financial category.

SyntaxCoupDayS(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 360 as the number of days in the coupon period that contains the settlement date:

CoupDayS(Date(2003,3,31), Date(2004,11,30), "annual","30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

80 Chapter 4: Functions

Page 109: DA_FunctionReference

COUPDAYSNC

Returns the total number of coupon days from the settlement date to the next coupon date.

This function belongs to the Financial category.

SyntaxCoupDaySNC(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 240 as the number of days from the settlement date to the next coupon date:

CoupDaySNC(Date(2003,3,31), Date(2004,11,30), "annual","30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CoupDaySNC 81

Page 110: DA_FunctionReference

COUPNCD

Returns the next coupon date after the settlement date of a security.

This function belongs to the Financial category.

SyntaxCoupNCD(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Return ValueDate

ExamplesThe following expression returns November 30, 2003 as the next coupon date after the settlement date:

CoupNCD(Date(2003,3,31), Date(2004,11,30), "annual","30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

82 Chapter 4: Functions

Page 111: DA_FunctionReference

COUPNUM

Returns the number of coupons payable between the settlement date and maturity date. PowerAnalyzer rounds the number of coupons to the nearest whole number.

This function belongs to the Financial category.

SyntaxCoupNum(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Return ValueDate

ExamplesThe following expression returns 2 as the number of coupons payable between the settlement date and maturity date:

CoupNum(Date(2003,3,31), Date(2004,11,30), "annual","30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CoupNum 83

Page 112: DA_FunctionReference

COUPPCD

Returns the previous coupon date before the settlement date of a security.

This function belongs to the Financial category.

SyntaxCoupPCD(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Return ValueDate

ExamplesThe following expression returns November 30, 2002 as the previous coupon date before the settlement date:

CoupPCD(Date(2003,3,31), Date(2004,11,30), "annual","30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

84 Chapter 4: Functions

Page 113: DA_FunctionReference

COVAR

Returns covariance of two sets of values. Covariance is the average of the products of deviations for each data point pair. You can use this function to determine the relationship between two sets of values. Pass numeric metrics or attributes as the values for the first and second List arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

This function belongs to the Aggregate category.

SyntaxCovar(List1, List2 [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 328400 as the covariance of quantity sold and quantity on hand for products in the Perishables group:

Covar({Quantity Sold}, {Quantity on Hand}, "{Group}='Perishables'", "{Group}='Perishables'")

Group Quantity Sold Quantity on Hand

----------- ------------- ----------------

Perishables 1500 2500

Perishables 5000 2250

Apparel 38088 10502

Perishables 6200 800

Argument Datatype Description

List1 Numeric List Required. Name of a metric or attribute.

List2 Numeric List Required. Name of a metric or attribute.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Covar 85

Page 114: DA_FunctionReference

Perishables 750 150

Perishables 2000 750

Apparel 28195 6974

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

86 Chapter 4: Functions

Page 115: DA_FunctionReference

CSC

Returns the cosecant of a numeric value.

This function belongs to the Trigonometric category.

SyntaxCsc(Angle)

Return ValueNumeric

ExamplesThe following expression returns the value 1.67:

Csc(2.5)

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

Csc 87

Page 116: DA_FunctionReference

CSCH

Returns the hyperbolic cosecant of a numeric value.

This function belongs to the Trigonometric category.

SyntaxCsch(Angle)

Return ValueNumeric

ExamplesThe following expression returns the value 0.05:

Csch(3.66)

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

88 Chapter 4: Functions

Page 117: DA_FunctionReference

CUMIPMT

Returns the cumulative interest paid for a loan between two specified periods of time. The Rate argument represents the interest rate for each period. Calculate NumberPeriods by multiplying the term of the loan by number of payments per year.

This function belongs to the Financial category.

SyntaxCumIPmt(Rate, NumberPeriods, PresentValue, StartPeriod, EndPeriod, PaymentAtBeginning [, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns -9409.07 as the total interest paid in the second year of a six-year loan:

CumIPmt(0.0125, 72, 75000, 13, 24, TRUE)

You can use the CumIPmt function to calculate the interest paid in a single month. For example, to calculate the interest paid in the 6th month, pass 6 as the value of the StartPeriod and EndPeriod arguments. The following expression returns -897.21 as the interest paid in the 6th month:

CumIPmt(0.0125, 72, 75000, 6, 6, TRUE)

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

PresentValue Numeric Required. Current value of an asset or liability. Must be greater than 0.

StartPeriod Numeric Required. Starting period for the calculation. Must be between 1 and EndPeriod, inclusive.

EndPeriod Numeric Required. Ending period for the calculation. Must be greater than or equal to 1.

PaymentAtBeginning Boolean Required. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

CumIPmt 89

Page 118: DA_FunctionReference

NotesTo calculate interest rate earned in each period, divide the annual rate by the number of payments made in an year. For example, if you make monthly payments at an annual interest rate of 15 percent, the value of the Rate argument is 15% divided by 12. If you make annual payments, the value of the Rate argument is 15%.

90 Chapter 4: Functions

Page 119: DA_FunctionReference

CUMPRINC

Returns the cumulative principal paid on a loan between two specified periods of time. The Rate argument represents the interest rate for each period. Calculate NumberPeriods by multiplying the term of the loan by number of payments per year.

This function belongs to the Financial category.

SyntaxCumPrinc(Rate, NumberPeriods, PresentValue, StartPeriod, EndPeriod, PaymentAtBeginning [, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns -9386.53 as the total principal paid in the second year of a six-year loan, where you make monthly payments:

CumPrinc(0.0125, 72, 75000, 13, 24, TRUE)

You can use the CumPrinc function to calculate the principal paid in a single month. For example, to calculate the principal paid in the 6th month, pass 6 as the value of the StartPeriod and EndPeriod arguments. The following expression returns -669.09 as the principal paid in the 6th month:

CumPrinc(0.0125, 72, 75000,6, 6, TRUE)

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

PresentValue Numeric Required. Current value of an asset or liability. Must be greater than 0.

StartPeriod Numeric Required. Starting period for the calculation. Must be between 1 and EndPeriod, inclusive.

EndPeriod Numeric Required. Ending period for the calculation. Must be greater than or equal to 1.

PaymentAtBeginning Boolean Required. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

CumPrinc 91

Page 120: DA_FunctionReference

NotesTo calculate interest rate earned in each period, divide the annual rate by the number of payments made in an year. For example, if you make monthly payments at an annual interest rate of 15 percent, the value of the Rate argument is 15% divided by 12. If you make annual payments, the value of the Rate argument is 15%.

92 Chapter 4: Functions

Page 121: DA_FunctionReference

DB

Returns the depreciation of an asset for a specified period using the fixed-declining balance depreciation calculation. The fixed-declining balance method calculates depreciation at a fixed rate. The value of the Period argument is the time period for which you want to calculate the depreciation.

This function belongs to the Financial category.

SyntaxDB(Cost, Salvage, Life, Period [, FirstYearMonths, CurrencyDecimals])

Return ValueNumeric

ExamplesAn office desk costs $1,000 and has a life of 10 years. The salvage value of the desk is $100. The following expression returns $51.62 as the depreciation of the desk in the 7th year:

DB(1000,100,10,7)

NotesIf the number of months in the first year is not 12, then use the FirstYearMonths argument to pass the number of months in the first year.

If the Life argument is expressed in months, the Period argument must also be expressed in months.

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Life Numeric Required. Number of periods over which an asset is being depreciated. Must be greater than 0.

Period Numeric Required. Number representing the period for which you want to perform the calculation. Default is the same as the value of the Life argument. Must be greater than 0.

FirstYearMonths Numeric Optional. Number of months in the first year of life. Default is 12. Must be between 1 and 12, inclusive.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

DB 93

Page 122: DA_FunctionReference

DDB

Returns the depreciation of an asset for a specified period using the double-declining balance depreciation calculation. The double-declining balance method calculates depreciation at an accelerated rate. In the first period, depreciation is highest and it decreases in each subsequent period. The value of the Period argument is the time period for which you want to calculate the depreciation. Use the RateFactor argument to pass a value for the rate at which the balance declines.

This function belongs to the Financial category.

SyntaxDDB(Cost, Salvage, Life [, Period, RateFactor, CurrencyDecimals])

Return ValueNumeric

ExamplesThe cost of a machine is $3,200 and it has a life of 8 years. The salvage value of the machine is $500. The following expression returns $800 as the depreciation of the machine in the 1st year:

DDB(3200,500,8,1)

NotesIf the Life argument is expressed in months, the Period argument must also be expressed in months.

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Life Numeric Required. Number of periods over which an asset is being depreciated. Must be greater than 0.

Period Numeric Optional. Number representing the period for which you want to perform the calculation. Default is the same as the value of the Life argument. Must be greater than 0.

RateFactor Numeric Optional. Factor used in calculating the rate. Default is 2. Must be greater than 0.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

94 Chapter 4: Functions

Page 123: DA_FunctionReference

DATE

Returns a date given the year, month, and day values you pass to the function. You can use this function to pass a date value to another function.

This function belongs to the Date & Time category.

SyntaxDate(Year, Month, Day)

Return ValueDate

ExamplesThe following expression returns the date September 10, 2004:

Date(2004, 9, 10)

NotesIf you pass an invalid value for the Month or Day arguments, the function returns NULL.

Argument Datatype Description

Year Numeric Required. Number representing the year. Must be between 1,000 and 3,000, inclusive.

Month Numeric Required. Number representing the month of the year. Must be between 1 and 12, inclusive.

Day Numeric Required. Number representing the day of the month. Pass a value valid for the given year and month. Must be between 1 and 31, inclusive.

Date 95

Page 124: DA_FunctionReference

DATESTRING

Converts a date to a string. By default, the function returns the date string in the M/d/yy format. To have the DateString function return the date string in a format different than the default format, you can pass the DateFormat argument to the function. The DateFormat argument provides the DateString function information about the date format you are passing.

This function belongs to the Date & Time category.

SyntaxDateString(Date [, DateFormat])

Return ValueString

ExamplesThe following expression returns the string 5/26/04:

DateString(Date(2004, 5, 26))

The following expression returns the string 26/5/2004:

DateString(Date(2004, 5, 26), "d/M/yyyy")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

DateFormat String Optional. Date format string for defining the date string. Default value is the date format for the PowerAnalyzer system locale, without the time part. You must enclose the date format string within quotation marks. For more information on the syntax of the date format string, see the PowerAnalyzer online help.

96 Chapter 4: Functions

Page 125: DA_FunctionReference

DATEVALUE

Converts a string to a date. You can pass the date string in date format of the system locale. The DateValue function also recognizes certain commonly used date formats. You can pass the date string to the DateValue function in any of these date formats, which are recognized by the function. You can also pass the date string in other unrecognized date formats. When you pass the date string in an unrecognized date format, you must also pass the DateFormat argument to the function. The DateFormat argument provides the DateValue function information about the date format you are passing. You can use this function to pass a date value to another function.

This function belongs to the Date & Time category.

SyntaxDateValue(DateString [, DateFormat])

Return ValueDate

ExamplesThe following expression returns the date for the 10th day of June, 2004 in the yyyy/MM/dd format, which is a recognizable date format:

DateValue("2004/06/10")

The following expression returns the date for the 19th day of August, 2005 in the d/M/yyyy format, which is not a recognizable date format:

DateValue("19/8/2005", "d/M/yyyy")

Argument Datatype Description

DateString String Required. Date being specified as string. You must enclose the date string within quotation marks.

DateFormat String Optional. Date format string for defining the date string. Default value is the date format for the PowerAnalyzer system locale, without the time part. You must enclose the date format string within quotation marks. For more information on the syntax of the date format string, see the PowerAnalyzer online help.

DateValue 97

Page 126: DA_FunctionReference

The following table lists the recognized formats you can use when passing the date string for the 6th day of April, 1984 to the DateValue function. You do not need to pass the date format string to the function for these formats:

Date String Date Format

---------------- ------------

"6-APR-1984" d-MMM-yyyy

"06-APR-1984" dd-MMM-yyyy

"April 6, 1984" MMM d, yyyy

"April 06, 1984" MMM dd, yyyy

"1984/4/6" yyyy/M/d

"1984/04/6" yyyy/MM/d

"1984/4/06" yyyy/M/dd

"1984/04/06" yyyy/MM/dd

"1984.APR.6" yyyy.MMM.d

"1984.APR.06" yyyy.MMM.dd

"4/6/1984" M/d/yyyy

"04/6/1984" MM/d/yyyy

"4/06/1984" M/dd/yyyy

"04/06/1984" MM/dd/yyyy

"1984-APR-6" yyyy-MMM-d

"1984-APR-06" yyyy-MMM-dd

"6.APR.1984" d.MMM.yyyy

"06.APR.1984" dd.MMM.yyyy

"1984-04-06" yyyy-MM-dd

"1984-4-6" yyyy-M-d

98 Chapter 4: Functions

Page 127: DA_FunctionReference

DAY

Returns the day of a date value. The Day function returns the day as an integer, with values ranging from 1 to 31.

This function belongs to the Date & Time category.

SyntaxDay(Date)

Return ValueNumeric

ExamplesAll of the following expressions return the number 10:

Day(Date(2004, 9, 10))

Day(DateValue("2004/06/10"))

Day(Today()), where today's date is October 10, 2004

Day(AddToDate(Today()), 0, 0, 9) where today's date is October 1, 2004

Day({Day Shipped}), where the value of the Day Shipped attribute is July 10, 2003

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

Day 99

Page 128: DA_FunctionReference

DEVSQ

Returns the sum of squared deviations of a set of values from their sample mean. Use this function with a numeric metric or attribute. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Aggregate category.

SyntaxDevSq(List [, Context])

Return ValueNumeric

ExamplesYou have a report that displays the average shelf life (in days) for every product your company sells. To calculate the sum of squared deviations of the average shelf life from its mean, use the following expression:

DevSq({Average Shelf Life})

NotesIf a value is NULL, the DevSq function ignores that row.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

100 Chapter 4: Functions

Page 129: DA_FunctionReference

DFTORATE

Returns the rate, given the discount factor. The discount factor is a number that is multiplied by a monetary value to reduce an expected future sum to its present value. This function is the reverse of the RateToDf function. Use the DfToRate function to compute the rate when the discount factor is known.

This function belongs to the Financial category.

SyntaxDfToRate(DiscountFactor, RateConvention, ElapsedYears)

Return ValueNumeric

ExamplesThe following expression returns 0.055 as the rate:

DfToRate(0.3, "annual", 5)

Argument Datatype Description

DiscountFactor Numeric Required. Discount factor of rate. Must be greater than or equal to 0.

RateConvention String Required. Convention of quoting the rate. The rate can be "annual", "semiannual", "quarterly", "monthly", "weekly", "daily", "discount", "simple" or "continuous". Default value is "annual". Enclose the rate convention within quotation marks.

ElapsedYears Numeric Required. Elapsed years, expressed as a decimal number. Must be greater than or equal to 0.

DfToRate 101

Page 130: DA_FunctionReference

DISC

Returns the discount rate for a security, expressed as a decimal number. To convert it to a percentage, multiply the discount rate by 100.

This function belongs to the Financial category.

SyntaxDisc(SettlementDate, MaturityDate, Price, Redemption [, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 0.24 as the discount rate for a bond:

Disc(DateValue("4/1/2004"), DateValue("6/15/2004"), 95, 100)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Price Numeric Required. Security price per $100 face value. Must be greater than 0.

Redemption Numeric Required. Amount to be received at maturity per $100 face value. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

102 Chapter 4: Functions

Page 131: DA_FunctionReference

DIVIDE

Returns the result of the first numeric value divided by the second numeric value.

This function belongs to the Mathematical category.

SyntaxDivide(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression divides the value of the Profit metric by 2:

Divide({Profit}, 2)

Profit Return Value

------ ------------

1000 500

520.75 260.375

6511 3255.5

0 0

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Divide 103

Page 132: DA_FunctionReference

EFFECT

Returns the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year. The effective annual interest rate is expressed as a decimal number. To convert it to a percentage, multiply the rate by 100.

This function belongs to the Financial category.

SyntaxEffect(Rate, NumberPeriods)

Return ValueNumeric

ExamplesThe following expression returns 0.27 as the effective annual interest rate, when the nominal annual interest rate is 25% and the number of compounding periods per year is 4:

Effect(0.25, 4)

NotesTo calculate the nominal annual interest rate, given the effective annual interest rate and the number of compounding periods per year, use the Nominal function.

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

104 Chapter 4: Functions

Page 133: DA_FunctionReference

ELAPSEDDAYS

Returns the number of days in the period between the specified start time and end time, given a day count basis. You can use this function with date attributes.

This function belongs to the Date & Time category.

SyntaxElapsedDays(Date1, Date2 [, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns the actual number of days in a promotional period:

ElapsedDays(Begin Date}, {End Date}, "ACT/ACT")

Begin Date End Date Return Value

---------- --------- ------------

1/13/2004 3/20/2004 67

3/20/2004 5/5/2004 46

5/5/2004 5/9/2004 4

5/9/2004 9/10/2004 124

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

To get the same result as the Microsoft Excel days360(start_date, end_date, false) function, use the following expression:

ElapsedDays({start_date}, {end_date}, "NASD 30/360")

Argument Datatype Description

Date1 Date Required. Date value you want to pass to the function.

Date2 Date Required. Date value you want to pass to the function.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

ElapsedDays 105

Page 134: DA_FunctionReference

To get the same result as the Microsoft Excel days360(start_date, end_date, true) function, use the following expression:

ElapsedDays({start_date}, {end_date}, "30/360")

106 Chapter 4: Functions

Page 135: DA_FunctionReference

ELAPSEDHOURS

Returns the number of hours in the period between the specified start time and end time. You can use this function with date attributes. The ElapsedHours function precision is milliseconds (expressed as a decimal number).

This function belongs to the Date & Time category.

SyntaxElapsedHours(Date1, Date2)

Return ValueNumeric

ExamplesThe following expression returns the number of hours in a promotional period:

ElapsedHours({Begin Date}, {End Date})

Begin Date End Date Return Value

---------- --------- ------------

1/13/2004 3/20/2004 1608

3/20/2004 5/5/2004 1103

5/5/2004 5/9/2004 96

5/9/2004 9/10/2004 2976

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date1 Date Required. Date value you want to pass to the function.

Date2 Date Required. Date value you want to pass to the function.

ElapsedHours 107

Page 136: DA_FunctionReference

ELAPSEDYEARS

Returns the number of years in the period between the specified start time and end time, given a day count basis. The elapsed number of years is expressed as a decimal number. You can use this function with date attributes.

This function belongs to the Date & Time category.

SyntaxElapsedYears(Date1, Date2 [, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns the number of years in a promotional period:

ElapsedYears({Begin Date}, {End Date})

Begin Date End Date Return Value

---------- --------- ------------

1/13/2000 3/20/2001 1.186

3/20/2001 5/5/2002 1.125

5/5/2002 5/9/2003 1.011

5/9/2002 9/10/2004 2.336

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date1 Date Required. Date value you want to pass to the function.

Date2 Date Required. Date value you want to pass to the function.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

108 Chapter 4: Functions

Page 137: DA_FunctionReference

ENDOFMONTH

Returns the last date in the month for a given date value. You can use the EndOfMonth function to calculate due dates that correspond with the last date of a month. You can use this function to pass a date value to another function.

This function belongs to the Date & Time category.

SyntaxEndOfMonth(Date)

Return ValueDate

ExamplesThe following expression returns the date June 30, 2004:

EndOfMonth(DateValue("2004/06/10"))

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

EndOfMonth 109

Page 138: DA_FunctionReference

EQUALS

Compares two numeric values and returns TRUE if the values are equal or FALSE if the values are not equal. You can use this function to compare metrics or attributes to other metrics, attributes, or constant values.

This function belongs to the Comparative category.

SyntaxEquals(Compare1, Compare2)

Return ValueBoolean

ExamplesYou want to find out which sales personnel made exactly 120 sales in the last month. The following expression compares the Sales metric with 120:

Equals({Sales}, 120)

Sales Return Value

----- ------------

200 FALSE

120 TRUE

122 FALSE

50 FALSE

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

Compare2 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

110 Chapter 4: Functions

Page 139: DA_FunctionReference

EQUALSIGNORECASE

Compares two strings and returns TRUE if the strings are identical or FALSE if the strings are not identical. The function ignores the case of the letters in the two strings. You can use this function to compare two attributes in a report. You can also compare an attribute with a given string value.

This function belongs to the String category.

SyntaxEqualsIgnoreCase(String1, String2)

Return ValueBoolean

ExamplesYou want to find out if a product name is the same as the product category name. The following expression compares the Product Name attribute with the Product Category attribute:

EqualsIgnoreCase({Product Name}, {Product Category})

Product Name Product Category Return Value

--------------- ---------------- ------------

Big Can Drinks Drinks FALSE

drinks Drinks TRUE

National Bottle Drinks FALSE

drinks Supplies FALSE

Argument Datatype Description

String1 String Required. String value you want to pass to the function.

String2 String Required. String value you want to pass to the function.

EqualsIgnoreCase 111

Page 140: DA_FunctionReference

EXP

Returns E raised to the specified power (exponent), where E=2.71828183. For example, EXP(2) returns 7.38905609893065. Most often, you use this function to analyze scientific and technical data, rather than business data. Exp is the opposite of the Log function, which returns the natural logarithm of a numeric value. You can use the Exp function with a numeric metric, numeric attribute, or a calculated numeric value.

This function belongs to the Unary category.

SyntaxExp(NumericValue)

Return ValueNumeric

ExamplesThe following expression uses the values of the Profit metric as the exponent value:

Exp({Profit})

Profit Return Value

------ ------------

10 22026.46579

-2 0.135334

8.55 5166.75443

NULL NULL

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

112 Chapter 4: Functions

Page 141: DA_FunctionReference

EXPONDIST

Returns the exponential distribution. Exponential distribution is used to determine the time between consecutive, rare, and random events in a process with no memory. For example, you can use the ExponDist function to determine the time you have to wait before you get your next phone call. If you pass TRUE as the value of the Cumulative argument, ExponDist returns the cumulative distribution calculation. If you pass FALSE as the value of the Cumulative argument, the function returns the probability density calculation.

This function belongs to the Statistical category.

SyntaxExponDist(X, Lambda, Cumulative)

Return ValueNumeric

ExamplesThe following function returns 0.78 as the exponential distribution when the X argument is 1 and the Lambda argument is 1.5:

ExponDist(1, 1.5, TRUE)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

Lambda Numeric Required. The lambda variable.

Cumulative Boolean Required. Logical value that determines the form of the function. If cumulative is TRUE, the function returns the cumulative answer. Otherwise, it does not return the cumulative answer.

ExponDist 113

Page 142: DA_FunctionReference

FDIST

Returns the F probability distribution. The F probability distribution is typically used to develop hypothesis tests. Use the FDist function to calculate the one-sided probability of the likelihood that two variances are different.

This function belongs to the Statistical category.

SyntaxFDist(X, DegreesOfFreedomNum, DegreesOfFreedomDenom)

Return ValueNumeric

ExamplesYou want to find out if female students are more diverse in their response to a particular question than male students. The standard deviation for female respondents equals 6 and standard deviation for male respondents equals 4. The value of the X argument is 2.25 (X=6*6/4*4). The numerator degrees of freedom is 39 and the denominator degrees of freedom is 64. The following expression returns 0.0019 as the F probability distribution:

FDist(2.25, 39, 64)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be greater than or equal to 0.

DegreesOfFreedomNum Numeric Required. Whole number representing the numerator degrees of freedom numerator. Must be between 1 and 10,000, inclusive.

DegreesOfFreedomDenom Numeric Required. Whole number representing the denominator degrees of freedom. Must be between 1 and 10,000, inclusive.

114 Chapter 4: Functions

Page 143: DA_FunctionReference

FINV

Returns the inverse of the probability associated with a F distribution. The Probability argument passed to the FInv function is the probability associated with the F distribution. The F probability distribution is typically used to develop hypothesis tests.

This function belongs to the Statistical category.

SyntaxFInv(Probability, DegreesOfFreedomNum, DegreesOfFreedomDenom)

Return ValueNumeric

ExamplesYou are conducting a hypothesis test to determine the degree of variability in two data sets. The numerator degrees of freedom is 39 and the denominator degrees of freedom is 64. The probability associated with the hypothesis test is 0.0019. The following expression returns 2.25 as the inverse of the probability associated with the F distribution:

FInv(0.0019, 39, 64)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution. Must be between 0 and 1, inclusive.

DegreesOfFreedomNum Numeric Required. Whole number representing the numerator degrees of freedom numerator. Must be between 1 and 10,000, inclusive.

DegreesOfFreedomDenom Numeric Required. Whole number representing the denominator degrees of freedom. Must be between 1 and 10,000, inclusive.

FInv 115

Page 144: DA_FunctionReference

FV

Returns the future value of an investment, where you make periodic, constant payments and the investment earns a constant interest rate. The Rate argument represents the interest rate earned in each period. PresentValue is the current value of the investment. If you omit the PresentValue argument, the FV function assumes it to be 0.

This function belongs to the Financial category.

SyntaxFV(Rate, NumberPeriods, Payment [, PresentValue, PaymentAtBeginning, CurrencyDecimals])

Return ValueNumeric

ExamplesYou deposit $2,000 into an account that earns 9 percent annual interest compounded monthly (monthly interest of 9%/12, or 0.75%). You plan to deposit $250 at the beginning of every month for the next 12 months. The following expression returns $5,337.96 as the amount that will be in the account at the end of 12 months:

FV(0.0075, 12, -250, -2000, TRUE)

NotesTo calculate interest rate earned in each period, divide the annual rate by the number of payments made in an year.

The payment value and present value are negative because these are amounts that you pay.

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

Payment Numeric Required. Payment amount due.

PresentValue Numeric Optional. Current value of an asset or liability.

PaymentAtBeginning Boolean Optional. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

116 Chapter 4: Functions

Page 145: DA_FunctionReference

FACTORIAL

Returns the factorial (n!) of a number, where n! equals 1*2*3*...*n. Use this function in mathematical calculations. If the number you pass to the function is not an integer, PowerAnalyzer truncates the number.

This function belongs to the Mathematical category.

SyntaxFactorial(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns the factorial of the values of the Numbers metric:

Factorial({Numbers})

Numbers Return Value

------- ------------

6 720

1 1

5 120

2.2 2

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. Must be greater than or equal to 0.

Factorial 117

Page 146: DA_FunctionReference

FIND

Finds a text string (Find argument) within another text string (String argument), and returns the number of the starting position of the Find argument text within the String argument text. By default, PowerAnalyzer searches the string from beginning to end. You can have the Find string search from end to beginning by passing TRUE to the FromEnd argument. If the Find text does not exist within the String text, PowerAnalyzer returns NULL.

This function belongs to the String category.

SyntaxFind(String, Find [, FromEnd])

Return ValueNumeric

ExamplesThe following expression returns the number of the starting position of the text "on" within the value of the Product Status attribute:

Find({Product Status}, "on")

Product Status Return Value

-------------- ------------

Now, on stock 6

Not available NULL

On Stock NULL

NotesYou can use the Substring function within the PowerAnalyzer Find function to generate results similar to Excel. For example, in Excel you can specify the position to start the search:

Find("For", "DressesForYou", 8)

In PowerAnalyzer, use the following expression to return the same result as above:

Find(Substring("DressesForYou", 8), "For") + 7

Argument Datatype Description

String String Required. String value you want to pass to the function.

Find String Required. String to find within other string.

FromEnd Boolean Optional. Starting position of the search. Default is FALSE. Enter TRUE to start the search from the end of the string.

118 Chapter 4: Functions

Page 147: DA_FunctionReference

FISHER

Returns the Fisher transformation for a given value. Fisher returns a value that is an approximately normally distributed value rather than a skewed one. You can use the Fisher transformation to test hypothesis on the correlation coefficient.

This function belongs to the Statistical category.

SyntaxFisher(X)

Return ValueNumeric

ExamplesThe following function returns 0.73 as the Fisher transformation for 0.62:

Fisher(0.62)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

Fisher 119

Page 148: DA_FunctionReference

FISHERINV

Returns the statistical inverse of the Fisher transformation. You can use this function when determining the relationship between ranges or arrays of data.

This function belongs to the Statistical category.

SyntaxFisherInv(X)

Return ValueNumeric

ExamplesThe following function returns 0.62 as the inverse of Fisher transformation:

FisherInv(0.73)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

120 Chapter 4: Functions

Page 149: DA_FunctionReference

FLOOR

Returns the value rounded down to the specified number of digits, towards positive infinity. The PowerAnalyzer Floor function differs from the Microsoft Excel Floor function. In the PowerAnalyzer Floor function, Significance is the number of digits to the right of the decimal point. In the Excel Floor function, Significance is the multiple to which you want to round. The PowerAnalyzer Floor function rounds a number towards positive infinity, whereas the Excel Floor function rounds a number away from zero.

This function belongs to the Rounding category.

SyntaxFloor(NumericValue [, Significance])

Return ValueNumeric

ExamplesThe following expression returns the number rounded down to the significance, towards positive infinity:

Floor({Number}, {Significance})

Number Significance Return Value

------ ------------ ------------

2.425 1 2.4

-2.425 1 -2.5

2.425 2 2.42

-2.425 2 -2.43

2.425 3 2.424

-2.425 3 -2.425

2.425 0 2

245 -1 240

245 -2 200

245 -3 0

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Significance Numeric Optional. Number of places to the right of decimal point. Negative value indicates number of places to the left of decimal point. Default is 0.

Floor 121

Page 150: DA_FunctionReference

NotesTo generate the same result as the Excel Floor(value, significance) function, use the following expression:

RoundDown(value/significance) * significance

122 Chapter 4: Functions

Page 151: DA_FunctionReference

FORECAST

Predicts a future value based on existing values. You can use this function to determine future sales, inventory levels, or trends. You pass a single value and two sets of values (ListY and ListX) to the Forecast function. The single value is a ListX value. The function returns a predicted ListY value for the given ListX value. The function uses linear regression to predict the ListY value. Pass numeric metrics or attributes as the values for the ListY and ListX arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the ListY argument and the Context2 argument corresponds to the ListX argument.

This function belongs to the Aggregate category.

SyntaxForecast(X, ListY, ListX [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 4534.59 as the forecasted sales for the year 2004 for T-shirts, given that sales for the last year were $5000:

Forecast(5000, {2004 Sales}, {2003 Sales}, "{Prod Category}='Women'"}, "{Prod Category}='Women'"})

Prod Category 2004 Sales 2003 Sales

------------- ---------- ----------

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

ListY Numeric List Required. Name of a metric or attribute representing known dependent values.

ListX Numeric List Required. Name of a metric or attribute representing known independent values.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Forecast 123

Page 152: DA_FunctionReference

Women 1500 2500

Women 5000 2250

Men 38088 10502

Women 6200 800

Women 750 150

Women 2000 750

Men 28195 6974

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

124 Chapter 4: Functions

Page 153: DA_FunctionReference

GAMMADIST

Returns the gamma distribution. The return value of the GammaDist function is the probability that a gamma-distributed random variable with arguments alpha and beta is less than or equal to x. You can use this function to study variables that may have a skewed distribution.

This function belongs to the Statistical category.

SyntaxGammaDist(X, Alpha, Beta)

Return ValueNumeric

ExamplesYou need to know the time taken to send shipments from the warehouse to the store. The value of the gamma-distributed random variable (X) is 40. The value of alpha is 4 and the value of beta is 10. The following expression returns 0.567 as the gamma distribution probability:

GammaDist(40, 4, 10)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be greater than or equal to 0.

Alpha Numeric Required. The alpha variable. Must be greater than 0.

Beta Numeric Required. The beta variable. Must be greater than 0.

GammaDist 125

Page 154: DA_FunctionReference

GAMMAINV

Returns the inverse of the gamma cumulative distribution. The Probability argument passed to the GammaInv function is the probability associated with the gamma cumulative distribution. Use this function to test a variable whose distribution may be skewed.

This function belongs to the Statistical category.

SyntaxGammaInv(Probability, Alpha, Beta)

Return ValueNumeric

ExamplesYou need to know the time taken to send shipments from the warehouse to the store. The probability associated with the gamma cumulative distribution is 0.56. The value of alpha is 4 and the value of beta is 10. The following expression returns 40.024 as the value of X:

GammaDist(0.567, 4, 10)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution. Must be between 0 and 1, inclusive.

Alpha Numeric Required. The alpha variable. Must be greater than 0.

Beta Numeric Required. The beta variable. Must be greater than 0.

126 Chapter 4: Functions

Page 155: DA_FunctionReference

GAMMALOG

Returns the natural logarithm of the gamma function.

This function belongs to the Statistical category.

SyntaxGammaLog(X)

Return ValueNumeric

ExamplesThe following expression returns 10.60 as the natural logarithm of the gamma function:

GammaLog(9)

NotesThe number e raised to the GammaLog(X) power equals (X - 1)!. The following expression returns 24, which is the same as 4!:

Exp(GammaLog(5))

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be greater than or equal to 0.

GammaLog 127

Page 156: DA_FunctionReference

GEOMEAN

Returns the geometric mean of a set of values, where each value must be a positive value. Pass numeric metrics or attributes as the List argument. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Aggregate category.

SyntaxGeoMean(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 5.36 as the geometric mean of the Percent Growth metric for products belonging to the Drinks and Food category:

GeoMean({Percent Growth}, "{Category}='Drinks', 'Food'")

Category Percent Growth

-------- --------------

Drinks 5.5

Food 7

Drinks 4

Snacks 20

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

128 Chapter 4: Functions

Page 157: DA_FunctionReference

GREATERTHAN

Compares two numeric values. You can use this function to compare metrics or attributes to other metrics, attributes, or constant values.

This function belongs to the Comparative category.

SyntaxGreaterThan(Compare1, Compare2)

Return ValueBoolean. Returns TRUE if the first value is greater than the second value. Returns FALSE if the first value is not greater than the second value.

ExamplesThe following expression compares the two metrics and returns TRUE if eastern region sales are greater than western region sales:

GreaterThan({Eastern Sales}, {Western Sales})

Eastern Sales Western Sales Return Value

------------- ------------- ------------

200 220 FALSE

120 121 FALSE

122 122 FALSE

250 205 TRUE

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

Compare2 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

GreaterThan 129

Page 158: DA_FunctionReference

GREATERTHANEQUALS

Compares two numeric values. You can use this function to compare metrics or attributes to other metrics, attributes, or constant values.

This function belongs to the Comparative category.

SyntaxGreaterThanEquals(Compare1, Compare2)

Return ValueBoolean. Returns TRUE if the first value is greater than or equal to the second value. Returns FALSE if the first value is less than the second value.

ExamplesThe following expression compares the two metrics and returns TRUE if eastern region sales are greater than western region sales:

GreaterThanEquals({Eastern Sales}, {Western Sales})

Eastern Sales Western Sales Return Value

------------- ------------- ------------

200 220 FALSE

120 121 FALSE

122 122 TRUE

250 205 TRUE

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

Compare2 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

130 Chapter 4: Functions

Page 159: DA_FunctionReference

HARMEAN

Returns the harmonic mean of a set of values, where each value must be a positive value. The harmonic mean is the reciprocal of the arithmetic mean of reciprocals.

This function belongs to the Aggregate category.

SyntaxHarMean(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 14.268 as the harmonic mean of the Percent Growth metric for products belonging to the Drinks and Food category:

HarMean({Percent Growth}, "{Category}='Drinks';{Category}='Food'")

Category Percent Growth

-------- --------------

Drinks 13

Food 12

Drinks 20

Snacks 7

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

HarMean 131

Page 160: DA_FunctionReference

HOUR

Returns a number representing the hour of the day of a date value. The function returns the hour as an integer with values ranging from 0 to 23.

This function belongs to the Date & Time category.

SyntaxHour(Date)

Return ValueNumeric

ExamplesThe following expression returns the hour of the day of each Date Shipped attribute value:

Hour({Date Shipped})

Date Shipped Return Value

---------------- ------------

2004-03-10 2:15 2

2004-06-06 14:53 14

2004-06-01 7:20 7

2003-12-15 0:37 0

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

132 Chapter 4: Functions

Page 161: DA_FunctionReference

HYPGEOMDIST

Returns the value of the statistical hypergeometric distribution. Hypergeometric distribution is the probability of a given number of sample successes, where the sample size, population successes, and population size is known. You can use this function for experiments in which each observation is either a success or a failure, and where each subset of a given size is chosen with equal likelihood.

This function belongs to the Statistical category.

SyntaxHypGeomDist(X, SampleSize, Successes, PopulationSize)

Return ValueNumeric

ExamplesA test consists of 20 questions. For each question, the answer can be true or false. There are 8 questions with a true answer and 12 questions with a false answer. You select 4 questions at random. The following expression returns 0.363 as the probability that exactly 1 answer is true of the 4 selected questions:

HypGeomDist(1, 4, 8, 20)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be between 0 and Successes, inclusive.

SampleSize Numeric Required. Number of elements in the sample. Must be between 0 and PopulationSize, inclusive.

Successes Numeric Required. Number of successes in the population. Must be less than or equal to PopulationSize.

PopulationSize Numeric Required. Number of elements in the population.

HypGeomDist 133

Page 162: DA_FunctionReference

IRR

Returns the internal rate of return for a series of cash flows represented by a set of values. These cash flows do not have to be of equal value, but they must occur at regular intervals, such as monthly or annually. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Financial category.

SyntaxIRR(CashFlows [, Context])

Return ValueNumeric

ExamplesThe following expression returns 0.12 as the internal rate of return of an investment:

IRR({Cash Flows})

Cash Flows

----------

-15000

10000

5000

2000

1000

NotesThe cash flows must include at least one positive and at least one negative value.

To calculate the internal rate of return for cash flows that do not occur at regular intervals, use the XIRR function.

Argument Datatype Description

CashFlows Numeric List Required. Name of a metric or attribute representing a series of cash flows.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

134 Chapter 4: Functions

Page 163: DA_FunctionReference

IF

Returns one of two specified values based on the results of a condition.

This function belongs to the Conditional category.

SyntaxIf(If, True, False)

Return ValueVaries

ExamplesTo offer a 7% discount on products costing less than $50 and a 10% discount on all other products, use the following expression:

If(({Price} < 50), 7, 10)

Price Return Value

----- ------------

45.50 7

69.99 10

5.59 7

NotesThe values of the True and False arguments must be of the same datatype.

Argument Datatype Description

If Boolean Required. Boolean input for conditional test.

True Varies Required. Object to be returned if test results are true.

False Varies Required. Object to be returned if test results are false.

If 135

Page 164: DA_FunctionReference

IFNULL

Returns the specified value if a condition returns NULL. Use to replace NULL in a metric or attribute.

This function belongs to the Conditional category.

SyntaxIfNull(List, ReturnValue [, OtherValue])

Return ValueVaries

ExamplesTo grant a $1000 bonus to sales employees whose bonuses have not yet been calculated, use the following expression:

IfNull({Bonus}, 1000)

Bonus Return Value

----- ------------

5000 5000

NULL 1000

NULL 1000

2300 2300

NotesThe values of the List, ReturnValue, and OtherValue arguments must be of the same datatype.

Argument Datatype Description

List Varies Required. Name of a metric or attribute.

ReturnValue Varies Required. Return value if a the metric or attribute value is NULL.

OtherValue Varies Optional. Return value if a metric or attribute value is not NULL.

136 Chapter 4: Functions

Page 165: DA_FunctionReference

INTDIVIDE

Divides one numeric value by another and returns the integer part of the quotient (result of the division).

This function belongs to the Mathematical category.

SyntaxIntDivide(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression divides the value of the Profit metric by 8 and returns the integer part of the quotient:

IntDivide({Profit}, 8)

Profit Return Value

------ ------------

18 2

24 3

20.25 2

26 3

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

IntDivide 137

Page 166: DA_FunctionReference

INTRATE

Returns the interest rate for a fully-invested security. The interest rate is expressed as a decimal number. To convert it to a percentage, multiply the interest rate by 100.

This function belongs to the Financial category.

SyntaxIntRate(SettlementDate, MaturityDate, Investment, Redemption [, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 0.055 as the interest rate for a fully-invested coupon:

IntRate(Date(2004,3,31), Date(2004,9,30), 20000, 20550, "30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Investment Numeric Required. Amount invested in the security. Must be greater than 0.

Redemption Numeric Required. Amount to be received at maturity per $100 face value. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

138 Chapter 4: Functions

Page 167: DA_FunctionReference

KURT

Returns the kurtosis of a set of values. You can use kurtosis to compare the relative peakedness or flatness of a distribution with the normal distribution. Positive kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a relatively flat distribution. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Aggregate category.

SyntaxKurt(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns -0.1875 as the kurtosis of the Percent Growth metric for products belonging to the Drinks and Food category:

Kurt({Percent Growth}, "{Category}='Drinks', 'Food'")

Category Percent Growth

-------- --------------

Drinks 3

Food 2

Drinks 5

Snacks 7

Drinks 7

Snacks 9

Food 3

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Kurt 139

Page 168: DA_FunctionReference

LEN

Returns the number of characters in a text string.

This function belongs to the String category.

SyntaxLen(String)

Return ValueNumeric

ExamplesThe following expression returns 14:

Len("Sacramento, CA")

The following expression returns the number of characters for each value of the State attribute:

Len({State})

State Return Value

-------- ------------

Ohio 4

Hawaii 6

New York 8

Oregon 6

Argument Datatype Description

String String Required. String value you want to pass to the function.

140 Chapter 4: Functions

Page 169: DA_FunctionReference

LESSTHAN

Compares two numeric values You can use this function to compare metrics or attributes to other metrics, attributes, or constant values.

This function belongs to the Comparative category.

SyntaxLessThan(Compare1, Compare2)

Return ValueBoolean. Returns TRUE if the first value is less than the second value. Returns FALSE if the first value is not less than the second value.

ExamplesThe following expression compares two metrics and returns TRUE if eastern region sales are less than western region sales:

LessThan({Eastern Sales}, {Western Sales})

Eastern Sales Western Sales Return Value

------------- ------------- ------------

200 220 TRUE

120 121 TRUE

122 122 FALSE

250 205 FALSE

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

Compare2 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

LessThan 141

Page 170: DA_FunctionReference

LESSTHANEQUALS

Compares two numeric values. You can use this function to compare metrics or attributes to other metrics, attributes, or constant values.

This function belongs to the Comparative category.

SyntaxLessThanEquals(Compare1, Compare2)

Return ValueBoolean. Returns TRUE if the first value is less than or equal to the second value. Returns FALSE if the first value is greater than the second value.

ExamplesThe following expression compares two metrics and returns TRUE if eastern region sales were greater than western region sales:

LessThanEquals({Eastern Sales}, {Western Sales})

Eastern Sales Western Sales Return Value

------------- ------------- ------------

200 220 TRUE

120 121 TRUE

122 122 TRUE

250 205 FALSE

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

Compare2 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

142 Chapter 4: Functions

Page 171: DA_FunctionReference

LOG

Returns the natural logarithm of a numeric value. The Log function uses E as the base for the logarithm calculation.

This function belongs to the Mathematical category.

SyntaxLog(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns the natural logarithm of all values in the Number metric:

Log({Number})

Number Return Value

------ ------------

10 2.30

100 4.61

835.92 6.73

2 0.69

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

Log 143

Page 172: DA_FunctionReference

LOG10

Returns the base 10 logarithm of a numeric value.

This function belongs to the Mathematical category.

SyntaxLog10(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns the base 10 logarithm of all values in the Number metric:

Log({Number})

Number Return Value

------ ------------

10 1.00

100 2.00

835.92 2.92

2 0.30

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

144 Chapter 4: Functions

Page 173: DA_FunctionReference

LOG2

Returns the base 2 logarithm of a numeric value.

This function belongs to the Mathematical category.

SyntaxLog2(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns the base 2 logarithm of all values in the Number metric:

Log({Number})

Number Return Value

------ ------------

10 3.32

100 6.64

835.92 9.71

2 1.00

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

Log2 145

Page 174: DA_FunctionReference

LOWER

Converts uppercase string characters to lowercase.

This function belongs to the String category.

SyntaxLower(String)

Return ValueString

ExamplesThe following expression returns all values in the Customer Name metric in lowercase:

Lower({Customer Name})

Customer Name Return Value

------------- ------------

ruby ruby

Rachel rachel

MATTHEW matthew

LeBron lebron

Argument Datatype Description

String String Required. String value you want to pass to the function.

146 Chapter 4: Functions

Page 175: DA_FunctionReference

MAX

Returns the maximum value of a numeric metric or attribute.

This function belongs to the Aggregate category.

SyntaxMax(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 8.99 as maximum cost for products in your inventory:

Max({Cost})

Cost

----

5.96

1.56

8.99

6.56

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Max 147

Page 176: DA_FunctionReference

MAX2

Returns the maximum of two numeric values.

This function belongs to the Mathematical category.

SyntaxMax2(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression returns the maximum of the Domestic Sales and Overseas Sales metrics:

Max2({Domestic Sales}, {Overseas Sales})

Domestic Sales Overseas Sales Return Value

-------------- -------------- ------------

500865 200000 500865

8000 20000 20000

45000 1000 45000

1000 45000 45000

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

148 Chapter 4: Functions

Page 177: DA_FunctionReference

MEDIAN

Returns the median value for a numeric metric or attribute. In a set of numeric data in ascending or descending order, the median is the value in the middle of the data set with an equal number of values distributed above and below that value. When there is an even number of values in the set, median is the average of the two numbers in the middle. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Aggregate category.

SyntaxMedian(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 5.5 as the median weight for all products:

Median({Weight})

Weight

------

10

5.5

3.7

NotesThis function returns the middle value when the data set has an odd number of values. It returns the average of the two middle values when the data set has even number of values. This function ignores NULLs when performing the calculation.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Median 149

Page 178: DA_FunctionReference

MIN

Returns the minimum value of a numeric metric or attribute.

This function belongs to the Aggregate category.

SyntaxMin(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 1.00 as the minimum profit margin among all products:

Min({Profit})

Profit

------

2.50

1.00

7.50

1.01

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

150 Chapter 4: Functions

Page 179: DA_FunctionReference

MIN2

Returns the minimum of two numeric values.

This function belongs to the Mathematical category.

SyntaxMin2(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression returns the minimum of the Domestic Sales and Overseas Sales metrics:

Min2({Domestic Sales}, {Overseas Sales})

Domestic Sales Overseas Sales Return Value

-------------- -------------- ------------

500865 200000 200000

8000 20000 8000

45000 1000 1000

1000 45000 1000

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Min2 151

Page 180: DA_FunctionReference

MINUTE

Returns the minutes of the time part of a date value. The function returns the minutes as an integer with values ranging from 0 to 59.

This function belongs to the Date & Time category.

SyntaxMinute(Date)

Return ValueNumeric

ExamplesThe following expression returns the minutes of the hour of the Date Shipped attribute value:

Minute({Date Shipped})

Date Shipped Return Value

---------------- ------------

2004-03-10 2:15 15

2004-06-06 14:53 53

2004-06-01 7:20 20

2003-12-15 0:37 37

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

152 Chapter 4: Functions

Page 181: DA_FunctionReference

MOD

Returns the modulus, the remainder of a division calculation, for any numeric metric or attribute.

This function belongs to the Mathematical category.

SyntaxMod(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesUse the following expression to determine the remainders of sales divided by 10:

Mod({Sales}, 10)

Sales Return Value

----- ------------

1500 0

7125 5

3500 0

1095 5

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Mod 153

Page 182: DA_FunctionReference

MODE

Returns the value that occurs most frequently in a numeric metric or attribute. When more than one value occurs at the greatest frequency, then the Mode function returns the first value to reach the greatest frequency.

This function belongs to the Aggregate category.

SyntaxMode(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 55000 as the most common salary:

Mode({Salary})

Salary

------

55000

120000

35000

85000

55000

NotesThis function ignores NULLs when performing the calculation. If no value occurs more than once, PowerAnalyzer returns NULL.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

154 Chapter 4: Functions

Page 183: DA_FunctionReference

MONTH

Returns the month of a date value. The function returns the month as an integer, with values ranging from 1 (January) to 12 (December).

This function belongs to the Date & Time category.

SyntaxMonth(Date)

Return ValueNumeric

ExamplesAll of the following examples return the number 9:

Month(Date(2004, 9, 10))

Month(DateValue("15-Sep-2004"))

Month(Today()), where today's date is September 10, 2004

Month(AddToDate(Today()), 0, 0, 9) where today's date is September 1, 2004

Month({Day Shipped}), where the value of the Day Shipped attribute is September 10, 2003

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

Month 155

Page 184: DA_FunctionReference

MOVINGAVG

Returns the average (row-by-row) of a specified set of values. The Size argument defines the row set, or window, for which you want to calculate the moving average. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

This function belongs to the Running category.

SyntaxMovingAvg(List, Size [, Context])

Return ValueNumeric List

ExamplesIf you want to calculate the moving average for the Sales metric, five rows at a time, use the following expression. The function returns the average for a set of five rows: 358 based on rows one through five, 245.8 based on rows two through six, and 243 based on rows three through seven. For the first four rows, the function does not perform the moving average calculation and returns the same value as the metric value.

MovingAvg({Sales}, 5)

Sales Return Value

----- ------------

600 600

504 504

36 36

100 100

550 358

39 245.8

490 243

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Size Numeric Required. Number of elements for which you want to perform the calculation.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

156 Chapter 4: Functions

Page 185: DA_FunctionReference

NotesThis function ignores NULLs when performing the calculation.

MovingAvg 157

Page 186: DA_FunctionReference

MOVINGSUM

Returns the cumulative sum (row-by-row) of a specified set of values. The Size argument defines the row set, or window, for which you want to calculate the moving sum. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

This function belongs to the Running category.

SyntaxMovingSum(List, Size [, Context])

Return ValueNumeric List

ExamplesIf you want to calculate the moving average for the Sales metric, five rows at a time, use the following expression. The function returns the sum for a set of five rows: 1790 based on rows one through five, 1229 based on rows two through six, and 1215 based on rows three through seven. For the first four rows, the function does not perform the moving sum calculation and returns the same value as the metric value.

MovingSum({Sales}, 5)

Sales Return Value

----- ------------

600 600

504 504

36 36

100 100

550 1790

39 1229

490 1215

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Size Numeric Required. Number of elements for which you want to perform the calculation.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

158 Chapter 4: Functions

Page 187: DA_FunctionReference

NotesThis function ignores NULLs when performing the calculation.

MovingSum 159

Page 188: DA_FunctionReference

MULTIPLY

Returns the product of one numeric value multiplied by another.

This function belongs to the Mathematical category.

SyntaxMultiply(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression multiplies the values of the Profit per Item and Quantity Sold metrics:

Multiply({Profit per Item}, {Quantity Sold})

Profit per Item Quantity Sold Return Value

--------------- ------------- ------------

5 600 3000

2 504 1008

0 36 0

3 100 300

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

160 Chapter 4: Functions

Page 189: DA_FunctionReference

NPV

Calculates the net present value of an investment by using a discount rate and a series of cash flows. Use a metric to pass the cash flow values to the function. These cash flows do not have to be of equal value, but they must occur at regular periods of time, such as monthly or annually. In the cash flow, negative values represent future payments and positive values represent income. As the value of the Rate argument, pass the rate of discount over the length of one period. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Financial category.

SyntaxNPV(CashFlows, Rate [, CurrencyDecimals, Context])

Return ValueNumeric

ExamplesThe following expression returns 31807.54 as the net present value of the asset after five months:

NPV({Cash Flows}, 0.12, "{Month}='January', 'February', 'March', 'April', 'May'")

Month Cash Flows

--------- ----------

January 13253.74

February 6392.94

March 10502.07

April 5420.59

Argument Datatype Description

CashFlows Numeric List Required. Name of a metric or attribute representing a series of cash flows.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

NPV 161

Page 190: DA_FunctionReference

May 6974.26

June 89114.60

July 9174.55

August 6974.26

September 10502.07

October 6974.26

November 13253.74

December 7774.11

NotesWhen you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

162 Chapter 4: Functions

Page 191: DA_FunctionReference

NPER

Returns the number of periods for an investment based on a constant interest rate and periodic, constant payments. The value of the Rate argument is the interest rate earned in each period. PresentValue is the lump-sum amount that a series of future payments is worth now. FutureValue is the cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the NPer function assumes it to be 0. For example, the future value of a loan is 0.

This function belongs to the Financial category.

SyntaxNPer(Rate, PresentValue, Payment [, FutureValue, PaymentAtBeginning])

Return ValueNumeric

ExamplesThe present value of an investment is $2,000. Each payment is $500 and the future value of the investment is $20,000. The following expression returns 9 as the number of periods for which you need to make the payments:

NPer(0.01, -2000, -500, 20000, TRUE)

NotesTo calculate interest rate earned in each period, divide the annual rate by the number of payments made in an year. For example, if you make monthly payments at an annual interest rate of 15 percent, the value of the Rate argument is 15% divided by 12. If you make annual payments, the value of the Rate argument is 15%.

The payment value and present value are negative because these are amounts that you pay.

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

PresentValue Numeric Required. Current value of an asset or liability.

Payment Numeric Required. Payment amount due. Must not equal 0.

FutureValue Numeric Optional. Worth of an asset in the future.

PaymentAtBeginning Boolean Optional. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

NPer 163

Page 192: DA_FunctionReference

NEGATE

Adds the minus sign to a positive number or removes the minus sign from a negative number. You can use the Negate function with a numeric metric, numeric attribute, or a calculated numeric value. You can also use this function within other functions, where you need to change the sign of a numeric value.

This function belongs to the Unary category.

SyntaxNegate(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns -10:

Negate(10)

The following expression returns 10:

Negate(-10)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

164 Chapter 4: Functions

Page 193: DA_FunctionReference

NEXT

Returns the next value for the specified metric.

This function belongs to the Fetch category.

SyntaxNext(Metric)

Return ValueVaries

ExamplesThe following expression returns the revenue from the next row:

Next({Revenue})

Revenue Return Value

------- ------------

1500 7125

7125 3500

3500 1090

1090 NULL

NotesThe function returns NULL if the specified value is the last value in the metric.

Argument Datatype Description

Metric Varies Required. Metric for which you want to get the value.

Next 165

Page 194: DA_FunctionReference

NEXTDATE

Returns the next date in a period or payment schedule.

This function belongs to the Date & Time category.

SyntaxNextDate(Date, Frequency [, NumberPeriods])

Return ValueDate

ExamplesThe following expression returns December 30, 2004 as the next payment date for a loan:

NextDate(Date(2004,6,30),"semiannual")

You can pass the NumberPeriods argument to get the payment date after a given number of periods. For example, the following expression returns December 30, 2007 as the date for the 7th payment:

NextDate(Date(2004,6,30),"semiannual", 7)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

Frequency String Required. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

NumberPeriods Numeric Optional. Number of periods or payments. Must be greater than 0.

166 Chapter 4: Functions

Page 195: DA_FunctionReference

NOMINAL

Returns the nominal annual interest rate, given the effective rate and the number of compounding periods per year.

This function belongs to the Financial category.

SyntaxNominal(Rate, NumberPeriods)

Return ValueNumeric

ExamplesThe effective interest rate for a security is 7.25%. The number of compounding periods per year is four. The following expression returns 0.070 as the nominal interest rate:

Nominal(0.0725, 4)

NotesTo calculate the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year, use the Effect function.

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

Nominal 167

Page 196: DA_FunctionReference

NORMDIST

Returns the normal distribution for a number, given the mean and standard deviation. Normal distributions have a wide range of applications in statistics. You can use the NormDist function to derive many kinds of statistical tests. If you pass TRUE as the value of the Cumulative argument, NormDist returns the cumulative distribution calculation. If you pass FALSE as the value of the Cumulative argument, the function returns the probability mass calculation.

This function belongs to the Statistical category.

SyntaxNormDist(X, Mean, StdDev, Cumulative)

Return ValueNumeric

ExamplesThe mean time to process an order is 30 days and the standard deviation is 5. You want to find the probability that an order will be processed in 35 days or less. The following expression returns 0.841 as the value of the normal cumulative distribution:

NormDist(35, 30, 5, true)

If you want to find the probability that an order will be processed in exactly 35 days, pass FALSE as the value of the Cumulative argument. The following expression returns the value 0.048:

NormDist(35, 30, 5, false)

NotesIf you pass zero as the value of the Mean argument and one as the value of the StdDev argument, the NormDist function returns the same result as the NormSDist (standard normal distribution) function.

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

Mean Numeric Required. Average of a list of numbers.

StdDev Numeric Required. Standard deviation of a list of numbers. Must be greater than 0.

Cumulative Boolean Required. Logical value that determines the form of the function. If cumulative is TRUE, the function returns the cumulative answer. Otherwise, it does not return the cumulative answer.

168 Chapter 4: Functions

Page 197: DA_FunctionReference

NORMINV

Returns the inverse of the normal cumulative distribution, given the mean and standard deviation. The Probability argument passed to the NormInv function is the probability associated with the normal distribution.

This function belongs to the Statistical category.

SyntaxNormInv(Probability, Mean, StdDev)

Return ValueNumeric

ExamplesYou are analyzing the time it takes for to process customer orders. The mean time to process an order is 30 days and the standard deviation is 5. For a probability of 0.85, you want to find the maximum number of days it will take to process an order. The following expression returns the value 35.18 (or about 35 days):

NormInv(0.85, 30, 5)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution.

Mean Numeric Required. Average of a list of numbers.

StdDev Numeric Required. Standard deviation of a list of numbers. Must be greater than 0.

NormInv 169

Page 198: DA_FunctionReference

NORMSDIST

Returns the standard normal cumulative distribution, where the mean is zero and the standard deviation is one.

This function belongs to the Statistical category.

SyntaxNormSDist(X)

Return ValueNumeric

ExamplesThe following expression returns 0.869 as the value of the standard normal cumulative distribution:

NormSDist(1.12)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

170 Chapter 4: Functions

Page 199: DA_FunctionReference

NORMSINV

Returns the inverse of the standard normal cumulative distribution. In a standard normal cumulative distribution the mean is zero and the standard deviation is one. The Probability argument passed to the NormSInv function is the probability associated with the standard normal cumulative distribution.

This function belongs to the Statistical category.

SyntaxNormSInv(Probability)

Return ValueNumeric

ExamplesThe following expression returns 1.121 as the inverse of the standard normal cumulative distribution:

NormSInv(0.869)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution.

NormSInv 171

Page 200: DA_FunctionReference

NOT

Returns the reverse of a TRUE or FALSE value passed to the function. If you pass TRUE, the Not function returns FALSE. If you pass FALSE, the Not function returns TRUE. Use this function within an expression, where you want get the reverse Boolean value of a given value.

This function belongs to the Boolean category.

SyntaxNot(BooleanValue)

Return ValueBoolean

ExamplesThe following expression returns FALSE:

Not(10>7)

Argument Datatype Description

BooleanValue Boolean Required. Boolean condition you want to pass to the function.

172 Chapter 4: Functions

Page 201: DA_FunctionReference

NOTEQUALS

Compares two numeric values. You can use this function to compare metrics or attributes to other metrics, attributes, or constant values.

This function belongs to the Comparative category.

SyntaxNotEquals(Compare1, Compare2)

Return ValueBoolean. Returns TRUE if the first value is not equal to the second value. Returns FALSE if the two values are equal.

ExamplesThe following expression compares two metrics and returns TRUE if the Price in 2004 is different than the Price in 2004:

NotEquals({Price in 2003}, {Price in 2004})

Price in 2003 Price in 2003 Return Value

------------- ------------- ------------

2.01 3.66 TRUE

5.2 7.85 TRUE

12 12 FALSE

9.5 8 TRUE

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

Compare2 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

NotEquals 173

Page 202: DA_FunctionReference

NOW

Returns the value of the current date and time. You can use this function to pass a date value to another function.

This function belongs to the Date & Time category.

SyntaxNow()

Return ValueDate

ExamplesThe following expression returns 12 given that today's date is June 3, 2004 and the current time is 12:30 pm:

Hour(Now())

174 Chapter 4: Functions

Page 203: DA_FunctionReference

NUMBERSTRING

Converts a number into a string. Use this function to pass values to other functions that take string arguments.

This function belongs to the String category.

SyntaxNumberString(X)

Return ValueString

ExamplesThe following expression converts values in the Customer Rating attribute to strings:

NumberString({Customer Rating})

Customer Rating Return Value

--------------- ------------

6 5

5.2 5.2

3 3

9.5 9.5

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

NumberString 175

Page 204: DA_FunctionReference

OR

Compares two conditions and returns TRUE if either of the two conditions is TRUE. Returns FALSE if both conditions are FALSE. You can use metric and attribute names in the arguments.

This function belongs to the Boolean category.

SyntaxOr(BooleanValue1, BooleanValue2)

Return ValueBoolean

ExamplesThe following expression returns FALSE:

Or(1-1=1,3+2=4)

Use the following expression find the products for which sales > 20000 or cost < 5000:

Or({Sales}>20000, {Cost}<5000)

Sales Cost Return Value

----- ----- ------------

22000 5500 TRUE

52820 25000 TRUE

9000 6000 FALSE

19000 9500 FALSE

Argument Datatype Description

BooleanValue1 Boolean Required. Boolean condition you want to pass to the function.

BooleanValue2 Boolean Required. Boolean condition you want to pass to the function.

176 Chapter 4: Functions

Page 205: DA_FunctionReference

PV

Returns the present value of an investment. The present value is the lump-sum amount that a series of future payments is worth now. Rate is the interest rate earned in each period. FutureValue is the cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the PV function assumes it to be 0. For example, the future value of a loan is 0.

This function belongs to the Financial category.

SyntaxPV(Rate, NumberPeriods, Payment [, FutureValue, PaymentAtBeginning, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns 12,524.43 as the amount that you must deposit in the account today to have a future value of $20000 in one year:

PV(0.0075, 12, -500, 20000, TRUE)

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

Payment Numeric Required. Payment amount due.

FutureValue Numeric Optional. Worth of an asset in the future.

PaymentAtBeginning Boolean Optional. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

PV 177

Page 206: DA_FunctionReference

PEARSON

Returns the Pearson product moment correlation coefficient (r). The value of the Pearson product moment correlation coefficient is in the range -1.0 to 1.0, inclusive. You can use this function to determine the extent of a linear relationship between two sets of values (ListY and ListX). Pass numeric metrics or attributes as the values for the ListY and ListX arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

This function belongs to the Aggregate category.

SyntaxPearson(List1, List2 [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 0.1685 as the Pearson product moment correlation coefficient for sales in the year 2003 and sales in the year 2004 for products in the Women category:

Pearson({2004 Sales}, {2003 Sales}, "{Prod Category}='Women'"}, "{Prod Category}='Women'"})

Prod Category 2004 Sales 2003 Sales

------------- ---------- ----------

Women 1500 2500

Women 5000 2250

Men 38088 10502

Argument Datatype Description

List1 Numeric List Required. Name of a metric or attribute.

List2 Numeric List Required. Name of a metric or attribute.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

178 Chapter 4: Functions

Page 207: DA_FunctionReference

Women 6200 800

Women 750 150

Women 2000 750

Men 28195 6974

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

Pearson 179

Page 208: DA_FunctionReference

PERCENTCONTRIBUTION

For a set of values, returns each value as the percentage of the sum of all values in the set. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

This function belongs to the Running category.

SyntaxPercentContribution(List [, Context])

Return ValueNumeric List

ExamplesUse the following expression to display the revenue for each product category as a percentage of the total revenue:

PercentContribution({Revenue})

Revenue Return Value

-------- ------------

25661.79 17.76

25597.34 17.71

38088.29 26.35

26977.24 18.67

28195.74 19.51

NotesThis function ignores NULLs when performing the calculation.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

180 Chapter 4: Functions

Page 209: DA_FunctionReference

PERCENTILE

Calculates the value that falls at a given percentile in a group of numbers. Optionally, you can use the Context argument to limit the values you want to pass to the function to calculate the percentile.

This function belongs to the Statistical category.

SyntaxPercentile(List, Percentile [, Context])

Return ValueNumeric

ExamplesThe following expression returns 106250.0 as the salary that falls at the 75th percentile of salaries greater than $50,000:

Percentile({Salary}, 75, "{Salary} > 50000")

Salary

--------

125000.0

27900.0

100000.0

NULL

55000.0

9000.0

85000.0

86000.0

48000.0

99000.0

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Percentile Numeric Required. Percentile you want to calculate. Must be between 0 and 100, inclusive.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Percentile 181

Page 210: DA_FunctionReference

NotesIf a value is NULL, the function ignores the row.

182 Chapter 4: Functions

Page 211: DA_FunctionReference

PERIODSPERYEAR

Returns the number of periods per year, given the frequency of payments. You can use this function to pass the period value to other financial functions.

This function belongs to the Financial category.

SyntaxPeriodsPerYear([Frequency])

Return ValueNumeric

ExamplesThe following expression returns 52 as the number of periods when you need to make weekly payments:

PeriodsPerYear("Weekly")

Argument Datatype Description

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

PeriodsPerYear 183

Page 212: DA_FunctionReference

PLUS

Removes the plus sign from a given numeric value. If the given value does not have a plus sign, the function returns the same value. You can use this function with a numeric metric, numeric attribute, or a calculated numeric value.

This function belongs to the Unary category.

SyntaxPlus(NumericValue)

Return ValueNumeric

ExamplesThe following expression removes the plus sign from the values in the Profit metric:

Plus({Profit})

Profit Return Value

------ ------------

+600 600

520 520

-35 -35

950 950

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

184 Chapter 4: Functions

Page 213: DA_FunctionReference

PMT

Returns the payment for a loan based on constant payments and a constant interest rate. The Rate argument is the interest rate for the loan for each period. The PresentValue is the principal for the loan. The FutureValue is cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the Pmt function assumes it to be 0.

This function belongs to the Financial category.

SyntaxPmt(Rate, NumberPeriods, PresentValue [, FutureValue, PaymentAtBeginning, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns -2111.64 as the monthly payment amount of a loan:

Pmt(0.01, 10, 20000)

NotesTo calculate interest rate earned in each period, divide the annual rate by the number of payments made in an year. For example, if you make monthly payments at an annual interest rate of 15 percent, the value of the Rate argument is 15% divided by 12. If you make annual payments, the value of the Rate argument is 15%.

The payment value is negative because these are amounts that you pay.

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

PresentValue Numeric Required. Current value of an asset or liability.

FutureValue Numeric Optional. Worth of an asset in the future.

PaymentAtBeginning Boolean Optional. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

Pmt 185

Page 214: DA_FunctionReference

POWER

Returns the value of a number raised to an exponent. The first argument you pass to the function is the base value. The second argument you pass to the function is the exponent.

This function belongs to the Mathematical category.

SyntaxPower(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression returns the result of the Numbers metric raised to the Exponent metric:

Power({Numbers}, 2)

Numbers Return Value

------- ------------

10 100

220 48400

-3 9

8.5 72.25

NotesIf the base value is negative, the exponent must be an integer. In this case, the function rounds any decimal values to the nearest integer before returning a value.

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

186 Chapter 4: Functions

Page 215: DA_FunctionReference

PREVIOUS

Returns the previous value for the specified metric or attribute.

This function belongs to the Fetch category.

SyntaxPrevious(Metric)

Return ValueVaries

ExamplesThe following expression returns the revenue from the previous quarter:

Previous({quarterly_revenue})

Quarterly Revenue Return Value

----------------- ------------

1500 NULL

7125 1500

3500 7125

1090 3500

NotesPowerAnalyzer returns NULL if the specified value is the first value in the metric or attribute.

Argument Datatype Description

Metric Varies Required. Metric for which you want to get the value.

Previous 187

Page 216: DA_FunctionReference

PRICE

Returns the price per $100 face value of a security that pays periodic interest.

This function belongs to the Financial category.

SyntaxPrice(SettlementDate, MaturityDate, Rate, Yield, Redemption [, Frequency, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns $863.57 as the price of a bond:

Price(Date(2004,3,31), Date(2006,9,30), 0.05, 0.065, 1000, "semiannual", "30E+/360")

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

Yield Numeric Required. Yield of security, expressed as a decimal number. Divide the percent yield by 100 to express it as a decimal number. Must be greater than or equal to 0.

Redemption Numeric Required. Amount to be received at maturity per $100 face value. Must be greater than 0.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

188 Chapter 4: Functions

Page 217: DA_FunctionReference

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

Price 189

Page 218: DA_FunctionReference

PRICEDISC

Returns the price per $100 face value of a discounted security.

This function belongs to the Financial category.

SyntaxPriceDisc(SettlementDate, MaturityDate, Discount, Redemption [, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns $87.50 as the price of a discounted bond:

PriceDisc(Date(2004,3,31), Date(2006,9,30), 0.05, 100, "30E+/360")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Discount Numeric Required. Discount rate of a security, expressed as a decimal number. Divide the percent discount rate by 100 to express it as a decimal number. Must be greater than 0.

Redemption Numeric Required. Amount to be received at maturity per $100 face value. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

190 Chapter 4: Functions

Page 219: DA_FunctionReference

PRICEMAT

Returns the price per $100 face value of a security that pays interest at maturity.

This function belongs to the Financial category.

SyntaxPriceMat(SettlementDate, MaturityDate, IssueDate, Rate, Yield [, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns $96.60 as the price of a bond that pays interest at maturity:

PriceMat(Date(2004,3,31), Date(2006,9,30), Date(2004, 1, 1), 0.05, 0.065, "ACT/ACT")

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

IssueDate Date Required. Date when the security was issued. Must be less than or equal to SettlementDate.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

Yield Numeric Required. Yield of security, expressed as a decimal number. Divide the percent yield by 100 to express it as a decimal number. Must be greater than or equal to 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

PriceMat 191

Page 220: DA_FunctionReference

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

192 Chapter 4: Functions

Page 221: DA_FunctionReference

PRODUCT

Returns the result of multiplying values in a numeric metric or attribute.

This function belongs to the Aggregate category.

SyntaxProduct(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 1200 as the product of the Customer Count metric:

Product({Customer Count})

Customer Count

--------------

10

3

8

5

NotesThis function ignores NULLs when performing the calculation.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Product 193

Page 222: DA_FunctionReference

RATE

Returns the interest rate earned per period by a security. PresentValue is the lump-sum amount that a series of future payments is worth now. FutureValue is cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the Rate function assumes it to be 0. For example, the future value of a loan is 0.

This function belongs to the Financial category.

SyntaxRate(NumberPeriods, Payment, PresentValue [, FutureValue, PaymentAtBeginning, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns 0.0077 as the monthly interest rate of a loan:

Rate(48, -500, 20000)

To calculate the yearly interest rate multiply 0.0077 by 12, which equals 0.0924 or 9.24%.

NotesThe payment value is negative because these are amounts that you pay.

Argument Datatype Description

NumberPeriods Numeric Required. Number of periods or payments. Must be greater than 0.

Payment Numeric Required. Payment amount due.

PresentValue Numeric Required. Current value of an asset or liability.

FutureValue Numeric Optional. Worth of an asset in the future.

PaymentAtBeginning Boolean Optional. Timing of the payment. Enter TRUE if payment is at the beginning of period. Enter FALSE if payment is at the end of period. Default is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

194 Chapter 4: Functions

Page 223: DA_FunctionReference

RATETODF

Returns the discount factor, given the rate. The discount factor is a number that is multiplied by a monetary value to reduce an expected future sum to its present value. You can use the discount factor to evaluate the return on a capital investment, by calculating the present value of future cash flows. This function is the reverse of the DfToRate function. Use the RateToDf function to compute the rate when the discount factor is known.

This function belongs to the Financial category.

SyntaxRateToDf(Rate, RateConvention, ElapsedYears)

Return ValueNumeric

ExamplesThe following expression returns 0.3 as the discount factor:

RateToDf(0.054, "annual", 5)

Argument Datatype Description

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

RateConvention String Required. Convention of quoting the rate. The rate can be "annual", "semiannual", "quarterly", "monthly", "weekly", "daily", "discount", "simple" or "continuous". Default value is "annual". Enclose the rate convention within quotation marks.

ElapsedYears Numeric Required. Elapsed years, expressed as a decimal number. Must be greater than or equal to 0.

RateToDf 195

Page 224: DA_FunctionReference

RECEIVED

Returns the amount received when a fully invested security matures.

This function belongs to the Financial category.

SyntaxReceived(SettlementDate, MaturityDate, Investment, Discount [, DayCountBasis, CurrencyDecimals])

Return ValueNumeric

ExamplesThe following expression returns $21,352.31 as the amount received when a fully invested bond matures:

Received(Date(2004,3,31), Date(2004,11,30), 20000, 0.095, "ACT/ACT")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Investment Numeric Required. Amount invested in the security. Must be greater than 0.

Discount Numeric Required. Discount rate of a security, expressed as a decimal number. Divide the percent discount rate by 100 to express it as a decimal number. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

196 Chapter 4: Functions

Page 225: DA_FunctionReference

REPLACE

Replaces a character string, or a part of a character string, with a new character string that you specify. You can specify where to start the replacement and the number of characters to replace. Use the Replace function when you want to replace any text that occurs in a specific location in a character string.

This function belongs to the String category.

SyntaxReplace(String, Start, Count, Replace)

Return ValueString

ExamplesThe following expression:

Replace("I left my heart in San Francisco.", 11, 5, "lung")

returns the following string:

I left my lung in San Francisco.

NotesUse the Substitute function when you want to replace specific text in a text string.

Argument Datatype Description

String String Required. String value you want to pass to the function.

Start Numeric Required. Position where you want to start. For example, 1 represents the first position. Must not equal 0.

Count Numeric Required. Number of characters. Must be greater than or equal to 0.

Replace String Required. Replacement string.

Replace 197

Page 226: DA_FunctionReference

REPT

Repeats text a given number of times. You can use the Rept function for formatting purposes. For example, you can display an attribute value multiple times within a single cell in the report.

This function belongs to the String category.

SyntaxRept(String, RepeatCount)

Return ValueString

ExamplesUse the following expression to display the value for the Product Category attribute two times:

Rept({Product Category}, 2)

Product Category Return Value

---------------- ------------

Boys BoysBoys

Girls GirlsGirls

Men MenMen

Women WomenWomen

Argument Datatype Description

String String Required. String value you want to pass to the function.

RepeatCount Numeric Required. Number of times you want to repeat the string. Must be greater than or equal to 0.

198 Chapter 4: Functions

Page 227: DA_FunctionReference

ROUND

Returns all values rounded to the specified number of digits.

This function belongs to the Rounding category.

SyntaxRound(NumericValue [, Significance])

Return ValueNumeric

ExamplesUse the following expression to round all values of the Dollar Cost metric to the cent:

Round({Dollar Cost}, 2)

Dollar Cost Return Value

----------- ------------

15.846 15.85

8.43333333 8.43

9.0623 9.06

11.193 11.19

NotesReturns the same value if the significance is greater than the scale of the value.

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Significance Numeric Optional. Number of places to the right of decimal point. Negative value indicates number of places to the left of decimal point. Default is 0.

Round 199

Page 228: DA_FunctionReference

ROUNDDOWN

Returns a value rounded down N number of places to the right of the decimal point. If N is a negative number, rounds down N places left of the decimal point.

This function belongs to the Rounding category.

SyntaxRoundDown(NumericValue [, Significance])

Return ValueNumeric

ExamplesUse the following expression to round down the values of the Cost metric a given number of places to the right of the decimal point:

RoundDown({Cost}, {Significance})

Cost Significance Return Value

------- ------------ ------------

25.4469 3 25.446

8.85676 2 8.85

149.42 -2 100

42.2131 2 42.21

4.23 5 4.23001

4.23 0 4

NotesReturns the same value if the significance is greater than the scale of the value.

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Significance Numeric Optional. Number of places to the right of decimal point. Negative value indicates number of places to the left of decimal point. Default is 0.

200 Chapter 4: Functions

Page 229: DA_FunctionReference

ROUNDUP

Returns a value rounded up N number of places to the right of the decimal point. If N is a negative number, rounds up N places left of the decimal point.

This function belongs to the Rounding category.

SyntaxRoundUp(NumericValue [, Significance])

Return ValueNumeric

ExamplesUse the following expression to round up the values of the Cost metric a given number of places to the right of the decimal point:

RoundUp({Cost}, {Significance})

Cost Significance Return Value

------- ------------ ------------

25.4469 3 25.447

8.85676 2 8.86

149.42 -2 200

42.2131 2 42.22

4.23 5 4.23

4.23 0 5

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Significance Numeric Optional. Number of places to the right of decimal point. Negative value indicates number of places to the left of decimal point. Default is 0.

RoundUp 201

Page 230: DA_FunctionReference

RUNNINGAVG

Returns the average of the current value and all previous values in a row or column. Running average is different than moving average, because moving average is always for a specified group of values (Size argument). The MovingAvg function performs the calculation for each group of values at a time. RunningAvg function starts at the beginning and runs through the entire set of values, recalculating at each value. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

This function belongs to the Running category.

SyntaxRunningAvg(List [, Context])

Return ValueNumeric List

ExamplesUse the following expression to display the running average of monthly sales:

RunningAvg({Monthly Sales}, "@COLUMN")

Month Monthly Sales Return Value

-------- ------------- ------------

January 25661.79 25661.79

February 25597.34 25629.57

March 38088.29 29782.47

April 26977.24 29081.17

May 28195.74 28904.08

NotesThis function ignores NULLs when performing the calculation.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

202 Chapter 4: Functions

Page 231: DA_FunctionReference

RUNNINGSUM

Returns the total of the current value and all previous values in a row or column. Running sum is different than moving sum, because moving sum is always for a specified group of values (Size argument). The MovingSum function performs the calculation for each group of values at a time. RunningSum function starts at the beginning and runs through the entire set of values, recalculating at each value. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

This function belongs to the Running category.

SyntaxRunningSum(List [, Context])

Return ValueNumeric List

ExamplesUse the following expression to display the running sum of monthly sales:

RunningSum({Monthly Sales}, "@COLUMN")

Month Monthly Sales Return Value

-------- ------------- ------------

January 25661.79 25661.79

February 25597.34 51259.13

March 38088.29 89347.42

April 26977.24 116324.66

May 28195.74 144520.40

NotesThis function ignores NULLs when performing the calculation.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

RunningSum 203

Page 232: DA_FunctionReference

SLN

Returns the straight-line depreciation of an asset for one period.

This function belongs to the Financial category.

SyntaxSLn(Cost, Salvage, Life [, CurrencyDecimals])

Return ValueNumeric

ExamplesAn office chair costs $1,000 and has a life of 8 years. The salvage value of the chair is $175. The following expression returns $103.13 as the depreciation of the chair in each year using the straight-line depreciation method:

SLn(1000, 175, 8)

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Life Numeric Required. Number of periods over which an asset is being depreciated. Must be greater than 0.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

204 Chapter 4: Functions

Page 233: DA_FunctionReference

SYD

Returns the depreciation of an asset using the sum-of-years' digits method for a given period.

This function belongs to the Financial category.

SyntaxSYD(Cost, Salvage, Life, Period [, CurrencyDecimals])

Return ValueNumeric

ExamplesA machine costs $2,500 and has a life of 8 years. The salvage value of the machine is $750. The following expression returns $388.89 as the depreciation allowed in the first year:

SYD(2500, 750, 8, 1)

The following expression returns $48.61 as the depreciation allowed in the eighth year:

SYD(2500, 750, 8, 8)

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Life Numeric Required. Number of periods over which an asset is being depreciated. Must be greater than 0.

Period Numeric Required. Number representing the period for which you want to perform the calculation. Default is the same as the value of the Life argument. Must be greater than 0.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

SYD 205

Page 234: DA_FunctionReference

SEC

Returns the secant of a numeric value.

This function belongs to the Trigonometric category.

SyntaxSec(Angle)

Return ValueNumeric

ExamplesThe following expression returns the secant for all values of the Angles metric:

Sec({Angles})

Angles Return Value

------ ------------

10 -1.19

0.5 1.14

-2.5 -1.25

NULL NULL

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

206 Chapter 4: Functions

Page 235: DA_FunctionReference

SECH

Returns the hyperbolic secant of a numeric value.

This function belongs to the Trigonometric category.

SyntaxSech(Angle)

Return ValueNumeric

ExamplesThe following expression returns the hyperbolic secant for all values of the Angles metric:

Sech({Angles})

Degrees Return Value

------- ------------

1.0 0.65

2.51 0.16

0 1.00

-0.2 0.98

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

Sech 207

Page 236: DA_FunctionReference

SECOND

Returns the second of the time part of a date value. The function returns the second as an integer with values ranging from 0 to 59.

This function belongs to the Date & Time category.

SyntaxSecond(Date)

Return ValueNumeric

ExamplesThe following expression returns the second of the minute of the Date Shipped attribute value:

Second({Date Shipped})

Date Shipped Return Value

------------------- ------------

2004-03-10 2:15:15 15

2004-06-06 14:53:22 22

2004-06-01 7:20:00 00

2003-12-15 0:37:05 05

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

208 Chapter 4: Functions

Page 237: DA_FunctionReference

SIGN

Returns whether a numeric value is positive, negative, or 0. You can use this function with a numeric metric, numeric attribute, or a calculated numeric value.

This function belongs to the Unary category.

SyntaxSign(NumericValue)

Return ValueNumeric. Returns -1 for negative values, 0 for 0, and +1 for positive values.

ExamplesTo find out if the Profit metric includes any negative values, use the following expression.

Sign({Profit})

Profit Return Value

------ ------------

1584 1

-843 -1

0 0

NULL NULL

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

Sign 209

Page 238: DA_FunctionReference

SIN

Returns the sine of a numeric value.

This function belongs to the Trigonometric category.

SyntaxSin(Angle)

Return ValueNumeric. The value is in the range -1 to +1.

ExamplesThe following expression returns the sine for the values of the Angles metric:

Sin({Angles})

Angles Return Value

------ ------------

0.92 0.80

1.5 1.00

3.25 -0.11

NULL NULL

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

210 Chapter 4: Functions

Page 239: DA_FunctionReference

SINH

Returns the hyperbolic sine of a numeric value.

This function belongs to the Trigonometric category.

SyntaxSinh(Angle)

Return ValueNumeric

ExamplesThe following expression returns the hyperbolic sine for all values of the Angles metric:

Sinh({Angles})

Degrees Return Value

------- ------------

1.0 1.18

5.45 116.38

0.32 0.33

2.89 8.97

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

Sinh 211

Page 240: DA_FunctionReference

SKEW

Returns the statistical skewness of a distribution. Skewness is the degree of asymmetry of a distribution around its mean. A distribution is symmetric if it looks the same to the left and right of the center point. Positive skewness means the distribution has an asymmetric tail towards more positive values. Negative skewness means the distribution has an asymmetric tail towards more negative values.

This function belongs to the Aggregate category.

SyntaxSkew(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns -0.98 as the skewness of the sales growth of different products in the month of January:

Skew({Sales Growth}, "{Month}='January'")

Product Sales Growth

------- ------------

Books -2846.15

Apparel -375.88

Toys 2179.39

Bicyles 569.74

Shoes 935.80

NotesThe metric or attribute you pass to the Skew function must have three or more values and must not have a sample standard deviation of 0. If there are less than three data values, or if the sample standard deviation is 0, the functions returns the following value: undefined.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

212 Chapter 4: Functions

Page 241: DA_FunctionReference

SLOPE

Returns the slope of the linear regression line that runs through values in two lists (ListY and ListX). The slope is the vertical distance divided by the horizontal distance between any two points on the line, which is the rate of change along the regression line. Use numeric metric or attribute names as values of the ListY and ListX arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The first Context argument corresponds to the ListY argument and the second Context argument corresponds to the ListX argument.

This function belongs to the Aggregate category.

SyntaxSlope(ListY, ListX [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 0.40 as the slope of the linear regression line that runs through values in the Sales and Cost metrics:

Slope({Sales}, {Cost})

Sales Cost

-------- --------

25661.79 13253.74

25597.34 6392.94

38088.29 10502.07

Argument Datatype Description

ListY Numeric List Required. Name of a metric or attribute representing known dependent values.

ListX Numeric List Required. Name of a metric or attribute representing known independent values.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Slope 213

Page 242: DA_FunctionReference

26977.24 5420.59

28195.74 6974.26

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

214 Chapter 4: Functions

Page 243: DA_FunctionReference

SQRT

Returns the square root of a given positive number. The square root of a negative number is not a value.

This function belongs to the Mathematical category.

SyntaxSqrt(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns 7.28011:

Sqrt(53)

The following expression returns 12:

Sqrt(144)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. Must be greater than or equal to 0.

Sqrt 215

Page 244: DA_FunctionReference

SQUARE

Returns the square of a given number.

This function belongs to the Mathematical category.

SyntaxSquare(NumericValue)

Return ValueNumeric

ExamplesThe following expression returns 100.00:

Square(10)

The following expression returns 144.00:

Square(-12)

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function.

216 Chapter 4: Functions

Page 245: DA_FunctionReference

STANDARDIZE

Returns the normalized value for a distribution, given the mean and standard deviation.

This function belongs to the Statistical category.

SyntaxStandardize(X, Mean, StdDev)

Return ValueNumeric

ExamplesThe following expression returns 1.74 as the normalized value for 32:

Standardize(32,30,1.15)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation.

Mean Numeric Required. Average of a list of numbers.

StdDev Numeric Required. Standard deviation of a list of numbers. Must be greater than 0.

Standardize 217

Page 246: DA_FunctionReference

STDEV

Returns the standard deviation, treating values for a numeric metric or attribute as a sample population. The metric or attribute must include at least two values.

This function belongs to the Aggregate category.

SyntaxStdev(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 5244.31 as the standard deviation of the Revenue metric:

Stdev({Revenue})

Revenue

--------

25661.79

25597.34

38088.29

26977.24

28195.74

NotesThis function ignores NULLs when performing the calculation. This function returns NULL if the provided list includes less than two values.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

218 Chapter 4: Functions

Page 247: DA_FunctionReference

STDEVP

Returns the standard deviation, treating values for a numeric metric or attribute as a complete population. The metric or attribute must include at least two values.

This function belongs to the Aggregate category.

SyntaxStdevP(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 4690.65 as the standard deviation of population of the Revenue metric:

StdevP({Revenue})

Revenue

--------

25661.79

25597.34

38088.29

26977.24

28195.74

NotesThis function ignores NULLs when performing the calculation. This function returns NULL if the provided list includes less than two values.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

StdevP 219

Page 248: DA_FunctionReference

STEYX

Returns the statistical standard error of linear regression between two lists of values (ListY and ListX). The standard error is a measure of the amount of error in the prediction of a Y value for an X value. Use metric or numeric attribute names as values of the ListY and ListX arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The first Context argument corresponds to the ListY argument and the second Context argument corresponds to the ListX argument.

This function belongs to the Aggregate category.

SyntaxSteyx(ListY, ListX [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 3662.55 as the standard error of linear regression between values in the Cost and Sales metrics:

Steyx({Cost}, {Sales})

Sales Cost

-------- --------

25661.79 13253.74

25597.34 6392.94

38088.29 10502.07

26977.24 5420.59

Argument Datatype Description

ListY Numeric List Required. Name of a metric or attribute representing known dependent values.

ListX Numeric List Required. Name of a metric or attribute representing known independent values.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

220 Chapter 4: Functions

Page 249: DA_FunctionReference

28195.74 6974.26

NotesThe two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

Steyx 221

Page 250: DA_FunctionReference

SUBSTITUTE

Replaces a string of text with a new string of text that you specify. You can specify where to start the replacement and the number of characters to replace. Use the Substitute function when you want to replace specific text in a text string.

This function belongs to the String category.

SyntaxSubstitute(String, Find, Replace [, Instance])

Return ValueString

ExamplesThe following expression:

Substitute("The product sales are low...", ".", "!")

returns the following string:

The product sales are low!!!

To replace only a specific instance of a text, specify the Nth instance of the text:

Substitute("The product sales are low...", ".", "!", 2)

returns the following string:

The product sales are low.!.

NotesUse the Replace function when you want to replace any text that occurs in a specific location in a text string.

Argument Datatype Description

String String Required. String value you want to pass to the function.

Find String Required. String to find within other string.

Replace String Required. Replacement string.

Instance Numeric Optional. The Nth instance of the string to find. Default is 1, the first instance.

222 Chapter 4: Functions

Page 251: DA_FunctionReference

SUBSTRING

Returns a portion of a string. The Substring function counts all characters, including blanks, starting at the beginning of the string.

This function belongs to the String category.

SyntaxSubstring(String, Start [, Count])

Return ValueString

ExamplesThe following expression returns the area code for each value of the Phone attribute:

Substring({Phone}, 1, 3)

Phone Return Value

------------ ------------

809-555-0269 809

650-593-3851 650

415-385-5391 415

720-780-7993 720

NotesYou must pass an integer as the value of the Start argument. If you pass a positive number, the function locates the start position by counting from the beginning of the string. If you pass a negative number, the function locates the start position by counting from the end of the string. If you pass zero, the function returns an empty string.

You must pass an integer as the value of the Count argument. If you pass a positive number, the function returns characters to the right of the start position, inclusive. If you pass a negative number, the function returns characters to the right of the start position, inclusive. If you pass zero, the function returns an empty string. If you omit the Count argument, the function returns all characters from the start position to the end of the string.

Argument Datatype Description

String String Required. String value you want to pass to the function.

Start Numeric Required. Position where you want to start. For example, 1 represents the first position. Must not equal 0.

Count Numeric Optional. Number of characters.

Substring 223

Page 252: DA_FunctionReference

SUBTRACT

Returns the result of one numeric value subtracted by another.

This function belongs to the Mathematical category.

SyntaxSubtract(NumericValue1, NumericValue2)

Return ValueNumeric

ExamplesThe following expression subtracts the value of the Sales metric from the value of the Cost metric:

Subtract({Sales}, {Cost})

Sales Cost Return Value

-------- -------- ------------

25661.79 13253.74 12408.05

25597.34 6392.94 19204.40

38088.29 10502.07 27586.22

26977.24 5420.59 21556.65

28195.74 6974.26 21221.48

Argument Datatype Description

NumericValue1 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

NumericValue2 Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

224 Chapter 4: Functions

Page 253: DA_FunctionReference

SUM

Returns the sum of all values

This function belongs to the Aggregate category.

SyntaxSum(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 44.52 as the total cost:

Sum({Cost})

Cost

-----

15.84

8.43

9.06

11.19

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Sum 225

Page 254: DA_FunctionReference

TBILLEQ

Returns the bond-equivalent yield for a Treasury bill. The function returns the yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

This function belongs to the Financial category.

SyntaxTBillEq(SettlementDate, MaturityDate, Discount)

Return ValueNumeric

ExamplesThe following expression returns 0.08 as the bond-equivalent yield for a Treasury bill:

TBillEq(Date(2004,3,31), Date(2004,11,30), 0.075)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Discount Numeric Required. Discount rate of a security, expressed as a decimal number. Divide the percent discount rate by 100 to express it as a decimal number. Must be greater than 0.

226 Chapter 4: Functions

Page 255: DA_FunctionReference

TBILLPRICE

Returns the price per $100 face value for a Treasury bill.

This function belongs to the Financial category.

SyntaxTBillPrice(SettlementDate, MaturityDate, Discount)

Return ValueNumeric

ExamplesThe following expression returns $94.92 as the price of a Treasury bill:

TBillPrice(Date(2004,3,31), Date(2004,11,30), 0.075)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Discount Numeric Required. Discount rate of a security, expressed as a decimal number. Divide the percent discount rate by 100 to express it as a decimal number. Must be greater than 0.

TBillPrice 227

Page 256: DA_FunctionReference

TBILLYIELD

Returns the yield for a USA Treasury bill. The function returns the yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

This function belongs to the Financial category.

SyntaxTBillYield(SettlementDate, MaturityDate, Price)

Return ValueNumeric

ExamplesThe following expression returns 0.103 as the yield for a Treasury bill:

TBillYield(Date(2004,3,31), Date(2004,11,30), 93.5)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Price Numeric Required. Security price per $100 face value. Must be greater than 0.

228 Chapter 4: Functions

Page 257: DA_FunctionReference

TDIST

Returns the probability for the Student t-distribution. You can use the t-distribution in the hypothesis testing of small sets of sample data. The numeric value (X) that you pass to the function is a calculated value of t for which the probability is to be computed.

This function belongs to the Statistical category.

SyntaxTDist(X, DegreesOfFreedom [, Tails])

Return ValueNumeric

ExamplesThe following expression returns 0.015 as the one-tailed t-distribution probability for 2.25 at 49 degrees of freedom:

TDist(2.25, 49, 1)

The following expression returns 0.029 as the two-tailed t-distribution probability for 2.25 at 49 degrees of freedom:

TDist(2.25, 49, 2)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be greater than or equal to 0.

DegreesOfFreedom Numeric Required. Whole number representing the degrees of freedom. Degrees of freedom is the number of values in a statistical calculation that are free to vary. Must be between 1 and 10,000, inclusive.

Tails Numeric Optional. Number of distribution tails to return. If Tails is 1, the function returns the one-tailed distribution. If Tails is 2, the function returns the two-tailed distribution. Default is 1. Must be between 1 and 2, inclusive.

TDist 229

Page 258: DA_FunctionReference

TINV

Returns the t-value of the Student's t-distribution, given the probability and the degrees of freedom. The TInv function is the statistical inverse of the TDist function.

This function belongs to the Statistical category.

SyntaxTInv(Probability, DegreesOfFreedom [, Tails])

Return ValueNumeric

ExamplesThe following expression returns 1.597 as the one-tailed t-value for the probability of 0.063 at 49 degrees of freedom:

TInv(0.063, 20, 1)

The following expression returns 1.969 as the two-tailed t-value for the probability of 0.063 at 49 degrees of freedom:

TInv(2.25, 49, 2)

Argument Datatype Description

Probability Numeric Required. Probability associated with the distribution. Must be between 0 and 1, inclusive.

DegreesOfFreedom Numeric Required. Whole number representing the degrees of freedom. Degrees of freedom is the number of values in a statistical calculation that are free to vary. Must be between 1 and 10,000, inclusive.

Tails Numeric Optional. Number of distribution tails to return. If Tails is 1, the function returns the one-tailed distribution. If Tails is 2, the function returns the two-tailed distribution. Default is 1. Must be between 1 and 2, inclusive.

230 Chapter 4: Functions

Page 259: DA_FunctionReference

TTEST

Returns the two-tailed probability associated with a Student's T-test. You can use the TTest function to determine whether two samples (List1 and List2) are likely to have come from the same population and have the same mean. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

This function belongs to the Aggregate category.

SyntaxTTest(List1, List2 [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 0.6344 as the T-test probability of the list price of products sold in USA and Canada:

TTest({USA List Price}, {Canada List price})

USA List Price Canada List price

-------------- -----------------

15 16.5

8 9.25

9 10

11 11.75

Argument Datatype Description

List1 Numeric List Required. Name of a metric or attribute.

List2 Numeric List Required. Name of a metric or attribute.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

TTest 231

Page 260: DA_FunctionReference

NotesThe TTest function performs the two-sample unequal variance (heteroscedastic) test. The heteroscedastic test is a version of the Student's T-test and it assumes that the statistical distributions having different variances.

The two lists must have equal number of values. If there is a NULL in one list, the corresponding value in the other list is skipped. In this case, the function does not include either value in the calculation.

232 Chapter 4: Functions

Page 261: DA_FunctionReference

TAN

Returns the tangent of a given angle.

This function belongs to the Trigonometric category.

SyntaxTan(Angle)

Return ValueNumeric

ExamplesThe following expression returns the tangent for the values of the Angles metric:

Tan({Angles})

Angles Return Value

------ ------------

0.55 0.61

0.75 0.93

1 1.56

NULL NULL

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

Tan 233

Page 262: DA_FunctionReference

TANH

Returns the hyperbolic tangent of a numeric value.

This function belongs to the Trigonometric category.

SyntaxTanh(Angle)

Return ValueNumeric. The value is in the range -1 to +1.

ExamplesThe following expression returns the hyperbolic sine for all values of the Angles metric:

Tanh({Angles})

Degrees Return Value

------- ------------

2.89 0.99

5.45 1.00

1.0 0.76

0 0.00

Argument Datatype Description

Angle Numeric Required. An angle, expressed in radians. To convert degrees to radians, multiply the degrees by PI/180 or use the Units function.

234 Chapter 4: Functions

Page 263: DA_FunctionReference

TIME

Sets the time of day for a date. Use this function to set the time for a date value, when only the date part is known. You can also use this function to change the time part of a date value.

This function belongs to the Date & Time category.

SyntaxTime(Date, Hour [, Minute, Second])

Return ValueDate

ExamplesUse the following expression to set the ship date for each shipment to 5:30 am:

Time({Ship Date}, 5, 30)

Ship Date Return Value

---------------- ---------------

2004-03-10 2:15 2004-03-10 5:30

2004-06-06 14:53 2004-06-06 5:30

2004-06-01 7:20 2004-06-01 5:30

2003-12-15 0:37 2003-12-15 5:30

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

Hour Numeric Required. Number representing the hour of the day. Must be between 0 and 23, inclusive.

Minute Numeric Optional. Number representing the minute of the hour. Must be between 0 and 59, inclusive.

Second Numeric Optional. Number representing the second of a minute. Must be between 0 and 59, inclusive.

Time 235

Page 264: DA_FunctionReference

TODAY

Returns the value of the current date. You can use this function to pass a date value to another function.

This function belongs to the Date & Time category.

SyntaxToday()

Return ValueDate

ExamplesThe following expression returns 5 given that today's date is May 28, 2004:

Month(Today())

236 Chapter 4: Functions

Page 265: DA_FunctionReference

TRIMEAN

Returns the statistical trimean of a set of values. Trimean is calculated by adding the 25th percentile, twice the 50th percentile, the 75th percentile and dividing the result by four. For example, the 25th, 50th, and 75th percentile of a set of values are 51, 55, and 63, respectively. The trimean of the set of values is (51+55+55+63)/4, which equals 56. Use the TriMean function when you want to compute the mean that is less influenced by extreme data. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Aggregate category.

SyntaxTriMean(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 7710.88 as the trimean of the Revenue metric for products belonging to the Drinks and Food category:

TriMean({Revenue}, "{Category}='Drinks', 'Food'")

Category Revenue

-------- --------

Drinks 13253.74

Food 6392.94

Drinks 10502.07

Snacks 550

Food 5420.59

Drinks 6974.26

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

TriMean 237

Page 266: DA_FunctionReference

TRIM

Removes blanks from the end of a string.

This function belongs to the String category.

SyntaxTrim(String)

Return ValueString

ExamplesUse the following expression to remove blank spaces from the end of Product Category attribute values:

Trim({Product Category})

Product Category Return Value

---------------- ------------

" Boys" "Boys"

"Girls " "Girls"

" Women " "Women"

"Men" "Men"

Argument Datatype Description

String String Required. String value you want to pass to the function.

238 Chapter 4: Functions

Page 267: DA_FunctionReference

TRUNC

Returns the value truncated to a specific digit.

This function belongs to the Rounding category.

SyntaxTrunc(NumericValue [, Significance])

Return ValueNumeric

ExamplesUse the following expression to truncate all values of a numeric metric to a specific digit:

Trunc({Number}, 3)

Number Return Value

---------------- ------------

15.846 15.845

8.43333333333333 8.433

9.0623 9.062

11.2 11.199

NotesReturns the same value if you specify a significance that is greater than the scale of the value.

Argument Datatype Description

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

Significance Numeric Optional. Number of places to the right of decimal point. Negative value indicates number of places to the left of decimal point. Default is 0.

Trunc 239

Page 268: DA_FunctionReference

UNITS

Converts the value you specify in one unit of measure (Units1) to another unit of measure (Units2), and returns the new value.

This function belongs to the Conversion category.

SyntaxUnits(Units1, Units2, NumericValue)

Return ValueNumeric

ExamplesUnits("hours", "days", 48) returns 2.00000

Units("meters", "inches", 2) returns 78.74016

Units("pounds", "ounces", 2) returns 32.00000

NotesIf you use a unit of measure not supported by PowerAnalyzer or if you use two units of measure that are supported by PowerAnalyzer but are not compatible, PowerAnalyzer displays an error message.

For a complete list of the supported units of measure, see the PowerAnalyzer online help.

Argument Datatype Description

Units1 String Required. Units to convert from.

Units2 String Required. Units to convert to.

NumericValue Numeric Required. Numeric value you want to pass to the function. You can enter a numeric literal, numeric metric name, or numeric attribute name.

240 Chapter 4: Functions

Page 269: DA_FunctionReference

UPPER

Converts lowercase string characters to uppercase.

This function belongs to the String category.

SyntaxUpper(String)

Return ValueString

ExamplesThe following expression returns all values in the Customer Name attribute as uppercase letters:

Upper({Customer Name})

Customer Name Return Value

------------- ------------

ruby RUBY

Rachel RACHEL

MATTHEW MATTHEW

LeBron LEBRON

Argument Datatype Description

String String Required. String value you want to pass to the function.

Upper 241

Page 270: DA_FunctionReference

VDB

Returns the variable declining balance. The variable declining balance is the depreciation of an asset for a specified period, using the double-declining balance method or any other specified method. The VDB function allows you to switch to the straight-line depreciation method when depreciation is greater than the declining balance calculation. By default, the function uses the double-declining balance method for calculating the variable declining balance.

This function belongs to the Financial category.

SyntaxVDB(Cost, Salvage, Life, StartPeriod, EndPeriod [, RateFactor, NoSwitch, CurrencyDecimals])

Return ValueNumeric

Argument Datatype Description

Cost Numeric Required. Cost of the asset. Must be greater than or equal to 0.

Salvage Numeric Required. Value or worth of the asset after depreciation. Must be between 0 and Cost, inclusive.

Life Numeric Required. Number of periods over which an asset is being depreciated. Must be greater than 0.

StartPeriod Numeric Required. Starting period for the calculation. Must be greater than or equal to 0.

EndPeriod Numeric Required. Ending period for the calculation.

RateFactor Numeric Optional. Factor used in calculating the rate. Default is 2. Must be greater than 0.

NoSwitch Boolean Optional. Logical value specifying whether you want PowerAnalyzer to switch to straight-line depreciation if depreciation is greater than the declining balance calculation. Pass TRUE if you do not want PowerAnalyzer to switch to straight-line depreciation even when the depreciation is greater than the declining balance calculation. Pass FALSE if you want PowerAnalyzer to switch to straight-line depreciation when depreciation is greater than the declining balance calculation. Default value is FALSE.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

242 Chapter 4: Functions

Page 271: DA_FunctionReference

ExamplesYou purchase a new copier for $2,400 for your department. The copier has a useful life of 10 years. The salvage value of the copier is $300. The following expression returns $480 as the depreciation for the first year:

VDB(2400, 300, 10, 0, 1)

NotesThe values of the StartPeriod and EndPeriod arguments must be in the same units as the value of the Life argument. For example, if the life is expressed in months, the starting and ending periods must also be expressed in months.

VDB 243

Page 272: DA_FunctionReference

VALUEOF

Returns the value of a given metric for a given context.

This function belongs to the Aggregate category.

SyntaxValueOf(List, Context)

Return ValueNumeric

ExamplesYou have a report that displays the Amount Sold metric for each product category. The following expression returns 125,000 as the amount sold for the Bicycles product category:

ValueOf({Amount Sold}, "{Prod Category}='Bicycles'")

Prod Category Amount Sold

------------- -----------

Toys 500,000

Clothes 250,555

Bicycles 125,000

Scooters 4300

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Required. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

244 Chapter 4: Functions

Page 273: DA_FunctionReference

VAR

Returns the variance, treating values in a numeric metric or attribute as a sample population. The metric or attribute must include at least two values.

This function belongs to the Aggregate category.

SyntaxVar(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 5.766 as the variance for the Interest metric as a sample set of data:

Var({Interest})

Interest

--------

7.5

5

8.25

3

NotesThis function ignores NULLs when performing the calculation. This function returns NULL if the provided list includes less than two values.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Var 245

Page 274: DA_FunctionReference

VARP

Returns the variance, treating values in a numeric metric or attribute as a complete population. The metric or attribute must include at least two values.

This function belongs to the Aggregate category.

SyntaxVarP(List [, Context])

Return ValueNumeric

ExamplesThe following expression returns 4.324 as the variance of each value in the Interest metric for an entire population:

VarP({Interest})

Interest

--------

7.5

5

8.25

3

NotesThis function ignores NULLs when performing the calculation. This function returns NULL if the provided list includes less than two values.

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

246 Chapter 4: Functions

Page 275: DA_FunctionReference

WEEKNUM

Returns the number of the week within an year for a date value. The function returns the number of the week as an integer.

This function belongs to the Date & Time category.

SyntaxWeekNum(Date)

Return ValueNumeric

ExamplesThe following expression returns the number of the week for the Ship Date attribute values:

WeekNum({Ship Date})

Ship Date Return Value

--------- ------------

9/10/2004 37

9/22/2004 39

10/1/2004 40

11/5/2004 45

NotesReturns the ISO week number, which is not the same as Excel.

To pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

WeekNum 247

Page 276: DA_FunctionReference

WEEKDAY

Returns the day of the week of a date value. The function returns the day of the week as an integer, with values ranging from 1 (Monday) to 7 (Sunday).

This function belongs to the Date & Time category.

SyntaxWeekday(Date)

Return ValueNumeric

ExamplesThe following expression returns the day of the week for the Ship Date attribute values:

Weekday({Ship Date})

Ship Date Return Value

--------- ------------

9/10/2004 5

9/22/2004 3

10/1/2004 5

10/5/2004 2

NotesThe PowerAnalyzer Weekday function is different than the Microsoft Excel Weekday function. The Excel Weekday function returns values ranging from 1 (for Sunday) to 7 (for Saturday). To get the same output as the Excel Weekday function, use the following expression:

Mod(Weekday(<date>), 7) + 1

To pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

248 Chapter 4: Functions

Page 277: DA_FunctionReference

WEIBULL

Returns the statistical Weibull distribution. You can use this function to perform reliability analysis. The value of the Cumulative argument determines the form of the function. If you pass TRUE as the value of the Cumulative argument, PowerAnalyzer calculates the Weibull cumulative distribution. If you pass FALSE, PowerAnalyzer calculates the Weibull probability density.

This function belongs to the Statistical category.

SyntaxWeibull(X, Alpha, Beta, Cumulative)

Return ValueNumeric

ExamplesThe following expression returns 1.00 as the Weibull cumulative distribution:

Weibull(121, 10, 15, TRUE)

The following expression returns 0.00 as the Weibull probability density:

Weibull(121, 10, 15, FALSE)

Argument Datatype Description

X Numeric Required. Number for which you want to perform the calculation. Must be greater than or equal to 0.

Alpha Numeric Required. The alpha variable. Must be greater than 0.

Beta Numeric Required. The beta variable. Must be greater than 0.

Cumulative Boolean Required. Logical value that determines the form of the function. If cumulative is TRUE, the function returns the cumulative answer. Otherwise, it does not return the cumulative answer.

Weibull 249

Page 278: DA_FunctionReference

WITHIN

Compares a given value to all values in a list and returns TRUE if the given value is the same as the value in the list. The function returns FALSE if the given value is different than the value in the list. The Compare1 argument is the given value, which can be a metric or attribute. The CompareList argument is a comma-separated list of values. You can use this function to compare metric or attribute values to a list of dates, strings, or numbers. The list of dates, strings, or numbers must be enclosed within quotation marks.

This function belongs to the Comparative category.

SyntaxWithin(Compare1, CompareList)

Return ValueBoolean

ExamplesThe following expression determines that the number 10 is within the list of comma-separated values and returns TRUE:

Within(10, "100, 10, 22, 18")

The following expression compares the values for the Promo Begin Date metric to the date June 1, 2004:

Within({Promo Begin Date}, "2004-06-01")

Promo Begin Date Return Value

---------------- ------------

2004-03-10 FALSE

2004-06-06 FALSE

2004-06-01 TRUE

2003-12-15 FALSE

NotesWhen comparing a date attribute to the values in a list, you must enter values in the yyyy-MM-dd format.

Argument Datatype Description

Compare1 Varies Required. Value you want to compare. You can pass a numeric, date, or string value.

CompareList String Required. Comma separated list of values. You can pass numeric, date, or string values.

250 Chapter 4: Functions

Page 279: DA_FunctionReference

When comparing a given string value to the values in the list, the Within function ignores the case of the letters.

Within 251

Page 280: DA_FunctionReference

XIRR

Returns the internal rate of return for a series of cash flows, where the cash flows might not occur at periodic intervals of time. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Financial category.

SyntaxXIRR(CashFlows, Dates [, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 0.801 as the internal rate of return:

XIRR({Cash Flows}, {Payment Date})

Payment Date Cash Flows

------------ ----------

1/1/2004 -15000

3/1/2004 10000

5/30/2004 5000

8/15/2004 2000

11/4/2004 1000

Argument Datatype Description

CashFlows Numeric List Required. Name of a metric or attribute representing a series of cash flows.

Dates Date List Required. List of dates passed to the function. Use a date attribute name.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

252 Chapter 4: Functions

Page 281: DA_FunctionReference

NotesThe cash flows must include at least one positive and at least one negative value.

To calculate the internal rate of return for periodic cash flows, use the IRR function.

XIRR 253

Page 282: DA_FunctionReference

XNPV

Returns the net present value for a series of cash flows, where the cash flows might not occur at periodic intervals of time. In the cash flow, negative values represent future payments and positive values represent income. As the value of the Rate argument, pass the rate of discount that applies to the cash flows. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Financial category.

SyntaxXNPV(CashFlows, Dates, Rate [, CurrencyDecimals, Context1, Context2])

Return ValueNumeric

ExamplesThe following expression returns 2000.14 as the net present value:

XNPV({Cash Flows}, {Payment Date}, 0.12)

Payment Date Cash Flows

------------ ----------

1/1/1998 -15000

Argument Datatype Description

CashFlows Numeric List Required. Name of a metric or attribute representing a series of cash flows.

Dates Date List Required. List of dates passed to the function. Use a date attribute name.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

CurrencyDecimals Numeric Optional. Currency places to the right of the decimal point. Default is 2. Must be between 0 and 3, inclusive.

Context1 String Optional. First filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

Context2 String Optional. Second filter for setting a scope for the function. Default is the same as the value of Context1. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

254 Chapter 4: Functions

Page 283: DA_FunctionReference

3/1/1998 10000

10/30/1998 5000

2/15/1999 2000

4/1/1999 1000

NotesThe cash flows must include at least one positive and at least one negative value.

To calculate the net present value for a series of periodic cash flows, use the NPV function.

When you pass an optional argument, you must also pass all other optional arguments that occur before it in the function syntax.

XNPV 255

Page 284: DA_FunctionReference

YEAR

Returns the year of a date value. The Year function returns the year as an integer.

This function belongs to the Date & Time category.

SyntaxYear(Date)

Return ValueNumeric

ExamplesAll of the following examples return the number 2004:

Year(Date(2004, 9, 10))

Year(DateValue("2004/06/10"))

Year(Today()), where today's date is October 10, 2004

Year(AddToDate(Today()), 0, 0, 9) where today's date is October 1, 2004

Year({Day Shipped}), where the value of the Day Shipped attribute is July 10, 2004

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

Date Date Required. Date value you want to pass to the function.

256 Chapter 4: Functions

Page 285: DA_FunctionReference

YIELD

Returns the yield on a security that pays periodic interest. The function returns the yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

This function belongs to the Financial category.

SyntaxYield(SettlementDate, MaturityDate, Rate, Price, Redemption [, Frequency, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 0.20 as the yield on a government bond:

Yield(Date(2004,3,31), Date(2004,11,30), 0.095, 93.5, 100, "annual","30E+/360")

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

Price Numeric Required. Security price per $100 face value. Must be greater than 0.

Redemption Numeric Required. Amount to be received at maturity per $100 face value. Must be greater than 0.

Frequency String Optional. Frequency of payments. The frequency can be "annual", "semiannual", "quarterly", "monthly", "weekly", or "daily". Default is "annual". Enclose the frequency within quotation marks.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

Yield 257

Page 286: DA_FunctionReference

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

258 Chapter 4: Functions

Page 287: DA_FunctionReference

YIELDDISC

Returns the annual yield on a discounted security. The function returns the annual yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

This function belongs to the Financial category.

SyntaxYieldDisc(SettlementDate, MaturityDate, Price, Redemption [, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 0.10 as the annual yield on a discounted bond:

YieldDisc(Date(2004,3,31), Date(2004,11,30), 93.5, 100, "ACT/365")

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

Price Numeric Required. Security price per $100 face value. Must be greater than 0.

Redemption Numeric Required. Amount to be received at maturity per $100 face value. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

YieldDisc 259

Page 288: DA_FunctionReference

YIELDMAT

Returns the annual yield of a security that pays interest at maturity. The function returns the annual yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

This function belongs to the Financial category.

SyntaxYieldMat(SettlementDate, MaturityDate, IssueDate, Rate, Price [, DayCountBasis])

Return ValueNumeric

ExamplesThe following expression returns 0.13 as the annual yield on a bond that pays interest at maturity:

Yieldmat(DateValue("2004/03/31"), DateValue("2004/11/30"), DateValue("2003/11/30"), 0.052, 95)

NotesTo pass a date to this function, use a date attribute or another function that generates a date value. Examples of functions that generate a date value include Date, DateValue, Today, and AddToDate.

Argument Datatype Description

SettlementDate Date Required. Date when the security will settle. The settlement date is the date after the issue date when the security is traded to the buyer. Must be less than MaturityDate.

MaturityDate Date Required. Date when the security matures or expires.

IssueDate Date Required. Date when the security was issued. Must be less than or equal to SettlementDate.

Rate Numeric Required. Interest rate, expressed as a decimal number. Divide the percent rate by 100 to express it as a decimal number. Must be greater than or equal to 0.

Price Numeric Required. Security price per $100 face value. Must be greater than 0.

DayCountBasis String Optional. Day count basis used in date calculations. Day count basis is a method of interest calculation using a day count fraction. The day count basis can be "ACT/360", "ACT/365", "ACT/365L", "ACT/ACT", "NASD 30/360", "30/360", "30E/360", or "30E+/360". Default is "NASD 30/360". You must enclose the day count basis within quotation marks.

260 Chapter 4: Functions

Page 289: DA_FunctionReference

ZTEST

Returns the two-tailed probability of a z-test for a given numeric value, X. The List argument is the numeric metric or attribute that contains the range of data against which you want to test X. StdDev is the standard deviation of the population. Use the Context argument to narrow the scope of the function to specific metric or attribute values.

This function belongs to the Aggregate category.

SyntaxZTest(List, X [, StdDev, Context])

Return ValueNumeric

ExamplesThe following expression returns 0.00695 as the z-test probability of getting 2 defective parts on an assembly line for products in the Widgets product group:

ZTest({Defective Parts}, 2, 12, "{Product Group}='Widgets'")

Product Group Defective Parts

------------- ---------------

Widgets 10

Widgets 15

Tools 3

Widgets 20

Tools 1

Widgets 18

Widgets 13

Argument Datatype Description

List Numeric List Required. Name of a metric or attribute.

X Numeric Required. Number for which you want to perform the calculation.

StdDev Numeric Optional. Standard deviation of a list of numbers. Must be greater than 0.

Context String Optional. Filter for setting a scope for the function. Context allows you to narrow the calculation to a set of attribute or metric values. You must enclose the Context within quotation marks. The syntax for the Context argument depends on the function where you are using it.

ZTest 261

Page 290: DA_FunctionReference

262 Chapter 4: Functions

Page 291: DA_FunctionReference

A p p e n d i x A

Function Quick Reference

This appendix provides a quick reference for all functions available in Data Analyzer:

♦ Aggregate Functions, 264

♦ Boolean Functions, 269

♦ Comparative Functions, 270

♦ Conditional Functions, 271

♦ Conversion Functions, 272

♦ Date & Time Functions, 273

♦ Fetch Functions, 275

♦ Financial Functions, 276

♦ Mathematical Functions, 282

♦ Rounding Functions, 283

♦ Running Functions, 284

♦ Statistical Functions, 285

♦ String Functions, 289

♦ Trigonometric Functions, 291

♦ Unary Functions, 293

263

Page 292: DA_FunctionReference

Aggregate Functions

Table A-1 lists functions in the Aggregate category:

Table A-1. Functions in the Aggregate Category

Function Syntax Description

AveDev AveDev(List [, Context]) Returns the average of the absolute deviations of values in a list from their mean. The AveDev function determines the variability in a set of values.

Avg Avg(List [, Context]) Returns the average of all values in a list.

ChiTest ChiTest(ListObserved, ListExpected [, Context1, Context2])

Returns the chi-squared goodness of fit between expected and observed lists. Use this function to find out if results based on a hypothesis are verified by an experiment. Pass numeric metrics or attributes as the values for the ListExpected and ListObserved arguments. Use the Context argument to narrow the scope of the function to specific metric or attribute values. The Context1 argument corresponds to the ListObserved argument and the Context2 argument corresponds to the ListExpected argument.

Correl Correl(List1, List2 [, Context1, Context2])

Returns the correlation coefficient of two sets of values. Use the correlation coefficient to determine the relationship between two sets of values. Pass numeric metrics or attributes as the values for the first and second List arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

CountAll CountAll(List [, Context]) Counts the number of values within a given metric or attribute. Use this function to get the number of rows in a column. Use the Context argument to count a specific set of metric or attribute values.

CountUnique CountUnique(List [, Context]) Counts the number of unique values within a given metric or attribute. Use this function to get the number of unique rows in a column. Use the Context argument to count a specific set of metric or attribute values.

264 Appendix A: Function Quick Reference

Page 293: DA_FunctionReference

Covar Covar(List1, List2 [, Context1, Context2])

Returns covariance of two sets of values. Covariance is the average of the products of deviations for each data point pair. Use this function to determine the relationship between two sets of values. Pass numeric metrics or attributes as the values for the first and second List arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

DevSq DevSq(List [, Context]) Returns the sum of squared deviations of a set of values from their sample mean. Use this function with a numeric metric or attribute. Use the Context argument to narrow the scope of specific metric or attribute value.

Forecast Forecast(X, ListY, ListX [, Context1, Context2])

Predicts a future value based on existing values. Use this function to determine future sales, inventory levels, or trends. You pass a single value and two sets of values (ListY and ListX) to the Forecast function. The single value is a ListX value. The function returns a predicted ListY value for the given ListX value. The function uses linear regression to predict the ListY value. Pass numeric metrics or attributes as the values for the ListY and ListX arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The Context1 argument corresponds to the ListY argument and the Context2 argument corresponds to the ListX argument.

GeoMean GeoMean(List [, Context]) Returns the geometric mean of a set of values, where each value must be a positive value. Pass numeric metrics or attributes as the List argument. Use the Context argument to narrow the scope of specific metric or attribute value.

HarMean HarMean(List [, Context]) Returns the harmonic mean of a set of values, where each value must be a positive value. The harmonic mean is the reciprocal of the arithmetic mean of reciprocals.

Kurt Kurt(List [, Context]) Returns the kurtosis of a set of values. Use kurtosis to compare the relative peakedness or flatness of a distribution with the normal distribution. Positive kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a relatively flat distribution. Use the Context argument to narrow the scope of specific metric or attribute value.

Table A-1. Functions in the Aggregate Category

Function Syntax Description

Aggregate Functions 265

Page 294: DA_FunctionReference

Max Max(List [, Context]) Returns the maximum value of a numeric metric or attribute.

Median Median(List [, Context]) Returns the median value for a numeric metric or attribute. In a set of numeric data in ascending or descending order, the median is the value in the middle of the data set with an equal number of values distributed above and below that value. When there is an even number of values in the set, median is the average of the two numbers in the middle. Use the Context argument to narrow the scope of specific metric or attribute value.

Min Min(List [, Context]) Returns the minimum value of a numeric metric or attribute.

Mode Mode(List [, Context]) Returns the value that occurs most frequently in a numeric metric or attribute. When more than one value occurs at the greatest frequency, then the Mode function returns the first value to reach the greatest frequency.

Pearson Pearson(List1, List2 [, Context1, Context2])

Returns the Pearson product moment correlation coefficient (r). The value of the Pearson product moment correlation coefficient is in the range -1.0 to 1.0, inclusive. Use this function to determine the extent of a linear relationship between two sets of values (ListY and ListX). Pass numeric metrics or attributes as the values for the ListY and ListX arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

Product Product(List [, Context]) Returns the result of multiplying values in a numeric metric or attribute.

Skew Skew(List [, Context]) Returns the statistical skewness of a distribution. Skewness is the degree of asymmetry of a distribution around its mean. A distribution is symmetric if it looks the same to the left and right of the center point. Positive skewness means the distribution has an asymmetric tail towards more positive values. Negative skewness means the distribution has an asymmetric tail towards more negative values.

Table A-1. Functions in the Aggregate Category

Function Syntax Description

266 Appendix A: Function Quick Reference

Page 295: DA_FunctionReference

Slope Slope(ListY, ListX [, Context1, Context2])

Returns the slope of the linear regression line that runs through values in two lists (ListY and ListX). The slope is the vertical distance divided by the horizontal distance between any two points on the line, which is the rate of change along the regression line. Use numeric metric or attribute names as values of the ListY and ListX arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The first Context argument corresponds to the ListY argument and the second Context argument corresponds to the ListX argument.

Stdev Stdev(List [, Context]) Returns the standard deviation, treating values for a numeric metric or attribute as a sample population. The metric or attribute must include at least two values.

StdevP StdevP(List [, Context]) Returns the standard deviation, treating values for a numeric metric or attribute as a complete population. The metric or attribute must include at least two values.

Steyx Steyx(ListY, ListX [, Context1, Context2])

Returns the statistical standard error of linear regression between two lists of values (ListY and ListX). The standard error is a measure of the amount of error in the prediction of a Y value for an X value. Use metric or numeric attribute names as values of the ListY and ListX arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The first Context argument corresponds to the ListY argument and the second Context argument corresponds to the ListX argument.

Sum Sum(List [, Context]) Returns the sum of all values.

TTest TTest(List1, List2 [, Context1, Context2])

Returns the two-tailed probability associated with a Student's T-test. Use the TTest function to determine whether two samples (List1 and List2) are likely to have come from the same population and have the same mean. Use the Context argument to narrow the scope of specific metric or attribute value. The Context1 argument corresponds to the List1 argument and the Context2 argument corresponds to the List2 argument.

Table A-1. Functions in the Aggregate Category

Function Syntax Description

Aggregate Functions 267

Page 296: DA_FunctionReference

TriMean TriMean(List [, Context]) Returns the statistical trimean of a set of values. Trimean is calculated by adding the 25th percentile, twice the 50th percentile, the 75th percentile and dividing the result by four. For example, the 25th, 50th, and 75th percentile of a set of values are 51, 55, and 63, respectively. The trimean of the set of values is (51+55+55+63)/4, which equals 56. Use the TriMean function when you want to compute the mean that is less influenced by extreme data. Use the Context argument to narrow the scope of specific metric or attribute value.

ValueOf ValueOf(List, Context) Returns the value of a given metric for a given context.

Var Var(List [, Context]) Returns the variance, treating values in a numeric metric or attribute as a sample population. The metric or attribute must include at least two values.

VarP VarP(List [, Context]) Returns the variance, treating values in a numeric metric or attribute as a complete population. The metric or attribute must include at least two values.

ZTest ZTest(List, X [, StdDev, Context])

Returns the two-tailed probability of a z-test for a given numeric value, X. The List argument is the numeric metric or attribute that contains the range of data against which you want to test X. StdDev is the standard deviation of the population. Use the Context argument to narrow the scope of specific metric or attribute value.

Table A-1. Functions in the Aggregate Category

Function Syntax Description

268 Appendix A: Function Quick Reference

Page 297: DA_FunctionReference

Boolean Functions

Table A-2 lists functions in the Boolean category:

Table A-2. Functions in the Boolean Category

Function Syntax Description

And And(BooleanValue1, BooleanValue2)

Joins two conditions and returns TRUE if both conditions are true. Returns FALSE if any condition or both conditions are not true.

Not Not(BooleanValue) Returns the reverse of a TRUE or FALSE value passed to the function. If you pass TRUE, the Not function returns FALSE. If you pass FALSE, the Not function returns TRUE. Use this function within an expression, where you want get the reverse Boolean value of a given value.

Or Or(BooleanValue1, BooleanValue2)

Compares two conditions and returns TRUE if either of the two conditions is TRUE. Returns FALSE if both conditions are FALSE. Use metric and attribute names in the arguments.

Boolean Functions 269

Page 298: DA_FunctionReference

Comparative Functions

Table A-3 lists functions in the Comparative category:

Table A-3. Functions in the Comparative Category

Function Syntax Description

Equals Equals(Compare1, Compare2) Compares two numeric values and returns TRUE if the values are equal or FALSE if the values are not equal. Use this function to compare metrics or attributes to other metrics, attributes, or constant values.

GreaterThan GreaterThan(Compare1, Compare2)

Compares two numeric values. Use this function to compare metrics or attributes to other metrics, attributes, or constant values.

GreaterThanEquals GreaterThanEquals(Compare1, Compare2)

Compares two numeric values. Use this function to compare metrics or attributes to other metrics, attributes, or constant values.

LessThan LessThan(Compare1, Compare2) Compares two numeric values Use this function to compare metrics or attributes to other metrics, attributes, or constant values.

LessThanEquals LessThanEquals(Compare1, Compare2)

Compares two numeric values. Use this function to compare metrics or attributes to other metrics, attributes, or constant values.

NotEquals NotEquals(Compare1, Compare2) Compares two numeric values. Use this function to compare metrics or attributes to other metrics, attributes, or constant values.

Within Within(Compare1, CompareList) Compares a given value to all values in a list and returns TRUE if the given value is the same as the value in the list. The function returns FALSE if the given value is different than the value in the list. The Compare1 argument is the given value, which can be a metric or attribute. The CompareList argument is a comma-separated list of values. Use this function to compare metric or attribute values to a list of dates, strings, or numbers. The list of dates, strings, or numbers must be enclosed within quotation marks.

270 Appendix A: Function Quick Reference

Page 299: DA_FunctionReference

Conditional Functions

Table A-4 lists functions in the Conditional category:

Table A-4. Functions in the Conditional Category

Function Syntax Description

If If(If, True, False) Returns one of two specified values based on the results of a condition.

IfNull IfNull(List, ReturnValue [, OtherValue]

Returns the specified value if a condition returns NULL. Use to replace NULL in a metric or attribute.

Condit ional Functions 271

Page 300: DA_FunctionReference

Conversion Functions

Table A-5 lists the function in the Conversion category:

Table A-5. Function in the Conversion Category

Function Syntax Description

Units Units(Units1, Units2, NumericValue) Converts the value you specify in one unit of measure (Units1) to another unit of measure (Units2), and returns the new value.

272 Appendix A: Function Quick Reference

Page 301: DA_FunctionReference

Date & Time Functions

Table A-6 lists the functions in the Date & Time category:

Table A-6. Functions in the Date & Time Category

Function Syntax Description

AddToDate AddToDate(Date, Years, Months, Days)

Adds years, months, and days to a date, and returns the adjusted date. Use this function to pass a date value to another function.

Date Date(Year, Month, Day) Returns a date given the year, month, and day values you pass to the function. Use this function to pass a date value to another function.

DateString DateString(Date [, DateFormat])

Converts a date to a string. By default, the function returns the date string in the M/d/yy format. To have the DateString function return the date string in a format different than the default format, you can pass the DateFormat argument to the function. The DateFormat argument provides the DateString function information about the date format you are passing.

DateValue DateValue(DateString [, DateFormat])

Converts a string to a date. You can pass the date string in date format of the system locale. The DateValue function also recognizes certain commonly used date formats. You can pass the date string to the DateValue function in any of these date formats, which are recognized by the function. You can also pass the date string in other unrecognized date formats. When you pass the date string in an unrecognized date format, you must also pass the DateFormat argument to the function. The DateFormat argument provides the DateValue function information about the date format you are passing. Use this function to pass a date value to another function.

Day Day(Date) Returns the day of a date value. The Day function returns the day as an integer, with values ranging from 1 to 31.

ElapsedDays ElapsedDays(Date1, Date2 [, DayCountBasis])

Returns the number of days in the period between the specified start time and end time, given a day count basis. Use this function with date attributes.

ElapsedHours ElapsedHours(Date1, Date2) Returns the number of hours in the period between the specified start time and end time. Use this function with date attributes. The ElapsedHours function precision is milliseconds (expressed as a decimal number).

ElapsedYears ElapsedYears(Date1, Date2 [, DayCountBasis])

Returns the number of years in the period between the specified start time and end time, given a day count basis. The elapsed number of years is expressed as a decimal number. Use this function with date attributes.

Date & Time Functions 273

Page 302: DA_FunctionReference

EndOfMonth EndOfMonth(Date) Returns the last date in the month for a given date value. Use the EndOfMonth function to calculate due dates that correspond with the last date of a month. Use this function to pass a date value to another function.

Hour Hour(Date) Returns a number representing the hour of the day of a date value. The function returns the hour as an integer with values ranging from 0 to 23.

Minute Minute(Date) Returns the minutes of the time part of a date value. The function returns the minutes as an integer with values ranging from 0 to 59.

Month Month(Date) Returns the month of a date value. The function returns the month as an integer, with values ranging from 1 (January) to 12 (December).

NextDate NextDate(Date, Frequency [, NumberPeriods])

Returns the next date in a period or payment schedule.

Now Now() Returns the value of the current date and time. Use this function to pass a date value to another function.

Second Second(Date) Returns the second of the time part of a date value. The function returns the second as an integer with values ranging from 0 to 59.

Time Time(Date, Hour [, Minute, Second])

Sets the time of day for a date. Use this function to set the time for a date value, when only the date part is known. You can also use this function to change the time part of a date value.

Today Today() Returns the value of the current date. Use this function to pass a date value to another function.

WeekNum WeekNum(Date) Returns the number of the week within an year for a date value. The function returns the number of the week as an integer.

Weekday Weekday(Date) Returns the day of the week of a date value. The function returns the day of the week as an integer, with values ranging from 1 (Monday) to 7 (Sunday).

Year Year(Date) Returns the year of a date value. The Year function returns the year as an integer.

Table A-6. Functions in the Date & Time Category

Function Syntax Description

274 Appendix A: Function Quick Reference

Page 303: DA_FunctionReference

Fetch Functions

Table A-7 lists the functions in the Fetch category:

Table A-7. Functions in the Fetch Category

Function Syntax Description

Next Next(Metric) Returns the next value for the specified metric.

Previous Previous(Metric) Returns the previous value for the specified metric or attribute.

Fetch Functions 275

Page 304: DA_FunctionReference

Financial Functions

Table A-8 lists the functions in the Financial category:

Table A-8. Functions in the Financial Category

Function Syntax Description

AccrInt AccrInt(IssueDate, FirstInterestDate, SettlementDate, Rate [, ParValue, Frequency, DayCountBasis, CurrencyDecimals])

Returns the accrued interest for a security that pays periodic interest. The interest rate (Rate argument) must be adjusted for the frequency of payments. To adjust the interest rate for frequency, divide the annual rate by the number of payments made in an year. For example, a coupon pays an annual interest rate of 15 percent and the frequency is Quarterly. Calculate the value of the Rate argument by dividing 15% by 4.

AccrIntM AccrIntM(IssueDate, SettlementDate, Rate [, ParValue, DayCountBasis, CurrencyDecimals])

Returns the accrued interest for a security that pays interest at maturity. The interest rate (Rate argument) must be adjusted for the frequency of payments. To adjust the interest rate for frequency, divide the annual rate by the number of payments made in an year.

AmorDegrC AmorDegrC(Cost, PurchaseDate, FirstPeriodDate, Salvage, Period, Rate [, DayCountBasis, CurrencyDecimals])

Returns the depreciation for each accounting period, based on a depreciation coefficient. If an asset is purchased in the middle of the accounting period, the function prorates the depreciation. This function is similar to the AmorLinC function, except that a depreciation coefficient is applied in the calculation depending on the life of the asset.

AmorLinC AmorLinC(Cost, PurchaseDate, FirstPeriodDate, Salvage, Period, Rate [, DayCountBasis, CurrencyDecimals])

Returns the depreciation for each accounting period. If an asset is purchased in the middle of the accounting period, the function prorates the depreciation.

CoupDayBS CoupDayBS(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Returns the total number of coupon days from the beginning of a coupon period to the settlement date.

CoupDayS CoupDayS(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Returns the total number of coupon days in the coupon period that contains the settlement date.

CoupDaySNC CoupDaySNC(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Returns the total number of coupon days from the settlement date to the next coupon date.

CoupNCD CoupNCD(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Returns the next coupon date after the settlement date of a security.

276 Appendix A: Function Quick Reference

Page 305: DA_FunctionReference

CoupNum CoupNum(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Returns the number of coupons payable between the settlement date and maturity date. Data Analyzer rounds the number of coupons to the nearest whole number.

CoupPCD CoupPCD(SettlementDate, MaturityDate [, Frequency, DayCountBasis])

Returns the previous coupon date before the settlement date of a security.

CumIPmt CumIPmt(Rate, NumberPeriods, PresentValue, StartPeriod, EndPeriod, PaymentAtBeginning [, CurrencyDecimals])

Returns the cumulative interest paid for a loan between two specified periods of time. The Rate argument represents the interest rate for each period. Calculate NumberPeriods by multiplying the term of the loan by number of payments per year.

CumPrinc CumPrinc(Rate, NumberPeriods, PresentValue, StartPeriod, EndPeriod, PaymentAtBeginning [, CurrencyDecimals])

Returns the cumulative principal paid on a loan between two specified periods of time. The Rate argument represents the interest rate for each period. Calculate NumberPeriods by multiplying the term of the loan by number of payments per year.

DB DB(Cost, Salvage, Life, Period [, FirstYearMonths, CurrencyDecimals])

Returns the depreciation of an asset for a specified period using the fixed-declining balance depreciation calculation. The fixed-declining balance method calculates depreciation at a fixed rate. The value of the Period argument is the time period for which you want to calculate the depreciation.

DDB DDB(Cost, Salvage, Life [, Period, RateFactor, CurrencyDecimals])

Returns the depreciation of an asset for a specified period using the double-declining balance depreciation calculation. The double-declining balance method calculates depreciation at an accelerated rate. In the first period, depreciation is highest and it decreases in each subsequent period. The value of the Period argument is the time period for which you want to calculate the depreciation. Use the RateFactor argument to pass a value for the rate at which the balance declines.

DfToRate DfToRate(DiscountFactor, RateConvention, ElapsedYears)

Returns the rate, given the discount factor. The discount factor is a number that is multiplied by a monetary value to reduce an expected future sum to its present value. This function is the reverse of the RateToDf function. Use the DfToRate function to compute the rate when the discount factor is known.

Disc Disc(SettlementDate, MaturityDate, Price, Redemption [, DayCountBasis])

Returns the discount rate for a security, expressed as a decimal number. To convert it to a percentage, multiply the discount rate by 100.

Table A-8. Functions in the Financial Category

Function Syntax Description

Financial Functions 277

Page 306: DA_FunctionReference

Effect Effect(Rate, NumberPeriods) Returns the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year. The effective annual interest rate is expressed as a decimal number. To convert it to a percentage, multiply the rate by 100.

FV FV(Rate, NumberPeriods, Payment [, PresentValue, PaymentAtBeginning, CurrencyDecimals])

Returns the future value of an investment, where you make periodic, constant payments and the investment earns a constant interest rate. The Rate argument represents the interest rate earned in each period. PresentValue is the current value of the investment. If you omit the PresentValue argument, the FV function assumes it to be 0.

IRR IRR(CashFlows [, Context]) Returns the internal rate of return for a series of cash flows represented by a set of values. These cash flows do not have to be of equal value, but they must occur at regular intervals, such as monthly or annually. Use the Context argument to narrow the scope of specific metric or attribute value.

IntRate IntRate(SettlementDate, MaturityDate, Investment, Redemption [, DayCountBasis])

Returns the interest rate for a fully-invested security. The interest rate is expressed as a decimal number. To convert it to a percentage, multiply the interest rate by 100.

NPV NPV(CashFlows, Rate [, CurrencyDecimals, Context])

Calculates the net present value of an investment by using a discount rate and a series of cash flows. Use a metric to pass the cash flow values to the function. These cash flows do not have to be of equal value, but they must occur at regular periods of time, such as monthly or annually. In the cash flow, negative values represent future payments and positive values represent income. As the value of the Rate argument, pass the rate of discount over the length of one period. Use the Context argument to narrow the scope of specific metric or attribute value.

NPer NPer(Rate, PresentValue, Payment [, FutureValue, PaymentAtBeginning])

Returns the number of periods for an investment based on a constant interest rate and periodic, constant payments. The value of the Rate argument is the interest rate earned in each period. PresentValue is the lump-sum amount that a series of future payments is worth now. FutureValue is the cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the NPer function assumes it to be 0. For example, the future value of a loan is 0.

Table A-8. Functions in the Financial Category

Function Syntax Description

278 Appendix A: Function Quick Reference

Page 307: DA_FunctionReference

Nominal Nominal(Rate, NumberPeriods) Returns the nominal annual interest rate, given the effective rate and the number of compounding periods per year.

PV PV(Rate, NumberPeriods, Payment [, FutureValue, PaymentAtBeginning, CurrencyDecimals])

Returns the present value of an investment. The present value is the lump-sum amount that a series of future payments is worth now. Rate is the interest rate earned in each period. FutureValue is the cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the PV function assumes it to be 0. For example, the future value of a loan is 0.

PeriodsPerYear PeriodsPerYear([Frequency]) Returns the number of periods per year, given the frequency of payments. Use this function to pass the period value to other financial functions.

Pmt Pmt(Rate, NumberPeriods, PresentValue [, FutureValue, PaymentAtBeginning, CurrencyDecimals])

Returns the payment for a loan based on constant payments and a constant interest rate. The Rate argument is the interest rate for the loan for each period. The PresentValue is the principal for the loan. The FutureValue is cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the Pmt function assumes it to be 0.

Price Price(SettlementDate, MaturityDate, Rate, Yield, Redemption [, Frequency, DayCountBasis, CurrencyDecimals])

Returns the price per $100 face value of a security that pays periodic interest.

PriceDisc PriceDisc(SettlementDate, MaturityDate, Discount, Redemption [, DayCountBasis, CurrencyDecimals])

Returns the price per $100 face value of a discounted security.

PriceMat PriceMat(SettlementDate, MaturityDate, IssueDate, Rate, Yield [, DayCountBasis, CurrencyDecimals])

Returns the price per $100 face value of a security that pays interest at maturity.

Rate Rate(NumberPeriods, Payment, PresentValue [, FutureValue, PaymentAtBeginning, CurrencyDecimals])

Returns the interest rate earned per period by a security. PresentValue is the lump-sum amount that a series of future payments is worth now. FutureValue is cash balance you want to attain after the last payment is made. If you omit the FutureValue argument, the Rate function assumes it to be 0. For example, the future value of a loan is 0.

Table A-8. Functions in the Financial Category

Function Syntax Description

Financial Functions 279

Page 308: DA_FunctionReference

RateToDf RateToDf(Rate, RateConvention, ElapsedYears)

Returns the discount factor, given the rate. The discount factor is a number that is multiplied by a monetary value to reduce an expected future sum to its present value. Use the discount factor to evaluate the return on a capital investment, by calculating the present value of future cash flows. This function is the reverse of the DfToRate function. Use the RateToDf function to compute the rate when the discount factor is known.

Received Received(SettlementDate, MaturityDate, Investment, Discount [, DayCountBasis, CurrencyDecimals])

Returns the amount received when a fully invested security matures.

SLn SLn(Cost, Salvage, Life [, CurrencyDecimals])

Returns the straight-line depreciation of an asset for one period.

SYD SYD(Cost, Salvage, Life, Period [, CurrencyDecimals])

Returns the depreciation of an asset using the sum-of-years' digits method for a given period.

TBillEq TBillEq(SettlementDate, MaturityDate, Discount)

Returns the bond-equivalent yield for a Treasury bill. The function returns the yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

TBillPrice TBillPrice(SettlementDate, MaturityDate, Discount)

Returns the price per $100 face value for a Treasury bill.

TBillYield TBillYield(SettlementDate, MaturityDate, Price)

Returns the yield for a USA Treasury bill. The function returns the yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

VDB VDB(Cost, Salvage, Life, StartPeriod, EndPeriod [, RateFactor, NoSwitch, CurrencyDecimals])

Returns the variable declining balance. The variable declining balance is the depreciation of an asset for a specified period, using the double-declining balance method or any other specified method. Use the VDB function to switch to the straight-line depreciation method when depreciation is greater than the declining balance calculation. By default, the function uses the double-declining balance method for calculating the variable declining balance.

XIRR XIRR(CashFlows, Dates [, Context1, Context2])

Returns the internal rate of return for a series of cash flows, where the cash flows might not occur at periodic intervals of time. Use the Context argument to narrow the scope of specific metric or attribute value.

Table A-8. Functions in the Financial Category

Function Syntax Description

280 Appendix A: Function Quick Reference

Page 309: DA_FunctionReference

XNPV XNPV(CashFlows, Dates, Rate [, CurrencyDecimals, Context1, Context2])

Returns the net present value for a series of cash flows, where the cash flows might not occur at periodic intervals of time. In the cash flow, negative values represent future payments and positive values represent income. As the value of the Rate argument, pass the rate of discount that applies to the cash flows. Use the Context argument to narrow the scope of specific metric or attribute value.

Yield Yield(SettlementDate, MaturityDate, Rate, Price, Redemption [, Frequency, DayCountBasis])

Returns the yield on a security that pays periodic interest. The function returns the yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

YieldDisc YieldDisc(SettlementDate, MaturityDate, Price, Redemption [, DayCountBasis])

Returns the annual yield on a discounted security. The function returns the annual yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

YieldMat YieldMat(SettlementDate, MaturityDate, IssueDate, Rate, Price [, DayCountBasis])

Returns the annual yield of a security that pays interest at maturity. The function returns the annual yield as a decimal number. To convert the yield to a percentage, multiply the return value by 100.

Table A-8. Functions in the Financial Category

Function Syntax Description

Financial Functions 281

Page 310: DA_FunctionReference

Mathematical Functions

Table A-9 lists the functions in the Mathematical category:

Table A-9. Functions in the Mathematical Category

Function Syntax Description

Add Add(NumericValue1, NumericValue2) Returns the sum of two numeric values.

Divide Divide(NumericValue1, NumericValue2)

Returns the result of the first numeric value divided by the second numeric value.

Factorial Factorial(NumericValue) Returns the factorial (n!) of a number, where n! equals 1*2*3*...*n. Use this function in mathematical calculations. If the number you pass to the function is not an integer, Data Analyzer truncates the number.

IntDivide IntDivide(NumericValue1, NumericValue2)

Divides one numeric value by another and returns the integer part of the quotient (result of the division).

Log Log(NumericValue) Returns the natural logarithm of a numeric value. The Log function uses E as the base for the logarithm calculation.

Log10 Log10(NumericValue) Returns the base 10 logarithm of a numeric value.

Log2 Log2(NumericValue) Returns the base 2 logarithm of a numeric value.

Max2 Max2(NumericValue1, NumericValue2)

Returns the maximum of two numeric values.

Min2 Min2(NumericValue1, NumericValue2)

Returns the minimum of two numeric values.

Mod Mod(NumericValue1, NumericValue2) Returns the modulus, the remainder of a division calculation, for any numeric metric or attribute.

Multiply Multiply(NumericValue1, NumericValue2)

Returns the product of one numeric value multiplied by another.

Power Power(NumericValue1, NumericValue2)

Returns the value of a number raised to an exponent. The first argument you pass to the function is the base value. The second argument you pass to the function is the exponent.

Sqrt Sqrt(NumericValue) Returns the square root of a given positive number. The square root of a negative number is not a value.

Square Square(NumericValue) Returns the square of a given number.

Subtract Subtract(NumericValue1, NumericValue2)

Returns the result of one numeric value subtracted by another.

282 Appendix A: Function Quick Reference

Page 311: DA_FunctionReference

Rounding Functions

Table A-10 lists the functions in the Rounding category:

Table A-10. Functions in the Rounding Category

Function Syntax Description

Ceiling Ceiling(NumericValue [, Significance])

Returns the value rounded up to the specified number of digits, towards positive infinity. The Data Analyzer Ceiling function differs from the Microsoft Excel Ceiling function. In the Data Analyzer Ceiling function, Significance is the number of digits to the right of the decimal point. In Excel, Significance is the multiple to which you want to round. The Data Analyzer Ceiling function rounds a number towards positive infinity, whereas the Excel Ceiling function rounds a number away from zero.

Floor Floor(NumericValue [, Significance])

Returns the value rounded down to the specified number of digits, towards positive infinity. The Data Analyzer Floor function differs from the Microsoft Excel Floor function. In the Data Analyzer Floor function, Significance is the number of digits to the right of the decimal point. In the Excel Floor function, Significance is the multiple to which you want to round. The Data Analyzer Floor function rounds a number towards positive infinity, whereas the Excel Floor function rounds a number away from zero.

Round Round(NumericValue [, Significance])

Returns all values rounded to the specified number of digits.

RoundDown RoundDown(NumericValue [, Significance])

Returns a value rounded down N number of places to the right of the decimal point. If N is a negative number, rounds down N places left of the decimal point.

RoundUp RoundUp(NumericValue [, Significance])

Returns a value rounded up N number of places to the right of the decimal point. If N is a negative number, rounds up N places left of the decimal point.

Trunc Trunc(NumericValue [, Significance])

Returns the value truncated to a specific digit.

Rounding Functions 283

Page 312: DA_FunctionReference

Running Functions

Table A-11 lists the functions in the Running category:

Table A-11. Functions in the Running Category

Function Syntax Description

MovingAvg MovingAvg(List, Size [, Context])

Returns the average (row-by-row) of a specified set of values. The Size argument defines the row set, or window, for which you want to calculate the moving average. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

MovingSum MovingSum(List, Size [, Context])

Returns the cumulative sum (row-by-row) of a specified set of values. The Size argument defines the row set, or window, for which you want to calculate the moving sum. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

PercentContribution PercentContribution(List [, Context])

For a set of values, returns each value as the percentage of the sum of all values in the set. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

RunningAvg RunningAvg(List [, Context]) Returns the average of the current value and all previous values in a row or column. Running average is different than moving average, because moving average is always for a specified group of values (Size argument). The MovingAvg function performs the calculation for each group of values at a time. RunningAvg function starts at the beginning and runs through the entire set of values, recalculating at each value. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

RunningSum RunningSum(List [, Context]) Returns the total of the current value and all previous values in a row or column. Running sum is different than moving sum, because moving sum is always for a specified group of values (Size argument). The MovingSum function performs the calculation for each group of values at a time. RunningSum function starts at the beginning and runs through the entire set of values, recalculating at each value. Use the Context argument to perform the calculation for the row, the column, or a time attribute used in the report.

284 Appendix A: Function Quick Reference

Page 313: DA_FunctionReference

Statistical Functions

Table A-12 lists the functions in the Statistical category:

Table A-12. Functions in the Statistical Category

Function Syntax Description

BinomDist BinomDist(X, Trials, ProbabilityOfSuccess, Cumulative)

Returns the value for the statistical binomial distribution. Binomial distribution is the probability of observing X number of successes in a fixed number of independent trials.

BinomInv BinomInv(Probability, Trials, ProbabilityOfSuccess)

Returns the number (integer) for which the cumulative binomial distribution is greater than or equal to a criterion value. The cumulative binomial distribution is the first argument (Probability) that you pass to the function. The BinomInv function is the statistical inverse of binomial distribution (BinomDist) function.

ChiDist ChiDist(X, DegreesOfFreedom) Returns the probability of the chi-squared distribution. The chi-squared distribution is associated with a chi-squared test and a certain number of degrees of freedom. Use the chi-squared test to compare observed and expected values.

ChiInv ChiInv(Probability, DegreesOfFreedom)

Returns the inverse of the probability associated with a chi-squared distribution. The ChiInv (Probability, DegressofFreedom) function returns the value X, where Probability is the return value of the ChiDist(X, DegressofFreedom) function.

Confidence Confidence(Alpha, StdDev, Size) Returns the confidence range for the mean of a population. The confidence range is a value on either side of a sample mean, which determines the standard deviation with a particular level of confidence. The level of confidence determines the value of the Alpha argument. Alpha equals (1-confidence level/100). For example, for an 80 percent confidence level, Alpha equals 0.2.

ExponDist ExponDist(X, Lambda, Cumulative)

Returns the exponential distribution. Exponential distribution is used to determine the time between consecutive, rare, and random events in a process with no memory. For example, you can use the ExponDist function to determine the time you have to wait before you get your next phone call. If you pass TRUE as the value of the Cumulative argument, ExponDist returns the cumulative distribution calculation. If you pass FALSE as the value of the Cumulative argument, the function returns the probability density calculation.

Statistical Functions 285

Page 314: DA_FunctionReference

FDist FDist(X, DegreesOfFreedomNum, DegreesOfFreedomDenom)

Returns the F probability distribution. The F probability distribution is typically used to develop hypothesis tests. Use the FDist function to calculate the one-sided probability of the likelihood that two variances are different.

FInv FInv(Probability, DegreesOfFreedomNum, DegreesOfFreedomDenom)

Returns the inverse of the probability associated with a F distribution. The Probability argument passed to the FInv function is the probability associated with the F distribution. The F probability distribution is typically used to develop hypothesis tests.

Fisher Fisher(X) Returns the Fisher transformation for a given value. Fisher returns a value that is an approximately normally distributed value rather than a skewed one. Use the Fisher transformation to test hypothesis on the correlation coefficient.

FisherInv FisherInv(X) Returns the statistical inverse of the Fisher transformation. Use this function when determining the relationship between ranges or arrays of data.

GammaDist GammaDist(X, Alpha, Beta) Returns the gamma distribution. The return value of the GammaDist function is the probability that a gamma-distributed random variable with arguments alpha and beta is less than or equal to x. Use this function to study variables that may have a skewed distribution.

GammaInv GammaInv(Probability, Alpha, Beta)

Returns the inverse of the gamma cumulative distribution. The Probability argument passed to the GammaInv function is the probability associated with the gamma cumulative distribution. Use this function to test a variable whose distribution may be skewed.

GammaLog GammaLog(X) Returns the natural logarithm of the gamma function.

HypGeomDist HypGeomDist(X, SampleSize, Successes, PopulationSize)

Returns the value of the statistical hypergeometric distribution. Hypergeometric distribution is the probability of a given number of sample successes, where the sample size, population successes, and population size is known. Use this function for experiments in which each observation is either a success or a failure, and where each subset of a given size is chosen with equal likelihood.

Table A-12. Functions in the Statistical Category

Function Syntax Description

286 Appendix A: Function Quick Reference

Page 315: DA_FunctionReference

NormDist NormDist(X, Mean, StdDev, Cumulative)

Returns the normal distribution for a number, given the mean and standard deviation. Normal distributions have a wide range of applications in statistics. Use the NormDist function to derive many kinds of statistical tests. If you pass TRUE as the value of the Cumulative argument, NormDist returns the cumulative distribution calculation. If you pass FALSE as the value of the Cumulative argument, the function returns the probability mass calculation.

NormInv NormInv(Probability, Mean, StdDev)

Returns the inverse of the normal cumulative distribution, given the mean and standard deviation. The Probability argument passed to the NormInv function is the probability associated with the normal distribution.

NormSDist NormSDist(X) Returns the standard normal cumulative distribution, where the mean is zero and the standard deviation is one.

NormSInv NormSInv(Probability) Returns the inverse of the standard normal cumulative distribution. In a standard normal cumulative distribution the mean is zero and the standard deviation is one. The Probability argument passed to the NormSInv function is the probability associated with the standard normal cumulative distribution.

Percentile Percentile(List, Percentile [, Context])

Calculates the value that falls at a given percentile in a group of numbers. Optionally, you can use the Context argument to limit the values you want to pass to the function to calculate the percentile.

Skew Skew(List [, Context]) Returns the statistical skewness of a distribution. Skewness is the degree of asymmetry of a distribution around its mean. A distribution is symmetric if it looks the same to the left and right of the center point. Positive skewness means the distribution has an asymmetric tail towards more positive values. Negative skewness means the distribution has an asymmetric tail towards more negative values.

Standardize Standardize(X, Mean, StdDev) Returns the normalized value for a distribution, given the mean and standard deviation.

Table A-12. Functions in the Statistical Category

Function Syntax Description

Statistical Functions 287

Page 316: DA_FunctionReference

Steyx Steyx(ListY, ListX [, Context, Context])

Returns the statistical standard error of linear regression between two lists of values (ListY and ListX). The standard error is a measure of the amount of error in the prediction of a Y value for an X value. Use metric or numeric attribute names as values of the ListY and ListX arguments. Use the Context argument to narrow the scope of specific metric or attribute value. The first Context argument corresponds to the ListY argument and the second Context argument corresponds to the ListX argument.

TDist TDist(X, DegreesOfFreedom [, Tails])

Returns the probability for the Student t-distribution. Use the t-distribution in the hypothesis testing of small sets of sample data. The numeric value (X) that you pass to the function is a calculated value of t for which the probability is to be computed.

TInv TInv(Probability, DegreesOfFreedom [, Tails])

Returns the t-value of the Student's t-distribution, given the probability and the degrees of freedom. The TInv function is the statistical inverse of the TDist function.

Weibull Weibull(X, Alpha, Beta, Cumulative)

Returns the statistical Weibull distribution. Use this function to perform reliability analysis. The value of the Cumulative argument determines the form of the function. If you pass TRUE as the value of the Cumulative argument, Data Analyzer calculates the Weibull cumulative distribution. If you pass FALSE, Data Analyzer calculates the Weibull probability density.

Table A-12. Functions in the Statistical Category

Function Syntax Description

288 Appendix A: Function Quick Reference

Page 317: DA_FunctionReference

String Functions

Table A-13 lists the functions in the String category:

Table A-13. Functions in the String Category

Function Syntax Description

Clean Clean(String) Cleans a string of control characters. Removes all nonprintable characters from a string. Use this function to remove control characters from a string. These control characters are characters that may not print with your operating system.

Concat Concat(String1, String2) Concatenates two strings. If one of the strings is NULL, the Concat function ignores it and returns the other string. If both strings are NULL, the Concat function returns NULL.

EqualsIgnoreCase EqualsIgnoreCase(String1, String2)

Compares two strings and returns TRUE if the strings are identical or FALSE if the strings are not identical. The function ignores the case of the letters in the two strings. Use this function to compare two attributes in a report. You can also compare an attribute with a given string value.

Find Find(String, Find [, FromEnd])

Finds a text string (Find argument) within another text string (String argument), and returns the number of the starting position of the Find argument text within the String argument text. By default, Data Analyzer searches the string from beginning to end. You can have the Find string search from the end of the string to the beginning by passing TRUE to the FromEnd argument. If the Find argument is not found within the String argument text, Data Analyzer returns NULL.

Len Len(String) Returns the number of characters in a text string.

Lower Lower(String) Converts uppercase string characters to lowercase.

NumberString NumberString(X) Converts a number into a string. Use this function to pass values to other functions that take string arguments.

Replace Replace(String, Start, Count, Replace)

Replaces a character string, or a part of a character string, with a new character string that you specify. You can specify where to start the replacement and the number of characters to replace. Use the Replace function when you want to replace any text that occurs in a specific location in a character string.

String Functions 289

Page 318: DA_FunctionReference

Rept Rept(String, RepeatCount) Repeats text a given number of times. Use the Rept function for formatting purposes. For example, you can display an attribute value multiple times within a single cell in the report.

Substitute Substitute(String, Find, Replace [, Instance])

Replaces a string of text with a new string of text that you specify. You can specify where to start the replacement and the number of characters to replace. Use the Substitute function when you want to replace specific text in a text string.

Substring Substring(String, Start [, Count])

Returns a portion of a string. The Substring function counts all characters, including blanks, starting at the beginning of the string.

Trim Trim(String) Removes blanks from the end of a string.

Upper Upper(String) Converts lowercase string characters to uppercase.

Within Within(Compare1, CompareList)

Compares a given value to all values in a list and returns TRUE if the given value is the same as the value in the list. The function returns FALSE if the given value is different than the value in the list. The Compare1 argument is the given value, which can be a metric or attribute. The CompareList argument is a comma-separated list of values. Use this function to compare metric or attribute values to a list of dates, strings, or numbers. The list of dates, strings, or numbers must be enclosed within quotation marks.

Table A-13. Functions in the String Category

Function Syntax Description

290 Appendix A: Function Quick Reference

Page 319: DA_FunctionReference

Trigonometric Functions

Table A-14 lists the functions in the Trigonometric category:

Table A-14. Functions in the Trigonometric Category

Function Syntax Description

ArcCos ArcCos(NumericValue) Returns the arc cosine of a numeric value. The arc cosine is the trigonometric inverse of a cosine. The arc cosine is the angle whose cosine is the passed numeric value. As the argument for the ArcCos function, you must pass a value that is between -1 and 1.

ArcCosh ArcCosh(NumericValue) Returns the inverse hyperbolic cosine of a numeric value. The inverse hyperbolic cosine is the trigonometric inverse of a hyperbolic cosine. As the argument for the ArcCosh function, you must pass a real number that is greater than or equal to 1.

ArcCot ArcCot(NumericValue) Returns the arc cotangent of a numeric value. The arc cotangent is the trigonometric inverse of a cotangent. The arc cotangent is the angle whose cotangent is the passed numeric value.

ArcCoth ArcCoth(NumericValue) Returns the inverse hyperbolic cotangent of a numeric value. The inverse hyperbolic cotangent is the trigonometric inverse of a hyperbolic cotangent. As the argument for the ArcCoth function, you must pass a value that is outside the range of -1 and 1.

ArcCsc ArcCsc(NumericValue) Returns the arc cosecant of a numeric value. The arc cosecant is the trigonometric inverse of a cosecant. The arc cosecant is the angle whose cosecant is the passed numeric value. As the argument for the ArcCsc function, you must pass a value that is outside the range of -1 and 1.

ArcCsch ArcCsch(NumericValue) Returns the inverse hyperbolic cosecant of a numeric value. The inverse hyperbolic cosecant is the trigonometric inverse of a hyperbolic cosecant.

ArcSec ArcSec(NumericValue) Returns the arc secant of a numeric value. The arc secant is the trigonometric inverse of a secant. The arc secant is the angle whose secant is the passed numeric value.

ArcSech ArcSech(NumericValue) Returns the inverse hyperbolic secant of a numeric value. The inverse hyperbolic secant is the trigonometric inverse of a hyperbolic secant. As the argument for the ArcSec function, you must pass a value that is outside the range of -1 and 1.

ArcSin ArcSin(NumericValue) Returns the arc sine of a numeric value. The arc sine is the trigonometric inverse of a sine. The arc sine is the angle whose sine is the passed numeric value. As the argument for the ArcSin function, you must pass a value that is between -1 and 1.

Trigonometric Functions 291

Page 320: DA_FunctionReference

ArcSinh ArcSinh(NumericValue) Returns the inverse hyperbolic sine of a numeric value. The inverse hyperbolic sine is the trigonometric inverse of a hyperbolic sine.

ArcTan ArcTan(NumericValue) Returns the arc tangent of a numeric value. The arc tangent is the trigonometric inverse of a tangent. The arc tangent is the angle whose tangent is the passed numeric value.

ArcTanh ArcTanh(NumericValue) Returns the inverse hyperbolic tangent of a numeric value. The inverse hyperbolic tangent is the trigonometric inverse of a hyperbolic tangent. As the argument for the ArcTanh function, you must pass a number that is between -1 and 1.

Cos Cos(Angle) Returns the cosine of a numeric value.

Cosh Cosh(Angle) Returns the hyperbolic cosine of a numeric value.

Cot Cot(Angle) Returns the cotangent of a numeric value.

Coth Coth(Angle) Returns the hyperbolic cotangent of a numeric value.

Csc Csc(Angle) Returns the cosecant of a numeric value.

Csch Csch(Angle) Returns the hyperbolic cosecant of a numeric value.

Sec Sec(Angle) Returns the secant of a numeric value.

Sech Sech(Angle) Returns the hyperbolic secant of a numeric value.

Sin Sin(Angle) Returns the sine of a numeric value.

Sinh Sinh(Angle) Returns the hyperbolic sine of a numeric value.

Tan Tan(Angle) Returns the tangent of a given angle.

Tanh Tanh(Angle) Returns the hyperbolic tangent of a numeric value.

Table A-14. Functions in the Trigonometric Category

Function Syntax Description

292 Appendix A: Function Quick Reference

Page 321: DA_FunctionReference

Unary Functions

Table A-15 lists the functions in the Unary category:

Table A-15. Functions in the Unary Category

Function Syntax Description

Abs Abs(NumericValue) Returns the absolute value of a number. Use this function with a numeric metric, numeric attribute, or a calculated numeric value.

Exp Exp(NumericValue) Returns E raised to the specified power (exponent), where E=2.71828183. For example, EXP(2) returns 7.38905609893065. Most often, you use this function to analyze scientific and technical data, rather than business data. Exp is the opposite of the Log function, which returns the natural logarithm of a numeric value. Use the Exp function with a numeric metric, numeric attribute, or a calculated numeric value.

Negate Negate(NumericValue) Adds the minus sign to a positive number or removes the minus sign from a negative number. Use the Negate function with a numeric metric, numeric attribute, or a calculated numeric value. You can also use this function within other functions, where you need to change the sign of a numeric value.

Plus Plus(NumericValue) Removes the plus sign from a given numeric value. If the given value does not have a plus sign, the function returns the same value. Use this function with a numeric metric, numeric attribute, or a calculated numeric value.

Sign Sign(NumericValue) Returns whether a numeric value is positive, negative, or 0. Use this function with a numeric metric, numeric attribute, or a calculated numeric value.

Unary Functions 293

Page 322: DA_FunctionReference

294 Appendix A: Function Quick Reference

Page 323: DA_FunctionReference

I n d e x

AABS function

description 35AccrInt function

description 36AccrIntM function

description 38ADD function

description 39AddToDate function

description 40AmorDegrC function

description 41AmorLinC function

description 43And function

description 45ArcCos function

description 46, 47ArcCot function

description 48ArcCoth function

description 49ArcCsc function

description 50ArcCsch function

description 51

ArcSec functiondescription 52

ArcSech functiondescription 53

ArcSin functiondescription 54

ArcSinh functiondescription 55

ArcTan functiondescription 56

ArcTanh functiondescription 57

arithmetic operatorsdescription 15using strings in expressions 15

AveDev functiondescription 58

Avg functiondescription 59

BBinomDist function

description 60BinomInv function

description 61

295

Page 324: DA_FunctionReference

Ccalculated metrics

using functions 4calculations

precision 7Ceiling function

description 62ChiDist function

description 64ChiInv function

description 65ChiTest function

description 66Clean function

description 68comparison operators

description 15using strings in expressions 15

Concat functiondescription 69

Confidence functiondescription 70

constantsE 13expressions 13FALSE 13PI 13TRUE 13

Context argumentattributes 24equal to operator 24functions of Running category 29keywords 26null values 11separators 24syntax 24using 22variables 27

Correl functiondescription 71

Cos functiondescription 73

Cosh functiondescription 74

Cot functiondescription 75

Coth functiondescription 76

CountAll functiondescription 77

CountUnique functiondescription 78

CoupDayBS functiondescription 79

CoupDayS functiondescription 80

CoupDaySNC functiondescription 81

CoupNCD functiondescription 82

CoupNum functiondescription 83

CoupPCD functiondescription 84

Covar functiondescription 85

Csc functiondescription 87

Csch functiondescription 88

CumIPmt functiondescription 89

CumPrinc functiondescription 91

currency decimals argumentsusing 7

custom aggregatesusing functions 4using variables in expressions 27

custom attributesusing functions 5

custom metricsusing functions 3

Ddate format strings

format letters 18using in expressions 17using in functions 18

Date functiondescription 95

datesusing in expressions 17

DateString functiondescription 96

DateValue functiondescription 97

Day Count Basis argumentusing 32

296 Index

Page 325: DA_FunctionReference

Day functiondescription 99

DB functiondescription 93

DDB functiondescription 94

DevSq functiondescription 100

DfToRate functiondescription 101

Disc functiondescription 102

Divide functiondescription 103

EE constant

defined 13Effect function

description 104ElapsedDays function

description 105ElapsedHours function

description 107ElapsedYears function

description 108EndOfMonth function

description 109Equals function

description 110EqualsIgnoreCase function

description 111Exp function

description 112ExponDist function

description 113expression syntax

constants 13date format strings 17dates 17functions 12general rules 10null values 10operators 14supported units of measure 34

FFactorial function

description 117FALSE constant

defined 13FDist function

description 114Find function

description 118FInv function

description 115Fisher function

description 119FisherInv function

description 120Floor function

description 121Forecast function

description 123functions

currency decimals 7in calculated metrics 4in custom aggregates 4in custom attributes 5in custom metrics 3null handling 11supported units of measure 34syntax 12using date format strings 18

FV functiondescription 116

GGammaDist function

description 125GammaInv function

description 126GammaLog function

description 127GeoMean function

description 128GreaterThan function

description 129GreaterThanEquals function

description 130

Index 297

Page 326: DA_FunctionReference

HHarMean function

description 131Hour function

description 132HypGeomDist function

description 133

IIf function

description 135IfNull function

description 136IntDivide function

description 137IntRate function

description 138IRR function

description 134

KKurt function

description 139

Llayout context

using 23layout keywords

using in expressions 26Len function

description 140LessThan function

description 141LessThanEquals function

description 142Log function

description 143Log10 function

description 144Log2 function

description 145logical operators

description 16Lower function

description 146

MMax function

description 147Max2 function

description 148Median function

description 149Min function

description 150Min2 function

description 151Minute function

description 152Mod function

description 153Mode function

description 154Month function

description 155MovingAvg function

description 156MovingSum function

description 158Multiply function

description 160

NNegate function

description 164Next function

description 165NextDate function

description 166Nominal function

description 167NormDist function

description 168NormInv function

description 169NormSDist function

description 170NormSInv function

description 171Not function

description 172NotEquals function

description 173

298 Index

Page 327: DA_FunctionReference

Now functiondescription 174

NPer functiondescription 163

NPV functiondescription 161

null valuesContext argument 11expressions 10

NumberString functiondescription 175

Ooperators

arithmetic 15comparison operators 15expression syntax 14logical operators 16using strings in arithmetic 15using strings in comparison 15

Or functiondescription 176

PPearson function

description 178PercentContribution function

description 180Percentile function

description 181PeriodsPerYear function

description 183PI constant

defined 13Plus function

description 184Pmt function

description 185Power function

description 186precision

calculations 7Previous function

description 187Price function

description 188PriceDisc function

description 190

PriceMat functiondescription 191

Product functiondescription 193

PV functiondescription 177

RRate function

description 194RateToDf function

description 195Received function

description 196Replace function

description 197Rept function

description 198Round function

description 199RoundDown function

description 200RoundUp function

description 201running category functions

using Context argument 29RunningAvg function

description 202RunningSum function

description 203

SSec function

description 206Sech function

description 207Second function

description 208Sign function

description 209Sin function

description 210Sinh function

description 211Skew function

description 212SLn function

description 204

Index 299

Page 328: DA_FunctionReference

Slope functiondescription 213

Sqrt functiondescription 215

Square functiondescription 216

Standardize functiondescription 217

Stdev functiondescription 218

StdevP functiondescription 219

Steyx functiondescription 220

Substitute functiondescription 222

Substring functiondescription 223

Subtract functiondescription 224

Sum functiondescription 225

SYD functiondescription 205

syntaxexpressions 10

TTan function

description 233Tanh function

description 234TBillEq function

description 226TBillPrice function

description 227TBillYield function

description 228TDist function

description 229time attributes

using in Context argument 25Time function

description 235TInv function

description 230Today function

description 236

Trim functiondescription 238

TriMean functiondescription 237

TRUE constantdefined 13

Trunc functiondescription 239

TTest functiondescription 231

UUnits function

description 240units of measure

supported in expressions 34Upper function

description 241

Vvalue context

using 23value keywords

using in expressions 26Var function

description 245, 246VDB function

description 242, 244

WWeekday function

description 248WeekNum function

description 247Weibull function

description 249Within function

description 250

XXIRR function

description 252XNPV function

description 254

300 Index

Page 329: DA_FunctionReference

YYear function

description 256Yield function

description 257, 259YieldMat function

description 260

ZZTest function

description 261

Index 301

Page 330: DA_FunctionReference

302 Index


Recommended