NumberOfCashflows





http://www.QuantTools.com
CapeTools FpML Swaps function list

Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index



If there are cashflow elements embedded within the FpML object, this function returns the number of cash flow elements.

The XPath query which can also be passed to the FpMLGenericQuery() function to generate the same result is : count(//descendant::swap/swapStream[LegNo]/cash flows[1]/paymentCalculationPeriod).

This function requires the input of a FpMLDoc object key, which must have been produced via a call to the ReadFpML() function.

This function would have returned a string 'KEY' which is to be passed to the 'FpMLDocKey' parameter of this function.

If you were looking at the FpML document, a typical example of walking to this(these) node(s) would be...

  // FpML Document -> IsOrAreNodesPresent(

    -> swap

      -> swapStream[LegNo]

        -> cash flows[1]

          -> paymentCalculationPeriod)

Or if using the FpMLGenericQuery() function...

count(//descendant::swap/swapStream[LegNo]/cash flows[1]/paymentCalculationPeriod)




Note: Within Excel, the function is named - CT.FpML.SW.NumberOfCashflows




High level graphic of NumberOfCashflows() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. FpMLDocKey parameter

    Key to an already loaded FpML Key Object
  2. LegNo parameter

    The swapStream leg that you are interested in viewing (usually either the value 1 or 2)


Extended information

Function Syntax

VB Syntax


Long CTFpMLSW.NumberOfCashflows( _
String FpMLDocKey, _
Long LegNo)


Excel Spreadsheet Syntax


=CT.FpML.SW.NumberOfCashflows(
Excel String Cell FpMLDocKey,
Excel Numeric Cell LegNo)


C++ Syntax


static long NumberOfCashflows(
std::string FpMLDocKey,
long LegNo);


DotNET Syntax


System.Int32 CTFpMLSWSA.NumberOfCashflows(
System.String FpMLDocKey,
System.Int32 LegNo);

Parameter data types

ArgNameArgTypeIsKey
FpMLDocKeyStringTRUE
LegNoLongFALSE


Example Inputs

The first column represents the name of the parameters. The second column specifies whether the parameters are optional or not. Finally the last column provides some sample input data.
Function call input string-keys are always in the format : "NAME.EXTTAG.TICKER" The "EXTTAG.TICKER" part is determined from the output of other, capetools, object creation functions.


ArgNameIsOptional (Excel only)Example
FpMLDocKeyFALSEFpMLDocKeyNAME.EXTTAG.TICKER (from a function call)
LegNoFALSE1

Example function usage


These are the financial QuantTools sub-function calls that are used within the examples :





The objects generated by these functions are inter-connected in the following way :




You can refer to the examples within the CapeTools FpML category of functions for examples of how to execute this function.
Simply read in your FpML file and use the CTFpMLSW class from the COM (ActiveX Dll), CTFpMLSWSA class from .NET, C++ or Java or the CreateCTFpMLSW() method from Excel VBA to obtain a handle to the object needed to execute the NumberOfCashflows() function.

Note : These examples, as well as the Excel example require a correct path to an FpML file.


Copyright (c) 2003-2007 CapeTools - All Rights Reserved.