# Performing a simple calculations in Jedox ETL

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

• # Performing a simple calculations in Jedox ETL

Greetings!
I am new to Jedox but have been using TM1, MS BI, and a few other tools for a while.
I am learning Jedox by doing some examples and was wondering what would be the best way to tackle this problem in Jedox ETL.

I have the following 2 dimensional cube called 'Salaries' with Employees & Measures as dimensions
Employees dim has 4 employees with an attribute called Grade
Measures dim has two elements - Salary and Increment.
Requirement - an ETL process to calculate the increment.

I know this can be done via a rule but need to know how this can be handled via Jedox's ETL tool.

Appreciate any solutions, pointers or references.

 Employee Grade (an attribute of Employee) Salary Increment (to be calculated via ETL) IF Grade > 2 THEN 5% of Salary ELSE 3% of Salary Emp1 1 100 3 (expected values) Emp2 2 100 3 Emp3 3 100 5 Emp4 4 100 5

Many thanks
• Hello Kaveenga,

I guess the following should work:

- you make an extract of the Salaries cube
- you make an extract of the Employees dim, with format "ea" to get the value of the attribute Grade
- fieldtransform with source=salaries cube, then lookup on employees extract, and groovy script to get your formula done

for further details see the samples ETLs, they are very useful

hope this helps!
laloune

Post hoc, non est propter hoc
• Thanks Laloune.

Yep, that's what I did and the Groovy script below. However, I was hoping that I didn't have to do the 2nd extract from the Employee dim and a lookup. Is there anyway to lookup a cell value in Groovy?

{ return 0.05; }
else
{ return 0.03; }
• yes, look in one of the sample for the OLAP.data function
laloune

Post hoc, non est propter hoc
• Thanks again Laloune!

Got it to work. However, I had to transform the native field name #Value to vValue cause Groovy doesn't like #. Anyway to bypass this redundant step?