Overview
Custom functions are functions that are hand designed and that are stored in XML format on the Yellowfin server. These functions usually consist of advanced SQL functions that cannot be easily generated by the formula builder. These functions are configured by your system administrator.
...
Code Block |
---|
language | html/xml |
---|
title | custom-functions.xml |
---|
linenumbers | true |
---|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<custom-functions>
<!-- functions are stored by name, so names must be unique, even across different databases -->
<!-- ratio function -->
<function>
<name>Ratio</name>
<argument>
<index>1</index>
<name>Numerator</name>
<datatype>numeric</datatype> <!-- numeric, text, datetime -->
</argument>
<argument>
<index>2</index>
<name>Denominator</name>
<datatype>numeric</datatype> <!-- numeric, text, datetime -->
</argument>
<sql>
<![CDATA[
CASE
WHEN SUM($2) != 0 THEN SUM($1) / SUM($2)
ELSE NULL
END
]]>
</sql>
<aggregate>$1</aggregate>
<aggregate>$2</aggregate>
<database>SQLServer</database> <!-- Available for what DBs? SQLServer, PostgreSQL, OpenEdge, Progress, Oracle, DB2, Access, Notes, ODBC, HSQL, MySQL -->
<database>HSQL</database>
<return>numeric</return> <!-- numeric, text, datetime -->
</function>
</custom-functions>
|