jeudi 18 novembre 2010

My first CDF : @RANDOM

I recently wrote my first CDF using Netbeans IDE 6.9.1. This CDF is really simple and is not based on JAPI or any other external libraries, @RANDOM just returns a random value! Quite basic but useful to populate your database with random data.

Have a look at the Java class below, once compiled in a jar and copied to Essbase,  you may register it using the following MaxL instruction :
CREATE OR REPLACE FUNCTION 'Sample'.'@RANDOM' AS 'myCdf.random' SPEC '@RANDOM()' COMMENT 'Return a random value';

/**
 * Essbase Custom Defined Function : RANDOM
 * Return a random amount
 *
 * @author Sebastien Roux
 * @version 1.0
 */
public class myCdf {

    public static double random() {

        double alea = Math.random();
        
        return alea;
    }
}

Aucun commentaire:

Enregistrer un commentaire

your comment here please!