Function | Description |
---|
String[] comments() | Return array of text inside comments. Code Block |
---|
ArrayUtils.toString(comments()) |
|
String[] commentsDetails() | Returns array of comments in format datetime + text, e.g.: 216-08-12T15:24:22.486;text. Code Block |
---|
ArrayUtils.toString(commentsDetails()) |
|
void filter(String filterExpression, { expression } )
| Evaluates the passed expression with the specified filter. For example: Code Block |
---|
filter('M_MEASURE > 100') { L_ID_COUNT }
|
|
Double aggregatePrevLevel(int countOfPrevlevels, { expression } )
| Returns the aggregated value of the embedded expression. The aggregation is computed for the specified upper level. For example: Code Block |
---|
total = aggregatePrevLevel(1, {
cumulateFromTime(actualYear(), {
'M_NAME_1' + 'M_NAME_2'
});
});
current = cumulateFromTime(actualYear(), {
'M_NAME_1' + 'M_NAME_2'
});
return current / total;
|
|
DoublefirstValue() | Returns the lowest value of selectedofselectedlevel(measure). For example: Section |
---|
Column |
---|
| Date | firstValue('L_DATE') |
---|
Project1 | 1/1/2015 | 1/1/2015 | Project1 | 5/1/2015 | 1/1/2015 | Project2 | 3/1/2015 | 3/1/2015 | Project2 | 8/1/2015 | 3/1/2015 |
|
|
|
Double forEachRow('expression') | Computes the expression on data set row level and calculates the sum from particular results. Following example shows the difference of using multiplication within the forEachRow() method and outside: Section |
---|
Column |
---|
| | Ind1 | Ind2 | forEachRow('M_IND_1 * M_IND_2') | M_IND_1 * M_IND_2 | Member | | 5 | 30 | 80 | 150 | | DrillDownMember1 | 3 | 20 | 60 | 60 | | DrillDownMember2 | 2 | 10 | 20 | 20 |
|
|
|
Double forEachRow('expression','aggregation') | Computes the expression on data set row level and calculates the aggreagation based on second parameter from particular results. Aggregation can include SUM, MIN, MAX, AVG, COUNT, DCOUNT. |
DoubleformatNumber(number value) | Formatsthevalueaccordingtheindicator'sformat from settings. |
DoubleformatNumber(number value, 'String pattern') | Formatsthevalueaccordingtheindicator'sformat from settings. String pattern allows you to control, how the format specified. |
DoublelastValue() | Returns the lowest value of selected of selected level (measure). For example: Section |
---|
Column |
---|
Project | Date | lastValue('L_DATE') |
---|
Project1 | 1/1/2015 | 5/1/2015 | Project1 | 5/1/2015 | 5/1/2015 | Project2 | 3/1/2015 | 7/1/2015 | Project2 | 7/1/2015 | 7/1/2015 |
|
|
|
void eachMember(String attribute) { expression } | Computes the expression for particular attribute values defined by attribute parameter. Section |
---|
Column |
---|
L_ATTRIBUTE_1 | L_ATTRIBUTE_2 | Ind1 | Ind2 | def result = 0 eachMember('L_ATTRIBUTE_2') { result = M_IND_1 * M_IND_2 } return result | M_IND_1 * M_IND_2 | Value | | 5 | 30 | 80 | 150 | | Value1 | 3 | 20 | 60 | 60 | | Value2 | 2 | 10 | 20 | 20 |
|
|
Refer to Formula best practices for correct usage. |
Double members(String path, { expression } )
| Computes the expression for desired drill-down member values. Example: Code Block |
---|
return members('[L_LEVEL_1=VAL][L_LEVEL_2="VAL1,VAL2"]', {
M_NAME_1 * M_NAME_2
})
|
This example returns the value of indicator M_NAME_1 aggregated for specified members. Refer to Formula best practices for correct usage. |
Double membersSum({ expression } )
| Computes the expression for particular members and calculates the sum from particular results. Following example shows the difference of using multiplication within the membersSum() method and outside: Section |
---|
Column |
---|
| | Ind1 | Ind2 | membersSum( { M_IND_1 * M_IND_2 } ) | M_IND_1 * M_IND_2 | Member | | 5 | 30 | 80 | 150 | | DrillDownMember1 | 3 | 20 | 60 | 60 | | DrillDownMember2 | 2 | 10 | 20 | 20 |
|
|
Refer to Formula best practices for correct usage. |
Double membersSum(String levelCode, { expression } )
| Computes the expression for particular members of the defined levelCode and calculatesthesumfrom particular results. Refer to Formula best practices for correct usage. |
Double membersAvg({ expression } )
| Computes the expression for particular members and calculates the average value from particular results. Refer to Formula best practices for correct usage. |
Double membersAvg(String levelCode, { expression } )
| Computes the expression for particular members of the defined levelCode and calculates the average value from particular results. Refer to Formula best practices for correct usage. |
Double membersMin({ expression } )
| Computes the expression for particular members and calculates the minimal value from particular results. Refer to Formula best practices for correct usage. |
Double membersMin(String levelCode, { expression } )
| Computes the expression for particular members of the defined levelCode and calculates the minimal value from particular results. Refer to Formula best practices for correct usage. |
Double membersMax({ expression } )
| Computes the expression for particular members and calculates the maximum value from particular results. Refer to Formula best practices for correct usage. |
Double membersMax(String levelCode, { expression } )
| Computes the expression for particular members of the defined levelCode and calculates the maximum value from particular results. Refer to Formula best practices for correct usage. |
Double dateAttribute(String levelCode){ expression }
| Computes the expression for particular members of the defined levelCode on defined dates. Code Block |
---|
dateAttribute('L_DATE') {dateInterval('2014-01-01','2014-12-01') { 'M_NAME_1' + 'M_NAME_2' } }
|
|
Double timeAttribute(String levelCode){ expression } | Computes the expression for particular members of the defined levelCode on defined time. Code Block |
---|
timeAttribute('L_TIME') {timeInterval('10:00:00','12:00:00') { 'M_NAME_1' + 'M_NAME_2' } }
|
|
String attributeCode()
| Returns the attribute code of current member. Example: Section |
---|
Column |
---|
| Population | attributeCode() | Prague | 1200000 | L_CITY | Berlin | 3000000 | L_CITY | London | 7825200 | L_CITY |
|
|
|
String localize(String attributeCode, String valueToLocalize) | |
String localize(String dataSetCode, String attributeCode, String valueToLocalize); | Method to load translations from referenced data set. Code Block |
---|
| localize('TRANSLATIONS', 'L_ORIG', firstValue('L_STATE')); |
|
String memberIdentifier()
| Returns the attribute code and value of current member in following form [L_CODE={VALUE}]. Example: Section |
---|
Column |
---|
| Population | memberIdentifier() | Prague | 1200000 | [L_CITY= {Prague}] | Berlin | 3000000 | [L_CITY= {Berlin}] | London | 7825200 | [L_CITY= {London}] |
|
|
|
String memberValue()
| Returns the value of current member. Example: Section |
---|
Column |
---|
| Population | memberValue() | Prague | 1200000 | Prague | Berlin | 3000000 | Berlin | London | 7825200 | London |
|
|
|
printComments() | Returns formatted text of comments. No need to iterate over it. |
rank() { expression } | Returns numerical order (rank) of the indicatorappliedintheexpression within used drill-down. Example: Section |
---|
Column |
---|
User | Score | rank() | Peter | 90.3 | 2 | John | 92.7 | 1 | Anna | 89.7 | 3 |
|
|
|
rank('L_DRILLDOWN', 'M_INDICATOR') | Rank will calculate over specific drill down. |
rank('L_DRILLDOWN', 'MEMBER', 'M_INDICATOR') | Rank will calculate over specific drill down and member Code Block |
---|
| withoutFilter() {
rank('L_CITY', 'Aberdeen', 'M_VISITS')
} |
|
rankInner() { expression } | Returns numerical order (rank - ascending) of the indicator applied in the expression within all used drill-downs in the table. Example: Section |
---|
Column |
---|
Drill-down | Sales | rankInner() |
---|
Coffee | 75000 | 1 | - Caffe Latte | 25000 | 3 | - Caffe Mocca | 35000 | 2 | - Decaf Espresso | 15000 | 1 | Tea | 100000 | 2 | - Lemon | 100000 | 1 |
|
|
|
rankInner(true) { expression } | Returns numerical order (rank - descending) of the indicator applied in the expression within all used drill-downs in the table. Example: Section |
---|
Column |
---|
Drill-down | Sales | rankInner(true) |
---|
Coffee | 75000 | 2 | - Caffe Latte | 25000 | 2 | - Caffe Mocca | 35000 | 1 | - Decaf Espresso | 15000 | 3 | Tea | 100000 | 1 | - Lemon | 100000 | 1 |
|
|
|
setDebugOn(true) | Enables debug mode. Ifformulacontains error, table cell will contain detailed stacktraceabouterror,chartandKPIlabel won't be rendered and error detail will be printed out. We recommendto usethis function only while debugging. If not debugging, delete or mark it ascomment: //setDebugOn(true) |
withoutDateTime() { expression } | Opt-out from applied Date and Time intervals. Example: Section |
---|
Column |
---|
Date | M_INDICATOR | withoutDateTime() { M_INDICATOR } | 1/12 - 12/12 | 1000 | 3000 | 1/1/2013 - 1/31/2013 | 100 | 3000 |
|
|
|
withoutDrillDown() { expression } | Opt-out from applied Drill-downs. Example: Section |
---|
Column |
---|
Country | M_INDICATOR | withoutDrillDown() { M_INDICATOR } | +UK | 3000 | 3000 | --London | 1000 | 3000 | --Manchester | 1000 | 3000 | --Oxford | 1000 | 3000 |
|
|
In cases, whentherearemultipledrill-downsappliedinthetable, some of the drill-downs can be excluded from the withoutDrillDownFunction function (the aggregation for the upper level will be displayed). Section |
---|
Column |
---|
Country | City | M_INDICATOR | withoutDrillDown('L_CITY') { M_INDICATOR } | UK | Manchester | 3000 | 4000 | UK | London | 1000 | 4000 | France | Paris | 1000 | 2000 | France | Nice | 1000 | 2000 |
|
|
|
withoutFilter() { expression } | Opt-out from applied filters. Example: (Filter is set to SEGMENT=SMB) Section |
---|
Column |
---|
City | M_INDICATOR | withoutFilter() { M_INDICATOR } | Paris | 1000 | 3000 | London | 900 | 3000 | Berlin | 1100 | 3000 |
|
|
|
withoutReportFilter() { expression } | Only view filter and indicator filter will be applied (available since BellaDati 2.9.4). |
withoutViewFilter() { expression } | Only report filter and indicator filter will be applied (available since BellaDati 2.9.4). |
loadData('L_DRILLDOWN', 'M_INDICATOR') | Allowstoloadvaluesof an indicator for all members of specifiedattribute. it can greatly improve the performance of formulas. The function returna map of members and their values. This map can be accessed by using function getMapValue() Code Block |
---|
| data = loadData('L_DRILLDOWN', 'M_INDICATOR')
getMapValue(data, '[memberId]') |
The memberId has to have following format: [memberId] = [L_ATTRIBUTE={Value}]. Usually, the function is used toghether with withoutDrillDown(). Code Block |
---|
| withoutDrillDown() {
data = loadData('L_COUNTRY', 'M_NUMBERS_BUILT')
getMapValue(data, '[L_COUNTRY={Germany}]')
} |
It also possible to use rank or aggregation such as MAX, MIN etc.: Code Block |
---|
| data = loadData('L_DRILLDOWN', 'M_INDICATOR_rank()')
getMapValue(data, '[memberId]') //will return M_INDICATOR_rank() |
Code Block |
---|
| data = loadData('L_DRILLDOWN', 'M_INDICATOR@MAX')
getMapValue(data, '[memberId]') //will return the highest value of indicator |
Instead of indicator, users can also retrieve first of last value of an attribute. Code Block |
---|
| data = loadData('L_DRILLDOWN', 'L_ATTRIBUTE_LASTVALUE') |
Code Block |
---|
| data = loadData('L_DRILLDOWN', 'L_ATTRIBUTE_FIRSTVALUE') |
|