You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Special functions

Function

Description

void filter(String filterExpression, { expression } )

Evaluates the passed expression with the specified filter. For example:

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:

total = aggregatePrevLevel(1, {
  cumulateFromTime(actualYear(), {
    'M_NAME_1' + 'M_NAME_2'
  });
});
current = cumulateFromTime(actualYear(), {
    'M_NAME_1' + 'M_NAME_2'
});
return current / total;

Double members(String path, { expression } )

Computes the expression for desired drill-down member values. Example:

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.

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:

 

 

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 } )

Computes the expression for particular members of the defined levelCode and calculates the sum from particular results.

Double membersAvg({ expression } )

Computes the expression for particular members and calculates the average value from particular results.

Double membersAvg(String levelCode, { expression } )

Computes the expression for particular members of the defined levelCode and calculates the average value from particular results.

Double membersMin({ expression } )

Computes the expression for particular members and calculates the minimal value from particular results.

Double membersMin(String levelCode, { expression } )

Computes the expression for particular members of the defined levelCode and calculates the minimal value from particular results.

Double membersMax({ expression } )

Computes the expression for particular members and calculates the maximul value from particular results.

Double membersMax(String levelCode, { expression } )

Computes the expression for particular members of the defined levelCode and calculates the maximum value from particular results.

String attributeCode()

Returns the attribute code of current member. Example:

 

Population

attributeCode()

Prague

1200000

L_CITY

Berlin

3000000

L_CITY

London

7825200

L_CITY

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c1279d19-9160-46be-9118-3a4836d9fb8c"><ac:plain-text-body><![CDATA[

String memberIdentifier()

Returns the attribute code and value of current member in following form [L_CODE={VALUE}]. Example:]]></ac:plain-text-body></ac:structured-macro>

 

Population

memberIdentifier()

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f50a7bbf-5cdb-458a-a0ae-87557684a3a9"><ac:plain-text-body><![CDATA[

Prague

1200000

[L_CITY= {Prague}]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6fe956f1-aed9-4abf-a476-d35276885767"><ac:plain-text-body><![CDATA[

Berlin

3000000

[L_CITY= {Berlin}]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5633a838-a0fa-41f0-a9a5-2b4eab67cf41"><ac:plain-text-body><![CDATA[

London

7825200

[L_CITY= {London}]

]]></ac:plain-text-body></ac:structured-macro>

String memberValue()

Returns the value of current member. Example:

 

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:

User

Score

rank()

Peter

90.3

2

John

92.7

1

Anna

89.7

3

withoutDateTime() { expression }

Opt-out from applied Date and Time intervals. Example:

Date

M_INDICATOR

withoutDateTime() { M_INDICATOR }

1/12 - 12/12

1000

3000

1/1/2013 - 1/31/2013

100

500

withoutDrillDown() { expression }

Opt-out from applied Drill-downs. Example:

Date

M_INDICATOR

withoutDrillDown() { M_INDICATOR }

UK

3000

3000

London

1000

3000

Manchester

1000

3000

Oxford

1000

3000

withoutFilter()

Opt-out from applied filters. Example: (Filter is set to SEGMENT=SMB)

Date

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:

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

Next Steps

  • No labels