How to use MDX constants/functions in icCube Reporting?

82 views Asked by At

I have several functions/constants defined in the schema. An example is: _latestPeriodWithData() which returns a date.

Goal: I want to use this value in the Reporting to set a Guide in a chart, using the demo example 'On Widget Options':

This is what I tried so far:

I have assigned this function as 'MDX / Value' for a Report Constant _lastDate and obtained the value for this constant using the java script function: context.eventValue('_lastDate'); but that just gives me the caption. The function context.eventObject("_lastDate").options.asMdx gives me _latestPeriodWithData(), but not its value.

On Widget Options

/**
 * Result will be used while rendering.
 */
function(context, options, $box) {
     // for debugging purpose
     console.log(context.eventObject("_lastDate").options.asMdx);

     options.guides[0].value = context.eventObject("_lastDate").options.asMdx; // <-- gives me _latestPeriodeWith data
                                                                               //     but not its value
     options.guides[0].toValue = context.eventObject("_lastDate").options.asMdx;
     options.guides[0].lineAlpha = 1;
     options.guides[0].lineColor = "#c44";

    return options;
}
0

There are 0 answers