Manual Informatica Powercenter
Manual Informatica Powercenter
Function Reference
Informatica PowerCenter®
(Version 8.1.1)
PowerCenter Data Analyzer Calculation and Function Reference
Version 8.1.1
September 2006
Copyright © 2001-2006 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, PowerCenter, PowerCenterRT, PowerCenter Connect, PowerCenter Data Analyzer, PowerMart, Superglue, Metadata Manager, Informatica Data
Quality and Informatica Data Explorer are trademarks or registered trademarks of Informatica Corporation in the United States and in jurisdictions throughout
the world. 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 © GoAmerica Communications 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-2006 The
Apache Software Foundation. All rights reserved.
This product includes software developed by the Indiana University Extreme! Lab. For further information please visit http://www.extreme.indiana.edu/.
Copyright © 2002 The Trustees of Indiana University. All rights reserved.
The Qexo software (with related files and documentation) included with this Informatica software are copyright (C) 1996-2006 Per Bothner. Permission is
hereby granted, free of charge, to any person obtaining a copy of the Qexo software and associated documentation files (the "Qexo Software"), to deal in the
Qexo Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Qexo Software, and to permit persons to whom the Qexo Software is furnished to do so.
The Kawa software included with this Informatica software are copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories and Bellcore. Permission to use,
copy, modify, and distribute this Kawa software and its documentation for any purpose and without fee is hereby granted.
The iText Library included with this Informatica software are copyright (C) 1999-2006 by Bruno Lowagie and Paulo Soares. All Rights Reserved. Your right to
use such materials is set forth in the GNU Library General Public License or the Mozilla Public License which may be found, along with the source code, at
http://www.lowagie.com/. The iText Library 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.
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.
Table of Contents
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvi
Other Informatica Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Visiting Informatica Customer Portal . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Visiting the Informatica Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Visiting the Informatica Developer Network . . . . . . . . . . . . . . . . . . . . xvii
Visiting the Informatica Knowledge Base . . . . . . . . . . . . . . . . . . . . . . xvii
Obtaining Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
iii
Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Date Format Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 4: Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Function 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
iv Table of Contents
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
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
Table of Contents v
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
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
vi Table of Contents
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
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
Table of Contents ix
Conversion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Date & Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Fetch Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Financial Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Rounding Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Running Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Statistical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Unary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
x Table of Contents
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. Custom Attribute Page in Advanced Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
List of Figures xi
xii List of Figures
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 . . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 262
Table A-2. Functions in the Boolean Category . . . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 267
Table A-3. Functions in the Comparative Category . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 268
Table A-4. Functions in the Conditional Category . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 269
Table A-5. Function in the Conversion Category . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 270
Table A-6. Functions in the Date & Time Category . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 271
Table A-7. Functions in the Fetch Category . . . . . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 273
Table A-8. Functions in the Financial Category . . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 274
Table A-9. Functions in the Mathematical Category . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 280
Table A-10. Functions in the Rounding Category . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 281
Table A-11. Functions in the Running Category . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 282
Table A-12. Functions in the Statistical Category . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 283
Table A-13. Functions in the String Category . . . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 287
Table A-14. Functions in the Trigonometric Category . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 289
Table A-15. Functions in the Unary Category . . . . . . . . . . . .. . .. . . .. . . .. . .. . . .. . .. . 291
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
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 Conventions
This guide uses the following formatting conventions:
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.
Warning: The following paragraph notes situations where you can overwrite
or corrupt data, unless you follow the specified procedure.
bold monospaced text This is an operating system command you enter from a prompt to
run a task.
xvi Preface
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
Preface xvii
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
xviii Preface
Chapter 1
1
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})
For more information about custom metrics, see “Adding Calculations to a Report” in the
Data Analyzer User Guide.
Types of Calculations 3
Custom Aggregate Calculations
You 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.
For more information about calculated metrics, see “Working with Calculated Metrics” in the
Data Analyzer Schema Designer Guide.
Types of Calculations 5
Figure 1-4 shows the advanced mode of the Custom Attribute page in the Schema Directory
where you can enter the custom attribute expression:
For more information about custom attributes in a report, see “Adding Custom Attributes to
a Report” in the Data Analyzer User Guide. For more information about custom attributes in
the Schema Directory, see “Working with Custom Attributes” in the Data Analyzer Schema
Designer Guide.
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 Decimals
Certain 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.
Expression Syntax
9
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.
When a metric or attribute name occurs more than once in the {Sales|Sales}
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.
Use parentheses to define the order of execution. Data Analyzer To find the sum, then the product:
evaluates the innermost set of parentheses before proceeding to (6*(4+8))
the next.
When you pass an optional argument to a function, you must also For the AmorDegrC function, if you pass the
pass any other optional arguments that occur ahead of it in the CurrencyDecimals argument, you must also pass
function syntax. 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))
Nulls
NULL 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}
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.
Overview 11
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.
♦ 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 convert 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)
Constants 13
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:
Operator Meaning
() Parentheses
^ Power
+, - Addition, subtraction
<, <=, >, >= Less than, less than or equal to, greater than, greater than or equal to
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:
8+5-2*8 -3
8 + (5 - 2) * 8 32
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.
Comparison Operators
Use 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:
Operator Meaning
= Equal to
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.
Operators 15
If you compare a value to a null value, the result is NULL.
For information about comparing dates, see “Dates” on page 17.
Logical Operators
Use 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:
Equivalent
Operator Meaning
SQL Operator
& 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.
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
♦ 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.
Calendar
Data 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.
Dates 17
Using Date Format Strings in Functions
You 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")
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.
Dates 19
20 Chapter 2: Expression Syntax
Chapter 3
21
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.
Layout Context
Use 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 called 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.
When you use a layout context in a custom attribute expression, the custom attribute is called
a layout-dependent custom attribute. When you use layout-dependent custom attributes in a
report, the following restrictions apply:
♦ The report cannot use cross tabular or sectional report tables.
♦ The report cannot use time settings.
For more information about layout-dependent custom attributes, see “Adding Custom
Attributes to a Report” in the Data Analyzer User Guide.
Value Context
Use 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 Contexts 23
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
The above expression calculates the total of all Sales values where the State attribute value is
either CA or AZ.
Separators
Use 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'")
Attributes
Use 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
calendar attributes, see “Working with Time Dimensions” in the Data Analyzer Schema
Designer Guide.
Time Attribute
Meaning Example
Name
HOUR_NUM Refers to the hour number in To calculate the total sales made between 10:00 and 11:00
day. am, use the following expression:
Sum({Sales}, "{@HOUR_NUM}=10")
YEAR_DAY_NUM Refers to the day number in To calculate the total sales made on the first day of the year,
year. use the following expression:
Sum({Sales}, "{@YEAR_DAY_NUM}=1")
YEAR_WEEK_NUM Refers to the week number To calculate the total sales made in the fourth week of the
in year. year, use the following expression:
Sum({Sales}, "{@YEAR_WEEK_NUM}=4")
YEAR_MONTH_NUM Refers to the month number To calculate the total sales made in the month of June, use
in year. the following expression:
Sum({Sales}, "{@YEAR_MONTH_NUM}=6")
QUARTER_NUM Refers to the quarter To calculate the average sales made in the first quarter, use
number. 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")
Time Attribute
Meaning Example
Name
DATE_TIME Refers to the date and time To calculate the total sales made on February 14, 2004 at
values. In the expression, 11:00 am, use the following expression:
the value of the DATE_TIME Sum({Sales}, "{@DATE_TIME}=2004-02-14
time attribute must be in the 11:00:00")
following format:
yyyy-MM-dd HH:mm:ss
Note: The above is the ISO
date format.
DATE_NO_TIME Refers to the date value. In To calculate the total sales made on February 14, 2004, use
the expression, the value of the following expression:
the DATE_NO_TIME time Sum({Sales}, "{@DATE_TIME}=2004-02-14")
attribute must be in the
following format:
yyyy-MM-dd
Note: The above is the ISO
date format.
Keywords
Use 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.
Type of
Keyword Meaning Example
Keyword
COLUMN Layout Refers to all the column To calculate the sum for the Sales column in a simple report
attributes. table, use the following expression:
Sum({Sales}, "@COLUMN")
ROW Layout Refers to all the row You have a report that displays as a cross tabular report
attributes. Use ROW in table. The report displays the Sales for each product
reports with cross tabular category for each state. Category is the column attribute and
report tables. State is the row attribute. To calculate the sum for the Sales
values for each row, use the following expression:
Sum({Sales}, "@ROW")
Type of
Keyword Meaning Example
Keyword
SECTION Layout Refers to all the section You have a report that displays as a sectional report table.
attributes. Use SECTION The report displays the Sales for each product category by
in reports with sectional region. Region is the section attribute and Category is the
report tables. 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 You have a report that displays the sales for each state and
current position in the each category. State and Category are row attributes. To
processing of the calculate what percent of sales for each row contributed to
function. You cannot use the total sales for that state, use the following expression:
THIS in a custom {Sales}/Sum({Sales},
aggregate expression. "{State}=THIS")*100
CURRENT Value Refers to the current To calculate the total sales made in the current quarter, use
calendar. Use this the following expression:
keyword in reports with Sum({Sales}, "{@QUARTER_NUM}=CURRENT")
time settings. You cannot
use CURRENT in a
report with time settings
that displays Hour by
Hour granularity.
NULL Value Checks whether a value You have a report that displays sales made in the current
is NULL. 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")
Note: The set of values must include values that display continuously in the report table.
$AGGREGATE_BY$ Variable
When 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.
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 variables in custom aggregates, see “Adding Calculations to
a Report” in the Data Analyzer User Guide.
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
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.
32 Chapter 4: Functions
Table 4-1 lists the values you can use for 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 the 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 the 1st of the next month.
Note: Values of the DayCountBasis argument are not case sensitive and must be enclosed
within quotation marks.
Function Categories 33
Supported Units of Measure
The 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:
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
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 millionth, thousandth, hundredth, eighth, quarter, half, tenth, one, pair, two, three, five, half dozen,
measures 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
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
Note: Unit names are not case sensitive and must be enclosed within quotation marks.
34 Chapter 4: Functions
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.
Syntax
Abs(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Abs 35
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.
Syntax
AccrInt(IssueDate, FirstInterestDate, SettlementDate, Rate [, ParValue,
Frequency, DayCountBasis, CurrencyDecimals])
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.
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.
Return Value
Numeric
Examples
The following expression returns 25.42 as the accrued interest for a government savings bond:
AccrInt(Date(2000,3,31), Date(2000,9,30), Date(2000,6,1), 0.15, 1000,
"semiannual", "30E+/360")
36 Chapter 4: Functions
Notes
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.
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
AccrInt 37
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.
Syntax
AccrIntM(IssueDate, SettlementDate, Rate [, ParValue, DayCountBasis,
CurrencyDecimals])
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.
Return Value
Numeric
Examples
The 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)
Notes
To 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.
38 Chapter 4: Functions
ADD
Returns the sum of two numeric values.
This function belongs to the Mathematical category.
Syntax
Add(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Add 39
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.
Syntax
AddToDate(Date, Years, Months, Days)
Date Date Required. Date value you want to pass to the function.
Return Value
Date
Examples
To 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
Notes
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.
40 Chapter 4: Functions
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.
Syntax
AmorDegrC(Cost, PurchaseDate, FirstPeriodDate, Salvage, Period, Rate [,
DayCountBasis, CurrencyDecimals])
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.
Return Value
Numeric
Examples
Your 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 41
AmorDegrC(5000, Date(2003, 9, 10), Date(2003, 12, 31), 500, 2, 0.15)
Notes
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.
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
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.
Syntax
AmorLinC(Cost, PurchaseDate, FirstPeriodDate, Salvage, Period, Rate [,
DayCountBasis, CurrencyDecimals])
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.
Return Value
Numeric
Examples
You 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)
AmorLinC 43
Notes
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.
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
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.
Syntax
And(BooleanValue1, BooleanValue2)
BooleanValue1 Boolean Required. Boolean condition you want to pass to the function.
BooleanValue2 Boolean Required. Boolean condition you want to pass to the function.
Return Value
Boolean
Examples
The following expression returns TRUE:
And(TRUE, TRUE)
And 45
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.
Syntax
ArcCos(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. 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.
Examples
The following expression returns the value 120 (degrees):
ArcCos(-0.5)*180/PI
46 Chapter 4: Functions
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.
Syntax
ArcCosh(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians
by 180/PI or use the Units function.
Examples
The following expression returns the value 0:
ArcCosh(1)
ArcCosh 47
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.
Syntax
ArcCot(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. 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.
Examples
The following expression return the value 0.46 (radians):
ArcCot(2)
48 Chapter 4: Functions
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.
Syntax
ArcCoth(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians
by 180/PI or use the Units function.
Examples
The following expression returns the value 0.20:
ArcCoth(5)
ArcCoth 49
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.
Syntax
ArcCsc(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. 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.
Examples
The following expression returns the value 1.57 (radians):
ArcCsc(1)
50 Chapter 4: Functions
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.
Syntax
ArcCsch(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians
by 180/PI or use the Units function.
Examples
The following expression returns the value 0.10:
ArcCsch(10)
ArcCsch 51
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.
Syntax
ArcSec(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. 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.
Examples
The following expression returns the value 1.47 (radians):
ArcSec(10)
52 Chapter 4: Functions
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.
Syntax
ArcSech(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians
by 180/PI or use the Units function.
Examples
The following expression returns the value 0.5:
ArcSech(1.32)
ArcSech 53
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.
Syntax
ArcSin(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. 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.
Examples
The following expression returns the value 0.85 (radians):
ArcSin(0.75)
54 Chapter 4: Functions
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.
Syntax
ArcSinh(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians
by 180/PI or use the Units function.
Examples
The following expression returns the value -1.19:
ArcSinh(-1.5)
ArcSinh 55
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.
Syntax
ArcTan(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. 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.
Examples
The following expression returns the value 1.11 (radians):
ArcTan(2)
56 Chapter 4: Functions
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.
Syntax
ArcTanh(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. An angle, expressed in radians. To convert radians to degrees, multiply the radians
by 180/PI or use the Units function.
Examples
The following expression returns the value 0.42:
ArcTanh(0.4)
ArcTanh 57
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.
Syntax
AveDev(List [, Context])
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.
Return Value
Numeric
Examples
The 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
58 Chapter 4: Functions
AVG
Returns the average of all values in a list.
This function belongs to the Aggregate category.
Syntax
Avg(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 4.16 as the average profit of all products:
Avg({Profit})
Profit
------
5.99
2.59
3.89
Avg 59
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.
Syntax
BinomDist(X, Trials, ProbabilityOfSuccess, Cumulative)
X Numeric Required. Number for which you want to perform the calculation. Must
be between 0 and Trials, 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.
Return Value
Numeric
Examples
A 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)
60 Chapter 4: Functions
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.
Syntax
BinomInv(Probability, Trials, ProbabilityOfSuccess)
Probability Numeric Required. Probability associated with the distribution. Must be between
0 and 1, inclusive.
Return Value
Numeric
Examples
In 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)
BinomInv 61
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.
Syntax
Ceiling(NumericValue [, Significance])
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.
Return Value
Numeric
Examples
The 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
Notes
If 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.
62 Chapter 4: Functions
To generate the same result as the Excel Ceiling(value, significance) function, use the
following expression:
RoundUp(value/significance) * significance
Ceiling 63
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.
Syntax
ChiDist(X, DegreesOfFreedom)
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.
Return Value
Numeric
Examples
In 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)
64 Chapter 4: Functions
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.
Syntax
ChiInv(Probability, DegreesOfFreedom)
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.
Return Value
Numeric
Examples
The following expression returns 2.5 as the value of a chi-squared test:
ChiInv(0.96, 8)
ChiInv 65
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.
Syntax
ChiTest(ListObserved, ListExpected [, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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
30-39 7 7
66 Chapter 4: Functions
30-39 4.3 5
30-39 2 4
Notes
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.
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
ChiTest 67
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.
Syntax
Clean(String)
String String Required. String value you want to pass to the function.
Return Value
String
68 Chapter 4: Functions
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.
Syntax
Concat(String1, String2)
String1 String Required. String value you want to pass to the function.
String2 String Required. String value you want to pass to the function.
Return Value
String
Examples
The 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
Notes
The 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})
Concat 69
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.
Syntax
Confidence(Alpha, StdDev, Size)
Size Numeric Required. Number of elements for which you want to perform the
calculation. Must be greater than or equal to 0.
Return Value
Numeric
Examples
In 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.
70 Chapter 4: Functions
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.
Syntax
Correl(List1, List2 [, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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
Drinks 2000 750
Correl 71
Food 28195 16974
Notes
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.
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
COS
Returns the cosine of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Cos(Angle)
Return Value
Numeric. The value is in the range -1 to +1.
Examples
The 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
Cos 73
COSH
Returns the hyperbolic cosine of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Cosh(Angle)
Return Value
Numeric
Examples
The 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
74 Chapter 4: Functions
COT
Returns the cotangent of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Cot(Angle)
Return Value
Numeric
Examples
The 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
Cot 75
COTH
Returns the hyperbolic cotangent of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Coth(Angle)
Return Value
Numeric
Examples
The following expression returns the value 2.16:
Coth(0.5)
76 Chapter 4: Functions
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.
Syntax
CountAll(List [, Context])
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.
Return Value
Numeric
Examples
The 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
CountAll 77
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.
Syntax
CountUnique(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 3 as the number of unique values in the Region attribute:
CountUnique({Region})
Region
--------
Northern
Eastern
Northern
Western
78 Chapter 4: Functions
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.
Syntax
CoupDayBS(SettlementDate, MaturityDate [, Frequency, DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
CoupDayBS 79
COUPDAYS
Returns the total number of coupon days in the coupon period that contains the settlement
date.
This function belongs to the Financial category.
Syntax
CoupDayS(SettlementDate, MaturityDate [, Frequency, DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
80 Chapter 4: Functions
COUPDAYSNC
Returns the total number of coupon days from the settlement date to the next coupon date.
This function belongs to the Financial category.
Syntax
CoupDaySNC(SettlementDate, MaturityDate [, Frequency, DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
CoupDaySNC 81
COUPNCD
Returns the next coupon date after the settlement date of a security.
This function belongs to the Financial category.
Syntax
CoupNCD(SettlementDate, MaturityDate [, Frequency, DayCountBasis])
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.
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.
Return Value
Date
Examples
The 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")
Notes
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.
82 Chapter 4: Functions
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.
Syntax
CoupNum(SettlementDate, MaturityDate [, Frequency, DayCountBasis])
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.
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.
Return Value
Date
Examples
The 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")
Notes
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.
CoupNum 83
COUPPCD
Returns the previous coupon date before the settlement date of a security.
This function belongs to the Financial category.
Syntax
CoupPCD(SettlementDate, MaturityDate [, Frequency, DayCountBasis])
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.
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.
Return Value
Date
Examples
The 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")
Notes
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.
84 Chapter 4: Functions
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.
Syntax
Covar(List1, List2 [, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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'")
Covar 85
Perishables 750 150
Notes
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.
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
CSC
Returns the cosecant of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Csc(Angle)
Return Value
Numeric
Examples
The following expression returns the value 1.67:
Csc(2.5)
Csc 87
CSCH
Returns the hyperbolic cosecant of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Csch(Angle)
Return Value
Numeric
Examples
The following expression returns the value 0.05:
Csch(3.66)
88 Chapter 4: Functions
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.
Syntax
CumIPmt(Rate, NumberPeriods, PresentValue, StartPeriod, EndPeriod,
PaymentAtBeginning [, CurrencyDecimals])
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. 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.
Return Value
Numeric
Examples
The 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)
CumIPmt 89
Notes
To 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
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.
Syntax
CumPrinc(Rate, NumberPeriods, PresentValue, StartPeriod, EndPeriod,
PaymentAtBeginning [, CurrencyDecimals])
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. 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.
Return Value
Numeric
Examples
The 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)
CumPrinc 91
Notes
To 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
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.
Syntax
DB(Cost, Salvage, Life, Period [, FirstYearMonths, CurrencyDecimals])
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.
Return Value
Numeric
Examples
An 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)
Notes
If 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.
DB 93
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.
Syntax
DDB(Cost, Salvage, Life [, Period, RateFactor, CurrencyDecimals])
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.
Return Value
Numeric
Examples
The 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)
Notes
If the Life argument is expressed in months, the Period argument must also be expressed in
months.
94 Chapter 4: Functions
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.
Syntax
Date(Year, Month, Day)
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.
Return Value
Date
Examples
The following expression returns the date September 10, 2004:
Date(2004, 9, 10)
Notes
If you pass an invalid value for the Month or Day arguments, the function returns NULL.
Date 95
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.
Syntax
DateString(Date [, DateFormat])
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.
Return Value
String
Examples
The following expression returns the string 5/26/04:
DateString(Date(2004, 5, 26))
Notes
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.
96 Chapter 4: Functions
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.
Syntax
DateValue(DateString [, DateFormat])
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.
Return Value
Date
Examples
The 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")
DateValue 97
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
"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
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.
Syntax
Day(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
All of the following expressions return the number 10:
Day(Date(2004, 9, 10))
Day(DateValue("2004/06/10"))
Day({Day Shipped}), where the value of the Day Shipped attribute is July
10, 2003
Notes
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.
Day 99
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.
Syntax
DevSq(List [, Context])
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.
Return Value
Numeric
Examples
You 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})
Notes
If a value is NULL, the DevSq function ignores that row.
Syntax
DfToRate(DiscountFactor, RateConvention, ElapsedYears)
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.
Return Value
Numeric
Examples
The following expression returns 0.055 as the rate:
DfToRate(0.3, "annual", 5)
DfToRate 101
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.
Syntax
Disc(SettlementDate, MaturityDate, Price, Redemption [, DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The following expression returns 0.24 as the discount rate for a bond:
Disc(DateValue("4/1/2004"), DateValue("6/15/2004"), 95, 100)
Notes
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.
Syntax
Divide(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Divide 103
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.
Syntax
Effect(Rate, NumberPeriods)
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.
Return Value
Numeric
Examples
The 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)
Notes
To calculate the nominal annual interest rate, given the effective annual interest rate and the
number of compounding periods per year, use the Nominal function.
Syntax
ElapsedDays(Date1, Date2 [, DayCountBasis])
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.
Return Value
Numeric
Examples
The 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
Notes
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.
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")
To get the same result as the Microsoft Excel days360(start_date, end_date, true) function,
use the following expression:
ElapsedDays 105
ElapsedDays({start_date}, {end_date}, "30/360")
Syntax
ElapsedHours(Date1, Date2)
Date1 Date Required. Date value you want to pass to the function.
Date2 Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Notes
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.
ElapsedHours 107
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.
Syntax
ElapsedYears(Date1, Date2 [, DayCountBasis])
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.
Return Value
Numeric
Examples
The 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
Notes
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.
Syntax
EndOfMonth(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Date
Examples
The following expression returns the date June 30, 2004:
EndOfMonth(DateValue("2004/06/10"))
Notes
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.
EndOfMonth 109
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.
Syntax
Equals(Compare1, Compare2)
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.
Return Value
Boolean
Examples
You 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
Syntax
EqualsIgnoreCase(String1, String2)
String1 String Required. String value you want to pass to the function.
String2 String Required. String value you want to pass to the function.
Return Value
Boolean
Examples
You 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
EqualsIgnoreCase 111
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.
Syntax
Exp(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Syntax
ExponDist(X, Lambda, Cumulative)
X Numeric Required. Number for which you want to perform the calculation.
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.
Return Value
Numeric
Examples
The 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)
ExponDist 113
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.
Syntax
FDist(X, DegreesOfFreedomNum, DegreesOfFreedomDenom)
X Numeric Required. Number for which you want to perform the calculation.
Must be greater than or equal to 0.
Return Value
Numeric
Examples
You 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)
Syntax
FInv(Probability, DegreesOfFreedomNum, DegreesOfFreedomDenom)
Return Value
Numeric
Examples
You 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)
FInv 115
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.
Syntax
FV(Rate, NumberPeriods, Payment [, PresentValue, PaymentAtBeginning,
CurrencyDecimals])
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.
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.
Return Value
Numeric
Examples
You 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)
Notes
To 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.
Syntax
Factorial(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function. Must be
greater than or equal to 0.
Return Value
Numeric
Examples
The 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
Factorial 117
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.
Syntax
Find(String, Find [, FromEnd])
String String Required. String value you want to pass to the function.
FromEnd Boolean Optional. Starting position of the search. Default is FALSE. Enter TRUE
to start the search from the end of the string.
Return Value
Numeric
Examples
The 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
Notes
You 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
Syntax
Fisher(X)
X Numeric Required. Number for which you want to perform the calculation.
Return Value
Numeric
Examples
The following function returns 0.73 as the Fisher transformation for 0.62:
Fisher(0.62)
Fisher 119
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.
Syntax
FisherInv(X)
X Numeric Required. Number for which you want to perform the calculation.
Return Value
Numeric
Examples
The following function returns 0.62 as the inverse of Fisher transformation:
FisherInv(0.73)
Syntax
Floor(NumericValue [, Significance])
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.
Return Value
Numeric
Examples
The 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
Floor 121
Notes
To generate the same result as the Excel Floor(value, significance) function, use the following
expression:
RoundDown(value/significance) * significance
Syntax
Forecast(X, ListY, ListX [, Context1, Context2])
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.
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.
Return Value
Numeric
Examples
The 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
------------- ---------- ----------
Women 1500 2500
Forecast 123
Women 5000 2250
Men 38088 10502
Women 6200 800
Women 750 150
Women 2000 750
Men 28195 6974
Notes
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.
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
Syntax
GammaDist(X, Alpha, Beta)
X Numeric Required. Number for which you want to perform the calculation. Must
be greater than or equal to 0.
Return Value
Numeric
Examples
You 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)
GammaDist 125
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.
Syntax
GammaInv(Probability, Alpha, Beta)
Probability Numeric Required. Probability associated with the distribution. Must be between
0 and 1, inclusive.
Return Value
Numeric
Examples
You 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)
Syntax
GammaLog(X)
X Numeric Required. Number for which you want to perform the calculation. Must
be greater than or equal to 0.
Return Value
Numeric
Examples
The following expression returns 10.60 as the natural logarithm of the gamma function:
GammaLog(9)
Notes
The 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))
GammaLog 127
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.
Syntax
GeoMean(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Syntax
GreaterThan(Compare1, Compare2)
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.
Return Value
Boolean. 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.
Examples
The 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
GreaterThan 129
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.
Syntax
GreaterThanEquals(Compare1, Compare2)
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.
Return Value
Boolean. 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.
Examples
The 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
Syntax
HarMean(List [, Context])
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.
Return Value
Numeric
Examples
The 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
HarMean 131
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.
Syntax
Hour(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Notes
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.
Syntax
HypGeomDist(X, SampleSize, Successes, PopulationSize)
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.
Return Value
Numeric
Examples
A 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)
HypGeomDist 133
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.
Syntax
IRR(CashFlows [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 0.12 as the internal rate of return of an investment:
IRR({Cash Flows})
Cash Flows
----------
-15000
10000
5000
2000
1000
Notes
The 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.
Syntax
If(If, True, False)
Return Value
Varies
Examples
To 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
Notes
The values of the True and False arguments must be of the same datatype.
If 135
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.
Syntax
IfNull(List, ReturnValue [, OtherValue])
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.
Return Value
Varies
Examples
To 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
Notes
The values of the List, ReturnValue, and OtherValue arguments must be of the same datatype.
Syntax
IntDivide(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
IntDivide 137
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.
Syntax
IntRate(SettlementDate, MaturityDate, Investment, Redemption [,
DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
Syntax
Kurt(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Kurt 139
LEN
Returns the number of characters in a text string.
This function belongs to the String category.
Syntax
Len(String)
String String Required. String value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Syntax
LessThan(Compare1, Compare2)
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.
Return Value
Boolean. 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.
Examples
The 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
LessThan 141
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.
Syntax
LessThanEquals(Compare1, Compare2)
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.
Return Value
Boolean. 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.
Examples
The 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
Syntax
Log(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Log 143
LOG10
Returns the base 10 logarithm of a numeric value.
This function belongs to the Mathematical category.
Syntax
Log10(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Syntax
Log2(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Log2 145
LOWER
Converts uppercase string characters to lowercase.
This function belongs to the String category.
Syntax
Lower(String)
String String Required. String value you want to pass to the function.
Return Value
String
Examples
The 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
Syntax
Max(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 8.99 as maximum cost for products in your inventory:
Max({Cost})
Cost
----
5.96
1.56
8.99
6.56
Max 147
MAX2
Returns the maximum of two numeric values.
This function belongs to the Mathematical category.
Syntax
Max2(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Syntax
Median(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 5.5 as the median weight for all products:
Median({Weight})
Weight
------
10
5.5
3.7
Notes
This 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.
Median 149
MIN
Returns the minimum value of a numeric metric or attribute.
This function belongs to the Aggregate category.
Syntax
Min(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 1.00 as the minimum profit margin among all products:
Min({Profit})
Profit
------
2.50
1.00
7.50
1.01
Syntax
Min2(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Min2 151
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.
Syntax
Minute(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Notes
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.
Syntax
Mod(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
Use 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
Mod 153
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.
Syntax
Mode(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 55000 as the most common salary:
Mode({Salary})
Salary
------
55000
120000
35000
85000
55000
Notes
This function ignores NULLs when performing the calculation. If no value occurs more than
once, PowerAnalyzer returns NULL.
Syntax
Month(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
All of the following examples return the number 9:
Month(Date(2004, 9, 10))
Month(DateValue("15-Sep-2004"))
Notes
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.
Month 155
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.
Syntax
MovingAvg(List, Size [, Context])
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.
Return Value
Numeric List
Examples
If 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
MovingAvg 157
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.
Syntax
MovingSum(List, Size [, Context])
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.
Return Value
Numeric List
Examples
If 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
MovingSum 159
MULTIPLY
Returns the product of one numeric value multiplied by another.
This function belongs to the Mathematical category.
Syntax
Multiply(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Syntax
NPV(CashFlows, Rate [, CurrencyDecimals, Context])
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.
Return Value
Numeric
Examples
The 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
May 6974.26
NPV 161
June 89114.60
July 9174.55
August 6974.26
September 10502.07
October 6974.26
November 13253.74
December 7774.11
Notes
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
Syntax
NPer(Rate, PresentValue, Payment [, FutureValue, PaymentAtBeginning])
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.
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.
Return Value
Numeric
Examples
The 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)
Notes
To 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.
NPer 163
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.
Syntax
Negate(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The following expression returns -10:
Negate(10)
Syntax
Next(Metric)
Metric Varies Required. Metric for which you want to get the value.
Return Value
Varies
Examples
The following expression returns the revenue from the next row:
Next({Revenue})
Revenue Return Value
------- ------------
1500 7125
7125 3500
3500 1090
1090 NULL
Notes
The function returns NULL if the specified value is the last value in the metric.
Next 165
NEXTDATE
Returns the next date in a period or payment schedule.
This function belongs to the Date & Time category.
Syntax
NextDate(Date, Frequency [, NumberPeriods])
Date Date Required. Date value you want to pass to the function.
Return Value
Date
Examples
The 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)
Notes
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.
Syntax
Nominal(Rate, NumberPeriods)
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.
Return Value
Numeric
Examples
The 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)
Notes
To calculate the effective annual interest rate, given the nominal annual interest rate and the
number of compounding periods per year, use the Effect function.
Nominal 167
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.
Syntax
NormDist(X, Mean, StdDev, Cumulative)
X Numeric Required. Number for which you want to perform the calculation.
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.
Return Value
Numeric
Examples
The 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)
Notes
If 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.
Syntax
NormInv(Probability, Mean, StdDev)
StdDev Numeric Required. Standard deviation of a list of numbers. Must be greater than
0.
Return Value
Numeric
Examples
You 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)
NormInv 169
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.
Syntax
NormSDist(X)
X Numeric Required. Number for which you want to perform the calculation.
Return Value
Numeric
Examples
The following expression returns 0.869 as the value of the standard normal cumulative
distribution:
NormSDist(1.12)
Syntax
NormSInv(Probability)
Return Value
Numeric
Examples
The following expression returns 1.121 as the inverse of the standard normal cumulative
distribution:
NormSInv(0.869)
NormSInv 171
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.
Syntax
Not(BooleanValue)
BooleanValue Boolean Required. Boolean condition you want to pass to the function.
Return Value
Boolean
Examples
The following expression returns FALSE:
Not(10>7)
Syntax
NotEquals(Compare1, Compare2)
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.
Return Value
Boolean. Returns TRUE if the first value is not equal to the second value. Returns FALSE if
the two values are equal.
Examples
The 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
NotEquals 173
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.
Syntax
Now()
Return Value
Date
Examples
The following expression returns 12 given that today's date is June 3, 2004 and the current
time is 12:30 pm:
Hour(Now())
Syntax
NumberString(X)
X Numeric Required. Number for which you want to perform the calculation.
Return Value
String
Examples
The 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
NumberString 175
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.
Syntax
Or(BooleanValue1, BooleanValue2)
BooleanValue1 Boolean Required. Boolean condition you want to pass to the function.
BooleanValue2 Boolean Required. Boolean condition you want to pass to the function.
Return Value
Boolean
Examples
The 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
Syntax
PV(Rate, NumberPeriods, Payment [, FutureValue, PaymentAtBeginning,
CurrencyDecimals])
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.
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.
Return Value
Numeric
Examples
The 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)
PV 177
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.
Syntax
Pearson(List1, List2 [, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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
Women 6200 800
Notes
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.
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
Pearson 179
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.
Syntax
PercentContribution(List [, Context])
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.
Return Value
Numeric List
Examples
Use 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
Notes
This function ignores NULLs when performing the calculation.
Syntax
Percentile(List, Percentile [, Context])
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.
Return Value
Numeric
Examples
The 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
Notes
If a value is NULL, the function ignores the row.
Percentile 181
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.
Syntax
PeriodsPerYear([Frequency])
Return Value
Numeric
Examples
The following expression returns 52 as the number of periods when you need to make weekly
payments:
PeriodsPerYear("Weekly")
Syntax
Plus(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Plus 183
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.
Syntax
Pmt(Rate, NumberPeriods, PresentValue [, FutureValue, PaymentAtBeginning,
CurrencyDecimals])
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.
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.
Return Value
Numeric
Examples
The following expression returns -2111.64 as the monthly payment amount of a loan:
Pmt(0.01, 10, 20000)
Notes
To 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.
Syntax
Power(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Notes
If 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.
Power 185
PREVIOUS
Returns the previous value for the specified metric or attribute.
This function belongs to the Fetch category.
Syntax
Previous(Metric)
Metric Varies Required. Metric for which you want to get the value.
Return Value
Varies
Examples
The following expression returns the revenue from the previous quarter:
Previous({quarterly_revenue})
Quarterly Revenue Return Value
----------------- ------------
1500 NULL
7125 1500
3500 7125
1090 3500
Notes
PowerAnalyzer returns NULL if the specified value is the first value in the metric or attribute.
Syntax
Price(SettlementDate, MaturityDate, Rate, Yield, Redemption [, Frequency,
DayCountBasis, CurrencyDecimals])
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.
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.
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.
Return Value
Numeric
Examples
The 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")
Price 187
Notes
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.
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
Syntax
PriceDisc(SettlementDate, MaturityDate, Discount, Redemption [,
DayCountBasis, CurrencyDecimals])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
When you pass an optional argument, you must also pass all other optional arguments that
occur before it in the function syntax.
PriceDisc 189
PRICEMAT
Returns the price per $100 face value of a security that pays interest at maturity.
This function belongs to the Financial category.
Syntax
PriceMat(SettlementDate, MaturityDate, IssueDate, Rate, Yield [,
DayCountBasis, CurrencyDecimals])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
PriceMat 191
PRODUCT
Returns the result of multiplying values in a numeric metric or attribute.
This function belongs to the Aggregate category.
Syntax
Product(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 1200 as the product of the Customer Count metric:
Product({Customer Count})
Customer Count
--------------
10
3
8
5
Notes
This function ignores NULLs when performing the calculation.
Syntax
Rate(NumberPeriods, Payment, PresentValue [, FutureValue,
PaymentAtBeginning, CurrencyDecimals])
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.
Return Value
Numeric
Examples
The 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%.
Notes
The payment value is negative because these are amounts that you pay.
Rate 193
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.
Syntax
RateToDf(Rate, RateConvention, ElapsedYears)
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.
Return Value
Numeric
Examples
The following expression returns 0.3 as the discount factor:
RateToDf(0.054, "annual", 5)
Syntax
Received(SettlementDate, MaturityDate, Investment, Discount [,
DayCountBasis, CurrencyDecimals])
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.
Investment Numeric Required. Amount invested in the security. 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.
Return Value
Numeric
Examples
The 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")
Notes
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.
Received 195
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.
Syntax
Replace(String, Start, Count, Replace)
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.
Return Value
String
Examples
The following expression:
Replace("I left my heart in San Francisco.", 11, 5, "lung")
Notes
Use the Substitute function when you want to replace specific text in a text string.
Syntax
Rept(String, RepeatCount)
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.
Return Value
String
Examples
Use 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
Rept 197
ROUND
Returns all values rounded to the specified number of digits.
This function belongs to the Rounding category.
Syntax
Round(NumericValue [, Significance])
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.
Return Value
Numeric
Examples
Use 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
Notes
Returns the same value if the significance is greater than the scale of the value.
Syntax
RoundDown(NumericValue [, Significance])
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.
Return Value
Numeric
Examples
Use 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
Notes
Returns the same value if the significance is greater than the scale of the value.
RoundDown 199
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.
Syntax
RoundUp(NumericValue [, Significance])
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.
Return Value
Numeric
Examples
Use 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
Syntax
RunningAvg(List [, Context])
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.
Return Value
Numeric List
Examples
Use 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
Notes
This function ignores NULLs when performing the calculation.
RunningAvg 201
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.
Syntax
RunningSum(List [, Context])
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.
Return Value
Numeric List
Examples
Use 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
Notes
This function ignores NULLs when performing the calculation.
Syntax
SLn(Cost, Salvage, Life [, CurrencyDecimals])
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.
Return Value
Numeric
Examples
An 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)
SLn 203
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.
Syntax
SYD(Cost, Salvage, Life, Period [, CurrencyDecimals])
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.
Return Value
Numeric
Examples
A 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)
Syntax
Sec(Angle)
Return Value
Numeric
Examples
The 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
Sec 205
SECH
Returns the hyperbolic secant of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Sech(Angle)
Return Value
Numeric
Examples
The 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
Syntax
Second(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Notes
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.
Second 207
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.
Syntax
Sign(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric. Returns -1 for negative values, 0 for 0, and +1 for positive values.
Examples
To 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
Syntax
Sin(Angle)
Return Value
Numeric. The value is in the range -1 to +1.
Examples
The 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
Sin 209
SINH
Returns the hyperbolic sine of a numeric value.
This function belongs to the Trigonometric category.
Syntax
Sinh(Angle)
Return Value
Numeric
Examples
The 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
Syntax
Skew(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Notes
The 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.
Skew 211
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.
Syntax
Slope(ListY, ListX [, Context1, Context2])
ListY Numeric List Required. Name of a metric or attribute representing known dependent
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.
Return Value
Numeric
Examples
The 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
26977.24 5420.59
Notes
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.
Slope 213
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.
Syntax
Sqrt(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function. Must be
greater than or equal to 0.
Return Value
Numeric
Examples
The following expression returns 7.28011:
Sqrt(53)
Syntax
Square(NumericValue)
NumericValue Numeric Required. Numeric value you want to pass to the function.
Return Value
Numeric
Examples
The following expression returns 100.00:
Square(10)
Square 215
STANDARDIZE
Returns the normalized value for a distribution, given the mean and standard deviation.
This function belongs to the Statistical category.
Syntax
Standardize(X, Mean, StdDev)
X Numeric Required. Number for which you want to perform the calculation.
StdDev Numeric Required. Standard deviation of a list of numbers. Must be greater than
0.
Return Value
Numeric
Examples
The following expression returns 1.74 as the normalized value for 32:
Standardize(32,30,1.15)
Syntax
Stdev(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Notes
This function ignores NULLs when performing the calculation. This function returns NULL
if the provided list includes less than two values.
Stdev 217
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.
Syntax
StdevP(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Notes
This function ignores NULLs when performing the calculation. This function returns NULL
if the provided list includes less than two values.
Syntax
Steyx(ListY, ListX [, Context1, Context2])
ListY Numeric List Required. Name of a metric or attribute representing known dependent
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.
Return Value
Numeric
Examples
The 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
28195.74 6974.26
Steyx 219
Notes
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.
Syntax
Substitute(String, Find, Replace [, Instance])
String String Required. String value you want to pass to the function.
Instance Numeric Optional. The Nth instance of the string to find. Default is 1, the first
instance.
Return Value
String
Examples
The following expression:
Substitute("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)
Notes
Use the Replace function when you want to replace any text that occurs in a specific location
in a text string.
Substitute 221
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.
Syntax
Substring(String, Start [, Count])
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.
Return Value
String
Examples
The 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
Notes
You 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.
Syntax
Subtract(NumericValue1, NumericValue2)
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.
Return Value
Numeric
Examples
The 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
Subtract 223
SUM
Returns the sum of all values
This function belongs to the Aggregate category.
Syntax
Sum(List [, Context])
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.
Return Value
Numeric
Examples
The following expression returns 44.52 as the total cost:
Sum({Cost})
Cost
-----
15.84
8.43
9.06
11.19
Syntax
TBillEq(SettlementDate, MaturityDate, Discount)
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.
Return Value
Numeric
Examples
The 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)
Notes
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.
TBillEq 225
TBILLPRICE
Returns the price per $100 face value for a Treasury bill.
This function belongs to the Financial category.
Syntax
TBillPrice(SettlementDate, MaturityDate, Discount)
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.
Return Value
Numeric
Examples
The following expression returns $94.92 as the price of a Treasury bill:
TBillPrice(Date(2004,3,31), Date(2004,11,30), 0.075)
Notes
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.
Syntax
TBillYield(SettlementDate, MaturityDate, Price)
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.
Price Numeric Required. Security price per $100 face value. Must be greater than 0.
Return Value
Numeric
Examples
The following expression returns 0.103 as the yield for a Treasury bill:
TBillYield(Date(2004,3,31), Date(2004,11,30), 93.5)
Notes
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.
TBillYield 227
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.
Syntax
TDist(X, DegreesOfFreedom [, Tails])
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.
Return Value
Numeric
Examples
The 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)
Syntax
TInv(Probability, DegreesOfFreedom [, Tails])
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.
Return Value
Numeric
Examples
The 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)
TInv 229
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.
Syntax
TTest(List1, List2 [, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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
TTest 231
TAN
Returns the tangent of a given angle.
This function belongs to the Trigonometric category.
Syntax
Tan(Angle)
Return Value
Numeric
Examples
The 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
Syntax
Tanh(Angle)
Return Value
Numeric. The value is in the range -1 to +1.
Examples
The 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
Tanh 233
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.
Syntax
Time(Date, Hour [, Minute, Second])
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.
Return Value
Date
Examples
Use 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
Notes
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.
Syntax
Today()
Return Value
Date
Examples
The following expression returns 5 given that today's date is May 28, 2004:
Month(Today())
Today 235
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.
Syntax
TriMean(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Syntax
Trim(String)
String String Required. String value you want to pass to the function.
Return Value
String
Examples
Use 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"
Trim 237
TRUNC
Returns the value truncated to a specific digit.
This function belongs to the Rounding category.
Syntax
Trunc(NumericValue [, Significance])
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.
Return Value
Numeric
Examples
Use 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
Notes
Returns the same value if you specify a significance that is greater than the scale of the value.
Syntax
Units(Units1, Units2, NumericValue)
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.
Return Value
Numeric
Examples
Units("hours", "days", 48) returns 2.00000
Notes
If 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.
Units 239
UPPER
Converts lowercase string characters to uppercase.
This function belongs to the String category.
Syntax
Upper(String)
String String Required. String value you want to pass to the function.
Return Value
String
Examples
The 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
Syntax
VDB(Cost, Salvage, Life, StartPeriod, EndPeriod [, RateFactor, NoSwitch,
CurrencyDecimals])
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.
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.
Return Value
Numeric
VDB 241
Examples
You 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)
Notes
The 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.
Syntax
ValueOf(List, Context)
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.
Return Value
Numeric
Examples
You 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
ValueOf 243
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.
Syntax
Var(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Notes
This function ignores NULLs when performing the calculation. This function returns NULL
if the provided list includes less than two values.
Syntax
VarP(List [, Context])
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.
Return Value
Numeric
Examples
The 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
Notes
This function ignores NULLs when performing the calculation. This function returns NULL
if the provided list includes less than two values.
VarP 245
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.
Syntax
WeekNum(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Notes
Returns 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.
Syntax
Weekday(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
The 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
Notes
The 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.
Weekday 247
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.
Syntax
Weibull(X, Alpha, Beta, Cumulative)
X Numeric Required. Number for which you want to perform the calculation. Must
be greater than or equal to 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.
Return Value
Numeric
Examples
The following expression returns 1.00 as the Weibull cumulative distribution:
Weibull(121, 10, 15, TRUE)
Syntax
Within(Compare1, CompareList)
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.
Return Value
Boolean
Examples
The 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
Notes
When comparing a date attribute to the values in a list, you must enter values in the yyyy-
MM-dd format.
Within 249
When comparing a given string value to the values in the list, the Within function ignores the
case of the letters.
Syntax
XIRR(CashFlows, Dates [, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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
Notes
The cash flows must include at least one positive and at least one negative value.
XIRR 251
To calculate the internal rate of return for periodic cash flows, use the IRR function.
Syntax
XNPV(CashFlows, Dates, Rate [, CurrencyDecimals, Context1, Context2])
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.
Return Value
Numeric
Examples
The 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
3/1/1998 10000
XNPV 253
10/30/1998 5000
2/15/1999 2000
4/1/1999 1000
Notes
The 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.
Syntax
Year(Date)
Date Date Required. Date value you want to pass to the function.
Return Value
Numeric
Examples
All of the following examples return the number 2004:
Year(Date(2004, 9, 10))
Year(DateValue("2004/06/10"))
Year({Day Shipped}), where the value of the Day Shipped attribute is July
10, 2004
Notes
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.
Year 255
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.
Syntax
Yield(SettlementDate, MaturityDate, Rate, Price, Redemption [, Frequency,
DayCountBasis])
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.
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
Syntax
YieldDisc(SettlementDate, MaturityDate, Price, Redemption [,
DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The 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")
Notes
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.
YieldDisc 257
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.
Syntax
YieldMat(SettlementDate, MaturityDate, IssueDate, Rate, Price [,
DayCountBasis])
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.
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.
Return Value
Numeric
Examples
The 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)
Notes
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.
Syntax
ZTest(List, X [, StdDev, Context])
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.
Return Value
Numeric
Examples
The 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
ZTest 259
260 Chapter 4: Functions
Appendix A
This appendix provides a quick reference for all functions available in Data Analyzer:
♦ Aggregate Functions, 262
♦ Boolean Functions, 267
♦ Comparative Functions, 268
♦ Conditional Functions, 269
♦ Conversion Functions, 270
♦ Date & Time Functions, 271
♦ Fetch Functions, 273
♦ Financial Functions, 274
♦ Mathematical Functions, 280
♦ Rounding Functions, 281
♦ Running Functions, 282
♦ Statistical Functions, 283
♦ String Functions, 287
♦ Trigonometric Functions, 289
♦ Unary Functions, 291
261
Aggregate Functions
Table A-1 lists functions in the Aggregate category:
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.
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.
Slope Slope(ListY, ListX [, Context1, Returns the slope of the linear regression line
Context2]) 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.
Steyx Steyx(ListY, ListX [, Context1, Returns the statistical standard error of linear
Context2]) 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.
ValueOf ValueOf(List, Context) Returns the value of a given metric for a given
context.
And And(BooleanValue1, Joins two conditions and returns TRUE if both conditions are
BooleanValue2) 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, Compares two conditions and returns TRUE if either of the two
BooleanValue2) conditions is TRUE. Returns FALSE if both conditions are
FALSE. Use metric and attribute names in the arguments.
If If(If, True, False) Returns one of two specified values based on the results
of a condition.
IfNull IfNull(List, ReturnValue [, Returns the specified value if a condition returns NULL.
OtherValue] Use to replace NULL in a metric or attribute.
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.
AddToDate AddToDate(Date, Years, Adds years, months, and days to a date, and returns
Months, Days) 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.
DateValue DateValue(DateString [, Converts a string to a date. You can pass the date
DateFormat]) 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 [, Returns the number of days in the period between the
DayCountBasis]) 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 Returns the number of years in the period between the
[, DayCountBasis]) 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.
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.
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.
NextDate NextDate(Date, Frequency [, Returns the next date in a period or payment schedule.
NumberPeriods])
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, Sets the time of day for a date. Use this function to set
Second]) 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 a 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.
Next Next(Metric) Returns the next value for the specified metric.
Previous Previous(Metric) Returns the previous value for the specified metric or attribute.
CumIPmt CumIPmt(Rate, NumberPeriods, Returns the cumulative interest paid for a loan
PresentValue, StartPeriod, between two specified periods of time. The Rate
EndPeriod, PaymentAtBeginning argument represents the interest rate for each
[, CurrencyDecimals]) period. Calculate NumberPeriods by multiplying
the term of the loan by number of payments per
year.
DfToRate DfToRate(DiscountFactor, Returns the rate, given the discount factor. The
RateConvention, ElapsedYears) 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.
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.
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.
Nominal Nominal(Rate, NumberPeriods) Returns the nominal annual interest rate, given
the effective rate and the number of
compounding periods per year.
Rate Rate(NumberPeriods, Payment, Returns the interest rate earned per period by a
PresentValue [, FutureValue, security. PresentValue is the lump-sum amount
PaymentAtBeginning, that a series of future payments is worth now.
CurrencyDecimals]) 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.
RateToDf RateToDf(Rate, RateConvention, Returns the discount factor, given the rate. The
ElapsedYears) 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.
SYD SYD(Cost, Salvage, Life, Returns the depreciation of an asset using the
Period [, CurrencyDecimals]) sum-of-years' digits method for a given period.
TBillPrice TBillPrice(SettlementDate, Returns the price per $100 face value for a
MaturityDate, Discount) Treasury bill.
TBillYield TBillYield(SettlementDate, Returns the yield for a USA Treasury bill. The
MaturityDate, Price) 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, Returns the variable declining balance. The
StartPeriod, EndPeriod [, variable declining balance is the depreciation of
RateFactor, NoSwitch, an asset for a specified period, using the double-
CurrencyDecimals]) 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 [, Returns the internal rate of return for a series of
Context1, Context2]) 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.
XNPV XNPV(CashFlows, Dates, Rate [, Returns the net present value for a series of
CurrencyDecimals, Context1, cash flows, where the cash flows might not
Context2]) 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.
Floor Floor(NumericValue [, Returns the value rounded down to the specified number
Significance]) 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.
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.
BinomDist BinomDist(X, Trials, Returns the value for the statistical binomial
ProbabilityOfSuccess, distribution. Binomial distribution is the
Cumulative) probability of observing X number of successes
in a fixed number of independent trials.
BinomInv BinomInv(Probability, Trials, Returns the number (integer) for which the
ProbabilityOfSuccess) 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.
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.
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.
NormDist NormDist(X, Mean, StdDev, Returns the normal distribution for a number,
Cumulative) 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.
Standardize Standardize(X, Mean, StdDev) Returns the normalized value for a distribution,
given the mean and standard deviation.
Steyx Steyx(ListY, ListX [, Context, Returns the statistical standard error of linear
Context]) 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.
Weibull Weibull(X, Alpha, Beta, Returns the statistical Weibull distribution. Use
Cumulative) 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.
Find Find(String, Find [, Finds a text string (Find argument) within another
FromEnd]) 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.
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, Replaces a string of text with a new string of text
Replace [, Instance]) 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.
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.
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.
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.
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.
Abs Abs(NumericValue) Returns the absolute value of a number. Use this 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.
A ArcSec function
description 52
ABS function ArcSech function
description 35 description 53
AccrInt function ArcSin function
description 36 description 54
AccrIntM function ArcSinh function
description 38 description 55
ADD function ArcTan function
description 39 description 56
AddToDate function ArcTanh function
description 40 description 57
AmorDegrC function arithmetic operators
description 41 description 15
AmorLinC function using strings in expressions 15
description 43 AveDev function
And function description 58
description 45 Avg function
ArcCos function description 59
description 46, 47
ArcCot function
description 48 B
ArcCoth function
BinomDist function
description 49
description 60
ArcCsc function
BinomInv function
description 50
description 61
ArcCsch function
description 51
293
C CountUnique function
description 78
calculated metrics CoupDayBS function
using functions 4 description 79
calculations CoupDayS function
precision 7 description 80
Ceiling function CoupDaySNC function
description 62 description 81
ChiDist function CoupNCD function
description 64 description 82
ChiInv function CoupNum function
description 65 description 83
ChiTest function CoupPCD function
description 66 description 84
Clean function Covar function
description 68 description 85
comparison operators Csc function
description 15 description 87
using strings in expressions 15 Csch function
Concat function description 88
description 69 CumIPmt function
Confidence function description 89
description 70 CumPrinc function
constants description 91
E 13 currency decimals arguments
expressions 13 using 7
FALSE 13 custom aggregates
PI 13 using functions 4
TRUE 13 using variables in expressions 27
Context argument custom attributes
attributes 24 layout-dependent restrictions 23
equal to operator 24 using functions 5
functions of Running category 29 custom metrics
keywords 26 layout-dependent restrictions 23
null values 11 using functions 3
separators 24
syntax 24
using 22 D
variables 27
date format strings
Correl function
format letters 18
description 71
using in expressions 17
Cos function
using in functions 18
description 73
Date function
Cosh function
description 95
description 74
dates
Cot function
using in expressions 17
description 75
DateString function
Coth function
description 96
description 76
DateValue function
CountAll function
description 97
description 77
294 Index
Day Count Basis argument
using 32
F
Day function Factorial function
description 99 description 117
DB function FALSE constant
description 93 defined 13
DDB function FDist function
description 94 description 114
DevSq function Find function
description 100 description 118
DfToRate function FInv function
description 101 description 115
Disc function Fisher function
description 102 description 119
Divide function FisherInv function
description 103 description 120
Floor function
description 121
E Forecast function
description 123
E constant
functions
defined 13
currency decimals 7
Effect function
in calculated metrics 4
description 104
in custom aggregates 4
ElapsedDays function
in custom attributes 5
description 105
in custom metrics 3
ElapsedHours function
null handling 11
description 107
supported units of measure 34
ElapsedYears function
syntax 12
description 108
using date format strings 18
EndOfMonth function
FV function
description 109
description 116
Equals function
description 110
EqualsIgnoreCase function
description 111
G
Exp function GammaDist function
description 112 description 125
ExponDist function GammaInv function
description 113 description 126
expression syntax GammaLog function
constants 13 description 127
date format strings 17 GeoMean function
dates 17 description 128
functions 12 GreaterThan function
general rules 10 description 129
null values 10 GreaterThanEquals function
operators 14 description 130
supported units of measure 34
Index 295
H Lower function
description 146
HarMean function
description 131
Hour function M
description 132
Max function
HypGeomDist function
description 147
description 133
Max2 function
description 148
I Median function
description 149
If function Min function
description 135 description 150
IfNull function Min2 function
description 136 description 151
IntDivide function Minute function
description 137 description 152
IntRate function Mod function
description 138 description 153
IRR function Mode function
description 134 description 154
Month function
description 155
K MovingAvg function
Kurt function description 156
description 139 MovingSum function
description 158
Multiply function
L description 160
layout context
using 23 N
layout keywords
using in expressions 26 Negate function
layout-dependent description 164
custom attribute restrictions 23 Next function
custom metric restrictions 23 description 165
Len function NextDate function
description 140 description 166
LessThan function Nominal function
description 141 description 167
LessThanEquals function NormDist function
description 142 description 168
Log function NormInv function
description 143 description 169
Log10 function NormSDist function
description 144 description 170
Log2 function NormSInv function
description 145 description 171
logical operators Not function
description 16 description 172
296 Index
NotEquals function PriceDisc function
description 173 description 189
Now function PriceMat function
description 174 description 190
NPer function Product function
description 163 description 192
NPV function PV function
description 161 description 177
null values
Context argument 11
expressions 10 R
NumberString function
Rate function
description 175
description 193
RateToDf function
O description 194
Received function
operators description 195
arithmetic 15 Replace function
comparison operators 15 description 196
expression syntax 14 Rept function
logical operators 16 description 197
using strings in arithmetic 15 Round function
using strings in comparison 15 description 198
Or function RoundDown function
description 176 description 199
RoundUp function
description 200
P running category functions
using Context argument 29
Pearson function
RunningAvg function
description 178
description 201
PercentContribution function
RunningSum function
description 180
description 202
Percentile function
description 181
PeriodsPerYear function
description 182
S
PI constant Sec function
defined 13 description 205
Plus function Sech function
description 183 description 206
Pmt function Second function
description 184 description 207
Power function Sign function
description 185 description 208
precision Sin function
calculations 7 description 209
Previous function Sinh function
description 186 description 210
Price function Skew function
description 187 description 211
Index 297
SLn function Trim function
description 203 description 237
Slope function TriMean function
description 212 description 236
Sqrt function TRUE constant
description 214 defined 13
Square function Trunc function
description 215 description 238
Standardize function TTest function
description 216 description 230
Stdev function
description 217
StdevP function U
description 218
Units function
Steyx function
description 239
description 219
units of measure
Substitute function
supported in expressions 34
description 221
Upper function
Substring function
description 240
description 222
Subtract function
description 223
Sum function
V
description 224 value context
SYD function using 23
description 204 value keywords
syntax using in expressions 26
expressions 10 Var function
description 244, 245
VDB function
T description 241, 243
Tan function
description 232
Tanh function
W
description 233 Weekday function
TBillEq function description 247
description 225 WeekNum function
TBillPrice function description 246
description 226 Weibull function
TBillYield function description 248
description 227 Within function
TDist function description 249
description 228
time attributes
using in Context argument 25 X
Time function XIRR function
description 234 description 251
TInv function XNPV function
description 229 description 253
Today function
description 235
298 Index
Y
Year function
description 255
Yield function
description 256, 257
YieldMat function
description 258
Z
ZTest function
description 259
Index 299
300 Index