Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

Special functions

 

Function

Description

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;
Double firstValue()

Returns the lowest value of selected of selected level (measure). For example:

Section
Column
 DatefirstValue('L_DATE')
Project11/1/20151/1/2015
Project15/1/20151/1/2015
Project23/1/20153/1/2015
Project28/1/20153/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.
Double formatNumber(number value)Formats the value according the indicator's format from settings.
Double formatNumber(number value, 'String pattern')Formats the value according the indicator's format from settings. String pattern allows you to control, how the format specified.
Double lastValue()

Returns the lowest value of selected of selected level (measure). For example:

Section
Column
ProjectDatelastValue('L_DATE')
Project11/1/20155/1/2015
Project15/1/20155/1/2015
Project23/1/20157/1/2015
Project27/1/20157/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 calculates the sum from 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 maximul 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 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

rank() { expression }

Returns numerical order (rank) of the indicator applied in the expression within used drill-down. Example:

Section
Column

User

Score

rank()

Peter

90.3

2

John

92.7

1

Anna

89.7

3

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-downSalesrankInner()
Coffee750001
Caffe Latte250003
Caffe Mocca350002
Decaf Espresso150001
Tea1000002
Lemon1000001
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-downSalesrankInner(true)
Coffee750002
Caffe Latte250002
Caffe Mocca350001
Decaf Espresso150003
Tea1000001
Lemon1000001
setDebugOn(true)

Enables debug mode. If formula contains error, table cell will contain detailed stack trace about error, chart and KPI label won't be rendered and error detail will be printed out.

We recommend to use this function only while debugging. If not debugging, delete or mark it as comment:

//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

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

Passing parameters to time formula

It is possible to define the time entry by formula. Following functions are applicable for these kind of formulas only.

Function

Description

void set(String name, Object value)

Sets the parameter value.

Object get(String name)

Loads the parameter value.

Object indicator()

Returns indicator from the context of the row of current table. This function returns also values of formula defined indicators (defined in report). Example:

Code Block
value(actualYear(),'actualMonth - 1m - 1d',indicator())

Consider following example - we have several indicators with codes M_NAME_1, M_NAME_2 and M_NAME_3. These indicators are used in formulas 1 - 3. The time area is defined by time formulas 1 - 5.

 

Time formula 1:
M_NAME_1

Time formula 2:
M_NAME_2

Time formula 3:
M_NAME_3

Time formula 4:
s = get('suffix');
return value('M_NAME' + s);

Time formula 5:
value(actualYear(),
'now-1m',indicator())

Formula 1:
set('suffix', '_1');
return M_NAME_1;

1000

2000

3000

1000

1000

Formula 2:
set('suffix', '_2');
return M_NAME_2;

1000

2000

3000

2000

2000

Formula 3:
set('suffix', '_3');
return M_NAME_3;

1000

2000

3000

3000

3000

M_NAME_1

1000

2000

3000

N/A

1000

M_NAME_2

1000

2000

3000

N/A

2000

M_NAME_3

1000

2000

3000

N/A

3000

Getting User Information

It is possible to obtain information about logged in user for your reporting needs.

FunctionDescription
String getSignedUserName()Returns name of currently signed in user.
String getSignedUserSurname()Returns surname of currently signed in user.
String getSignedUserEmail()Returns email of currently signed in user.
String getSignedUser()Returns username of currently signed in user.

Working with lists and arrays

BellaDati supports all Arrays from https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html and ArrayUtils from https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/ArrayUtils.html.

Syntax: first define name of the package, then use desired method.

Example:

def int[] a = [1,2,3]
a = ArrayUtils.add(a, 0)
Arrays.sort(a)
return a[3]

Next Steps

Sv translation
languageja

特別な機能

 

機能

説明

void filter(String filterExpression, { expression } )

特別なフィルターでパスされた表現を評価します。例:

Code Block
filter('M_MEASURE > 100') { L_ID_COUNT } 

Double aggregatePrevLevel(int countOfPrevlevels, { expression } )

埋め込まれた表現の集合値を戻します。集合体は特定の上のレベルのために計算されます。例:

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;
Double firstValue()

選択したレベル(方法)の最低値を戻します。例:

Section
Column
 日付最初の値('L_DATE')
Project11/1/20151/1/2015
Project15/1/20151/1/2015
Project23/1/20153/1/2015
Project28/1/20153/1/2015
Double forEachRow('expression')

データセットの行レベルにある表現を計算し、特定の結果から合計を計算します。以下の例は、forEachRow()方法とそれ以外の掛け算の違いを表しています:

Section
Column

 

 

Ind1

Ind2

forEachRow('M_IND_1 * M_IND_2')

M_IND_1 * M_IND_2

メンバー

 

5

30

80

150

 

ドリルダウンメンバー1

3

20

60

60

 

ドリルダウンメンバー2

2

10

20

20

Double forEachRow('expression','aggregation')データセットの行レベルにある表現を計算し、特定の結果から2番目のパラメーターに基づいて集合体を計算します。集合体はSUM, MIN, MAX, AVG, COUNT, DCOUNTを含むことができます。
Double formatNumber(number value)設定のインディケーター形式に基づいて値を形式化します。
Double formatNumber(number value, 'String pattern')設定のインディケーター形式に基づいて値を形式化します。ストリングパターンにより形式の特定をコントロールすることができます。
Double lastValue()

選択したレベル(方法)の最低値を戻します。例:

Section
Column
プロジェクト日付最終値('L_DATE')
Project11/1/20155/1/2015
Project15/1/20155/1/2015
Project23/1/20157/1/2015
Project27/1/20157/1/2015
void eachMember(String attribute) { expression }

アトリビュトパラメーターにより定義された特定のアトリビュト値の表現を計算します。

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

 

5

30

80

150

 

Value1

3

20

60

60

 

Value2

2

10

20

20

正しい使用法はフォーミュラ・ベスト・プラクティスを参照して下さい。

Double members(String path, { expression } )

希望のドリルダウンメンバー値の表現を計算します。例:

Code Block
return members('[L_LEVEL_1=VAL][L_LEVEL_2="VAL1,VAL2"]', {
M_NAME_1 * M_NAME_2
})

この例は、特定のメンバーに集合されたインディケーターM_NAME_1の値を戻します。

正しい使用法はフォーミュラ・ベスト・プラクティスを参照して下さい。

Double membersSum({ expression } )

特定のメンバーの表現を計算し、特定の結果から合計を計算します。以下の例は、membersSum()方法とそれ以外の掛け算の違いを表しています:

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

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersSum(String levelCode, { expression } )

定義されたlevelCodeの特定のメンバーの表現を計算し、特定の結果から合計を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersAvg({ expression } )

特定のメンバーの表現を計算し、特定の結果から平均値を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersAvg(String levelCode, { expression } )

定義されたlevelCodeの特定のメンバーの表現を計算し、特定の結果から平均値を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersMin({ expression } )

特定のメンバーの表現を計算し、特定の結果から最小値を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersMin(String levelCode, { expression } )

定義されたlevelCodeの特定のメンバーの表現を計算し、特定の結果から最小値を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersMax({ expression } )

特定のメンバーの表現を計算し、特定の結果から最大値を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double membersMax(String levelCode, { expression } )

定義されたlevelCodeの特定のメンバーの表現を計算し、特定の結果から最大値を計算します。

正しい使用法はフォーミュラ・ベスト・プラクティス を参照して下さい。

Double dateAttribute(String levelCode){ expression }

 

定義日の定義levelCodeの特定のメンバーの表現を計算します。

Code Block
dateAttribute('L_DATE') {dateInterval('2014-01-01','2014-12-01') { 'M_NAME_1' + 'M_NAME_2' } }
Double timeAttribute(String levelCode){ expression }

定義時間の定義levelCodeの特定のメンバーの表現を計算します。

Code Block
timeAttribute('L_TIME') {timeInterval('10:00:00','12:00:00') { 'M_NAME_1' + 'M_NAME_2' } }

String attributeCode()

現在のメンバーのアトリビュトコードを戻します。例:

Section
Column

 

人口

attributeCode()

プラハ

1200000

L_CITY

ベルリン

3000000

L_CITY

ロンドン

7825200

L_CITY

String memberIdentifier()

現在のメンバーのアトリビュトコードと値を以下の様式で戻します。[L_CODE={VALUE}。:

Section
Column

 

人口

memberIdentifier()

プラハ

1200000

[L_CITY= {プラハ}]

ベルリン

3000000

[L_CITY= {ベルリン}]

ロンドン

7825200

[L_CITY= {ロンドン}]

String memberValue()

現在のメンバー値を戻します。例:

Section
Column

 

人口

memberValue()

プラハ

1200000

プラハ

ベルリン

3000000

ベルリン

ロンドン

7825200

ロンドン

rank() { expression }

使用ドリルダウン内の表現に適用されているインディケーターの数順(ランク)を戻します。例:

Section
Column

ユーザー

スコア

rank()

ピーター

90.3

2

ジョン

92.7

1

アンナ

89.7

3

rankInner() { expression }

表の全ての使用ドリルダウン内の表現に適用されているインディケーターの数順(ランク 昇順)を戻します。例:

Section
Column
ドリルダウン売上rankInner()
コーヒー750001
カフェラテ250003
カフェモカ350002
ディカフェエスプレッソ150001
紅茶1000002
レモン1000001
rankInner(true) { expression }

表の全ての使用ドリルダウン内の表現に適用されているインディケーターの数順(ランク 降順)を戻します。例:

Section
Column
ドリルダウン売上rankInner(true)
コーヒー750002
カフェラテ250002
カフェモカ350001
ディカフェエスプレッソ150003
紅茶1000001
レモン1000001
setDebugOn(true)

デバッグモードを有効化します。フォーミュラがエラーを含むとき、表列はエラー・グラフの詳細なスタックトレースを含みます。KPIラベルは提出されず、エラーの詳細は印刷されます。

この機能をデバッグしているときのみに使うことをお勧めします。デバッグしていない場合、削除またはコメントとして残してください:

//setDebugOn(true)
withoutDateTime() { expression }

適用日付時刻インターバルから脱退します。例:

Section
Column

日付

M_INDICATOR

withoutDateTime() { M_INDICATOR }

1/12 - 12/12

1000

3000

1/1/2013 - 1/31/2013

100

3000

withoutDrillDown() { expression }

適用ドリルダウンから脱退します。例:

Section
Column

M_INDICATOR

withoutDrillDown() { M_INDICATOR }

+UK

3000

3000

--ロンド

1000

3000

--マンチェスター

1000

3000

--オックスフォード

1000

3000

withoutFilter() { expression }

 

適用フィルターから脱退します。例: (フィルターはSEGMENT=SMBに設定してあります)

Section
Column

M_INDICATOR

withoutFilter() { M_INDICATOR }

パリ

1000

3000

ロンドン

900

3000

ベルリン

1100

3000

パラメーターを時刻フォーミュラに渡す

フォーミュラによって時刻入力を定義することは可能です。以下の機能はこれらのフォーミュラのみに対応できます。

機能

説明

void set(String name, Object value)

パラメーター値の設定をします

Object get(String name)

パラメーター値のロードをします

Object indicator()

現在の表の行コンテクストからインディケーターを戻します。この機能はフォーミュラ定義のインディケーター(レポートで定義)も戻します。例:

Code Block
value(actualYear(),'actualMonth - 1m - 1d',indicator())

以下の例も検討してください いくつかのインディケーターコードM_NAME_1, M_NAME_2, M_NAME_3があります。これらのインディケーターはフォーミュラ1-3で使われています。この時間エリアは時間フォーミュラ1-5によって定義されています。

 

時間フォーミュラ1:
M_NAME_1

時間フォーミュラ2:
M_NAME_2

時間フォーミュラ3:
M_NAME_3

時間フォーミュラ4:
s = get('suffix');
return value('M_NAME' + s);

時間フォーミュラ5:
value(actualYear(),
'now-1m',indicator())

フォーミュラ1:
set('suffix', '_1');
return M_NAME_1;

1000

2000

3000

1000

1000

フォーミュラ2:
set('suffix', '_2');
return M_NAME_2;

1000

2000

3000

2000

2000

フォーミュラ3:
set('suffix', '_3');
return M_NAME_3;

1000

2000

3000

3000

3000

M_NAME_1

1000

2000

3000

N/A

1000

M_NAME_2

1000

2000

3000

N/A

2000

M_NAME_3

1000

2000

3000

N/A

3000

ユーザー情報の取得

報告の必要に応じてログインユーザーの情報を取得することができます。

機能説明
String getSignedUserName()現在サインインしているユーザーの名前を戻します。
String getSignedUserSurname()現在サインインしているユーザーの名字を戻します。
String getSignedUserEmail()現在サインインしているユーザーのメールアドレスを戻します。
String getSignedUser()現在サインインしているユーザーのユーザー名を戻します。

リストと配列の処理

BellaDatiはhttps://docs.oracle.com/javase/7/docs/api/java/util/Arrays.htmlhttps://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/ArrayUtils.htmlからのArrayUtils配列に対応しています。

シンタックス: パッケージの名前を最初に定義し、その後希望の方法を使用してください。

:

def int[] a = [1,2,3]
a = ArrayUtils.add(a, 0)
Arrays.sort(a)
return a[3]

Next Steps