The essbase already have many functions for calculation. We can create customized calculation functions by Java. Steps:
1. Create a Java function,CalcFunc.java
public class CalcFunc {
public static double sum (double[] data) {
int i, n = data.length;
double sum = 0.0d;
for (i=0; i< n ; i++)
{
double d = data [i];
sum = sum + d;
}
return sum;
}
}
2. compile,run with javac CalcFunc.java, and generate CalcFunc.class
javac CalcFunc.java
C:\app\bob\product\11.1.0\db_1\jdk\bin\javac.exe C:\Hyperion\CustJava\CalcFunc.java
3. Put the class file in the jar file
jar cf jar_filename class_filename
jar cf CalcFunc.jar CalcFunc.class
4.On the computer running Essbase Server, copy the .jar file to one of the following directories (if the directory does not exist, create it):
For .jar files containing global custom-defined functions:
ARBORPATH/java/udf/
C:\Hyperion\products\Essbase\EssbaseServer\java\udf
For .jar files to be used only with specific applications:
ARBORPATH/app/AppName/udf/
5. Register
create function Sample.'@JSUM'
as 'CalcFunc.sum'
spec '@JSUM(memberRange)'
comment 'adds list of input members';
Showing posts with label Calculation. Show all posts
Showing posts with label Calculation. Show all posts
11/25/09
11/12/09
Data Block - Calculation Performance
1.Use FIX instead of cross-dimensional operator
Compare the next 2 statements:
Fix(Jan)
Sales = Sales * 1.05;
EndFIX
Sales(Sales -> Jan = Sales -> Jan * 1.05);
The 2nd is not efficient, it will look through all of time dimension even if only the Jan is calculated. The 1st one only calculate the Jan for sales block which is more efficient.
2. The data block size setting
It should be 10k - 100k, if the data blick size is too big(>100k), the intelligent calculation will not work well. If the data block size is too small(nearby 10k), the index may become too huge, and this will affect the calculation speed.
Compare the next 2 statements:
Fix(Jan)
Sales = Sales * 1.05;
EndFIX
Sales(Sales -> Jan = Sales -> Jan * 1.05);
The 2nd is not efficient, it will look through all of time dimension even if only the Jan is calculated. The 1st one only calculate the Jan for sales block which is more efficient.
2. The data block size setting
It should be 10k - 100k, if the data blick size is too big(>100k), the intelligent calculation will not work well. If the data block size is too small(nearby 10k), the index may become too huge, and this will affect the calculation speed.
Time Dim - Calculation Performance
By default, the time dimension is set to be dense. But if you use incremental data loading in MaxL srcipt. And the data is loaded in the end of every month. You can set Time dimension as sparse dimension, if you have Intelligent Calculation enabled, only the data blocks marked as dirty are recalculated.This will significantly increase the data loading performance.
--------
Incremental Data Loading
Many companies load data incrementally. For example, a company may load data each month for that month. To optimize calculation performance when you load data incrementally, make the dimension tagged as time a sparse dimension. If the time dimension is sparse, the database contains a data block for each time period. When you load data by time period, Essbase accesses fewer data blocks because fewer blocks contain the relevant time period. Thus, if you have Intelligent Calculation enabled, only the data blocks marked as dirty are recalculated. For example, if you
load data for March, only the data blocks for March and the dependent parents of March are updated.
However, making the time dimension sparse when it is naturally dense may significantly increase the size of the index, creating possibly slower performance due to more physical I/O activity to accommodate the large index.
If the dimension tagged as time is dense, you still receive some benefit from Intelligent Calculation when you do a partial data load for a sparse dimension. For example, if Product is sparse and you load data for one product, Essbase recalculates only the blocks affected by the partial load, although time is dense and Intelligent Calculation is enabled.
Note: This method works only for ASO
--------
Incremental Data Loading
Many companies load data incrementally. For example, a company may load data each month for that month. To optimize calculation performance when you load data incrementally, make the dimension tagged as time a sparse dimension. If the time dimension is sparse, the database contains a data block for each time period. When you load data by time period, Essbase accesses fewer data blocks because fewer blocks contain the relevant time period. Thus, if you have Intelligent Calculation enabled, only the data blocks marked as dirty are recalculated. For example, if you
load data for March, only the data blocks for March and the dependent parents of March are updated.
However, making the time dimension sparse when it is naturally dense may significantly increase the size of the index, creating possibly slower performance due to more physical I/O activity to accommodate the large index.
If the dimension tagged as time is dense, you still receive some benefit from Intelligent Calculation when you do a partial data load for a sparse dimension. For example, if Product is sparse and you load data for one product, Essbase recalculates only the blocks affected by the partial load, although time is dense and Intelligent Calculation is enabled.
Note: This method works only for ASO
11/11/09
Parallel Calculation and Tuning
1. We can enable parallel calculation in Essbase.cfg file in system level, or enable in calculation sript level. Sample code:
SET CALCPARALLEL
SET CALCTASKDIMS 2
2. Parallel calculation only works with Uncomitted Access
3. There is a risk that the parallel calculation may freeze the computer.
4. Use FIX command so that special data block is calculated, don't use cross dimension operator in most cases.
SET CALCPARALLEL
SET CALCTASKDIMS 2
2. Parallel calculation only works with Uncomitted Access
3. There is a risk that the parallel calculation may freeze the computer.
4. Use FIX command so that special data block is calculated, don't use cross dimension operator in most cases.
Essbase Calculation Performance Tunning
1. After we enabled Parallel Calculation, by default,Essbase uses the last sparse dimension in an outline to identify tasks that can be performed concurrently. But the distribution of data may cause one or more tasks to be empty; that is, there are no blocks to be calculated in the part of the database identified by a task. This situation can lead to uneven load balancing, reducing parallel calculation effectiveness.
2. To resolve this situation, you can enable Essbase to use additional sparse dimensions in the identification of tasks for parallel calculation. For example, if you have a FIX statement on a member of the last sparse dimension, you can include the next-to-last sparse dimension from the outline as well. Because each unique member combination of these two dimensions is identified as a potential task, more and smaller tasks are created, increasing the opportunities for parallel processing and improving load balancing.
3. Add or modify CALCTASKDIMS in the essbase.cfg file on the server, or use the calculation script command SET CALCTASKDIMS at the top of the script.
Sample Code: SET CALCTASKDIMS 2
This will enable last 2 sparse dimension to be included in the checking, it may significantly increase the running performance.(416-3025810)
2. To resolve this situation, you can enable Essbase to use additional sparse dimensions in the identification of tasks for parallel calculation. For example, if you have a FIX statement on a member of the last sparse dimension, you can include the next-to-last sparse dimension from the outline as well. Because each unique member combination of these two dimensions is identified as a potential task, more and smaller tasks are created, increasing the opportunities for parallel processing and improving load balancing.
3. Add or modify CALCTASKDIMS in the essbase.cfg file on the server, or use the calculation script command SET CALCTASKDIMS at the top of the script.
Sample Code: SET CALCTASKDIMS 2
This will enable last 2 sparse dimension to be included in the checking, it may significantly increase the running performance.(416-3025810)
Subscribe to:
Posts (Atom)
