Automate Essbase daily maintainence with MAXL script

After building our essbase analytic model and importing the data, the next big thing is to keep our essbase data refreshed with each coming day's new data . And it might be necessary to  add  new dimension member to the outline sometimes (e.g. we might have to add today's date to the date dimension before loading today 's sales data)

Of course we could always use the admin console to add new member or execute calculation on the database, But It would be nice and simple if we could use some batch script to do it automatically, MAXL is such script language that we could use to automate our essbase daily maintenance job.

 

What is MAXL?

MAXL is an script language that we could use to manipulate essbase, we could use it to

  • create or modify  essbase applications or database or even outline
  • create or modify dimension (e.g. add new member to the dimension)
  • importing data into database
  • execute calculation scripts.
  • ...many more , actually most of the functionality that we use the graphic admin console to do could be done using maxl scripts.

MAXL script is only simple text that we could edit or write  using the simple notepad . although admin console do provide an more easy editor for editing MAXL scripts.

 

Simple MAXL examples

 

adding new member to date dimension

--------------------------------------------------

/* to execute:

essmsh scriptname username password

*/

login $1 $2; /* login section */

spool on to 'd:\temp\add_day.txt'; /* log the result */

alter system load application 'test';

alter application 'test' load database 'testdb';

/* import dimension member from sql database */

import database 'test'.'testdb' dimensions connect as 'sql_db_user_name' identified by 'sql_db_password' using server rules_file 'addday' on error write to 'd:\addday.txt';

spool off;
logout;
-----------------------------------------------
 

 

Execute calculation scripts

------------------------------------------------

/* to execute:

essmsh scriptname username password

*/

login $1 $2;

spool on to 'd:\temp\exec_cal.txt';

/*alter system load application 'test';

alter application 'test' load database 'testdb'; */

/* embed the calculation statement into maxl script */

execute calculation 'CALC ALL;' on 'test'.'testdb' ;

 

/* execute stored server calculation scripts */

execute calculation 'test'.'testdb'.'cal-rank';

spool off;

logout;

 ---------------------------------------------------

You could see by these two simple examples that MAXL is really powerful language that we could use to automate our daily essbase maintenance !