Peculiar problem with Essbase (Calc Script) - substitution variable / UDAs

This is odd but I have a script like :
VAR iloop=1,break=0;
FIX(<required POV>)
Loop (20,break)
VAR Country_total1,Country_total2,Country_total3;
FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop)))) // &Country1, &Country2 - are substitution variables with UDAs stored as strings
Statements;
/* +<statements for calculating total values.. for that country and stored against variables>+ */
Country_total1=Country_total1+ +<Calculation>+
ENDFIX
/* Second part : Now again the calculations stored in the variables are to be stored against specific entities */
FIX (@UDA(Entity,@ALIAS(@CONCATENATE("&Country",iloop))))
FIX(@ISUDA(Entity,<Check1>)
..... Assign to relevant account
ENDFIX
ENDFIX
ENDLOOP
ENDFIX
Now the problem is that the first fix statement works just fine, but the FIX statement in the 'second part' throws an error
Error: 1200354 Error parsing formula for [FIX STATEMENT] (line 66): expected type [STRING] found [EXTVAR] ([iloop]) in function [@CONCATENATE]
If I hard code the 'second part' FIX statement to the substitution variable directly - it works just fine.
How can the first statement work and not the second one ? They are exactly the same.

Glenn, thanks - I hadn't thought of that :).
But it still does not entirely solve my problem (please see my previous post depicting a requirement similar to ours )
- We have lots of countries (50-60+ might be much more) and each country can have multiple entities (3-4 on an average - can go unto 7-8)
- so good guess would be around 200 entities
- So say I have to do it for 2 countries only (two entity types). Then I need 4 variables - 2 for each country ('country 1 ET1 total', 'Country 1 ET2 Total')
When the list is 20 counties - variables become 40 :(.
- Still leaving aside the 40 variables for a bit -
There are subsequent steps of calculations which needs to be done based on these totals (which are exactly the same for all countries) - just that we need the correct totals to begin with and the rest is already stored in the DB
So since I have a different variable for each country - I cannot write one single calculation block to use the variables sequentially one by one (can I ?)
I might have to write a separate calculation block for each of these countries. (20 separate blocks)
That's what I was trying to avoid and simplify with the substitution variable (but is not working)
- Create substitution variables - which would store the alias of the required countries (2/10/20 as many required)
- Loop through these substitution variables - using them one by one
- So I just need one single block of calculation with all the variable in the calc script being reused after each country calculation is done
- and the user need not go into the script, as the only thing that will change are the countries. And he can change it easily through the substitution variable.
Edited by: Ankur on Jun 27, 2012 12:53 PM

Similar Messages

  • Enhanced Calc Script more flexible than native Essbase Calc Script?

    What makes an Enhanced Calc Script more flexible than native Essbase Calc Script?
    Run on Save or @CALCMODE function or Run time prompts or Can be run over the web or Substitution Variables or Custom Defined Functions.
    Appreciate if u reply ASAP!!
    Thanks in Advance!!!

    Some posts on the subject
    Business Rule
    Business rule
    Business rule
    Cheers
    John
    http://john-goodiwn.blogspot.com/

  • Problem with Essbase add-in 9.2.1 and office 2010.

    Hi all,
    we have a problem with Essbase add in 9.2.1 and office 2010.
    Every time when a user opens Excel a new (additionally) euntry in the ad-on menue appears.
    Indeed what happens is, that the add-in is loaded n-times.
    At the first start of excel one time, second two times and so on...
    Thtas's very annoying.
    Can someone confirm this issue or even better know a workaround.
    (A way we have found so far to ease the pain a bit -well only temporary- is to disable the ad-in, close Excel and start it again.
    However with every new start of execel the issues begins again.
    But that's not a solution you can recommand to the end user.)
    Any help is welcome.
    Thank you in advance!
    Andre

    Have a read of the following on Oracle Support - Support for Office 2010 in Essbase Excel Add-In and Smart View [ID 1191235.1]
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problems with close event scripts and closing Photoshop

    Hi!
    We are having problems with close event scripts ("Cls ") when closing/quitting Photoshop.
    The close event scripts are working without problem when closing an image. But when quitting Photoshop without having closed all images we are observing the following behaviour:
    with CS2 the close event scripts are not triggered at all
    with CS4  the close event scripts are triggered and executed correctly. But after that the Photshop process freezes. No visible GUI, you have to kill the process with the task manager.
    I can reproduce this behaviour even with a small script consisting of a single alert('hello') and even an empty script. Is this an known bug or am I doing something wrong?
    Thanks for your help!
      Eric

    Check your energy saver settings under system preferences. That is where you set sleep setting.

  • Execute Essbase Calc Scripts from FDM

    Hi,
    Can any of you let me know how to execute Essbase Calc Scripts from FDM, these Calc Scripts are on Essbase Server. Any help would be greatly appreciated.
    Thanks

    See the thread below:
    Re: FDM - Script

  • Problem with Dynamic Calc members in calc script

    Hi
    i wrote a calc script which calculates the value of acct2 which is dependant on the value of acct1 that is calculated from acct0 as bellow:
    FIX(
    M1
    acct1(
    acct1=acct0->M2;
    acct2=acct1->M2;
    ENDFIX
    the value of the intersection of M1->acct0 is 100 as input ,what i wanted from this calc script is the acct2->M1 to be 100 after executing the script once
    but the fact is i have to run it twice to get the expected result.
    the outline is like this:
    M:
    M2 Dynamic calc M2=M0+M1
    M0 Stored
    m1 stored
    Account:
    acct0 stored
    acct1 stored
    acct2 stored
    Can anyone tell me the reason and how to solve it?
    Edited by: user10450070 on 2011-1-25 上午1:38

    Is acct1 correct after one run of the calculation, but acct2 incorrect? If so, it's because Essbase is calculating them both at the same time (parallel), whereas it has to be forced to calculate acct1 first and acct2 second. You can do this with separate fixes as below:
    FIX(M1)
    acct1=acct0->M2;
    ENDFIX
    FIX(M2)
    acct2=acct1->M2;
    ENDFIX
    Or, you can you can force it into calculating in serial mode:
    SET CALCPARALLEL 0;
    FIX(M1)
    acct1=acct0->M2;
    acct2=acct1->M2;
    ENDFIX
    Sabrina
    Edited by: SabrinaD on Jan 26, 2011 7:56 AM

  • Issue with rule file and Substitution variable

    Hi All,
    I am using Essbase 9.3.3
    I created a rule file with 5 dimensions in which 3 dimensions I defined in columns and two dimensions I gave it as header in data column with comma seperated.
    Among those two dimension members, one is an account member with "/" in it within quotes and other is a substitution variable.
    The member assigned for that Substitution variable has a space in between and is updated within quotes in variables list.
    When I try loading data, I am getting an error saying that two members are not valid.
    Eg: "Tax/Unit",&Scenario is not valid.
    &Scenario - "Budget Q1"
    Can some one please suggest on the issue.
    I am not facing any problem in calc scripts or reports scripts using the substition variable.
    Thanks in advance

    Mark,
    Modifying the default files is dangerous and ill advised. You could always just add a style sheet (inline or linked) to your application that overrides that one setting while you wait on the permanent fix.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Call ODI 11g scenario from Essbase calc script/business rule using ODI SDK

    I am looking for any hints on how to use the ODI 11g SDK. I want to call a java application (CDF) that runs an ODI scenario using RUNJAVA in Essbase which I have successfully done in the 10g environment.
    The java application has the odi-core.jar included in the project and registers OK with Essbase and I have replicated code from the Oracle sample code site. When I run the application in a calc script I get the following error:
    EssbaseCluster-1.EFTS.EFTS.odi     Execute calculation script     June 17, 2011 10:20:40 AM NZST     Failed
    Error: 1200456 Problem running [indigo.essbase.odi.RunODIScenario]: [java.lang.NoClassDefFoundError: org/springframework/util/StringUtils]
    When I comment out the code that calls the creates the OdiInstance then the java app executes fine - i.e. writes something to the Essbase log.
    The research I have done so far indicates that a classpath is incorrect. If that is the case where do I start looking to correct the classpath? Is it the ODI classpath or the Essabase classpath?
    Any tips would be grateful.
    Thanks.

    You need to import more jars to execute this
    following are the jars
    1)     bsf.jar
    2)     bsh-2.0b2.jar
    3)     commons-collections-3.2.jar
    4)     eclipselink.jar
    5)     odi-core.jar
    6)     ojdl.jar
    7)     oracle.ucp_11.1.0.jar
    8)     persistence.jar
    9)     spring-beans.jar
    10)     spring-core.jar
    11)     spring-dao.jar
    12)     spring-jdbc.jar
    Once you have this in classpath - your scenario will execute
    Hope this helps.

  • SQLPlus problem - user enters quote in substitution variable

    Hello,
    I have a SQL Plus script report, where user is prompted to enter "customer name".
    Some customer names contain single quotes/apostrophes.
    When user type such name, the script will error out with
    ORA-01756: quoted string not properly terminated
    I can't ask users to use '' instead of ' . I can't control what they enter. Is there a way to process single quote so the statement below will work:
    select * from sometable where customer_name = '&1'
    where &1 = Smith's
    I can't do replace, etc, because it's all error out with the same error. I need to replace ' on SQLPlus level somehow. One logical way to do it would be to redefine the string separation charachter somehow...
    SQL*Plus: Release 8.0.6.0.0
    Thanks,
    Vlad
    Message was edited by:
    user454392

    As it's a SQL*Plus substitution variable it is literally copied into the code just prior to compilation, so you can't stop it from breaking the compilation of the code. q quoted strings are the only solution I can think of but of course they are only available from 10g onwards.
    The other alternative is to capture the input in a shell/batch script which validates it first and then passes the value to the SQL to be executed.

  • Problem with a calc involving @MDSHIFT and Dynamic Calc

    Hi all,
    I have a problem with the calculation of a member in a calc script. The formula of this member is :
    "R70100"
    IF(@ISMBR("M01"))
    ("T_008"->"Cumul"->"HT"+"T_003"->"Cumul"->"HT")*"AVCT_PR" - @MDSHIFT("R70100" -> "Cumul" -> "HT" -> "M12", -1, "Year", );
    ELSE
    ("T_008"->"Cumul"->"HT"+"T_003"->"Cumul"->"HT")*"AVCT_PR" - @MDSHIFT("R70100" -> "Cumul" -> "HT", -1, "Period", );
    ENDIF
    - R70100 is a member of a dense dimension.
    - T_008, T_003 and AVCT_PR are spare and stored.
    - "Cumul" is a dynamic member which allow us to calculate cumulative from monthly.
    - Time is split into two dimensions, Period and Year.
    The problem is that the @MDSHIFT doesn't seems to work with the dynamic calc as the monthly result is the cumulative correct value. I didn't know what is wrong BUT each time I launch the script, values are good for one more month.
    After one run, for example, I obtained this result :
    !http://zenon.apartia.fr/stuff/200910070001.GIF!
    Two run later, here are the news values :
    !http://zenon.apartia.fr/stuff/200910070002.GIF!
    Any idea on what going on and how to correct it ? Thanks !
    Frédéric

    A couple of questions for you:
    1) Do you need the overhead of @MDSHIFT when you are only moving in one dimension? Wouldn't @PRIOR have been a lot easier? At least this is true for the ELSE condition.
    2) Could you post just the results of the @MDSHIFT calculation so we (okay, this may be just for me, it's still breakfast time here and not enough coffee has been ingested yet to read a spreadsheet without recourse to the formulas) can better see the impact?
    3) Have you tried using your code against a non-dynamic member? Does it make a difference?
    Regards,
    Cameron Lackpour

  • Essbase calc script performance issues

    Hi,
    I have essbase 9.3 running on Sun solaris 4 CPU, 16 GB server. The calc script "calc all" takes ~3 hrs to complete.
    This is the calc script.
    /ESS_LOCALE English_UnitedStates.US-ASCII@Binary
    SET UPDATECALC OFF;
    SET CALCPARALLEL 4;
    SET CALCTASKDIMS 2;
    CALC ALL;
    We don't have to calc all dim, but even if we
    But even with specific dim we get the same timing. Below is the script
    SET UPDATECALC OFF;
    SET CALCPARALLEL 4;
    SET CALCTASKDIMS 2;
    FIX ("Y2009", "Actual");
    CALC DIM("Data Source","Intercompany","LegalEntity","Site","Department","Entity");
    ENDFIX
    The ess00001.ind is 700 Mb and ess00001.pag is 2.1 GB.
    In Admin services, this is what I see for caches
    1) Index cache size is 1 GB for this DB
    2) Index cache current value is 1gb
    3) Datafile cache setting is 1.5 GB
    4) Datafile cache current value is 0 (?? not sure why??)
    5) Data cache setting 4.1 GB
    6) Index page setting 8 kb
    please help ...
    Thanks
    Moe

    Moe,
    I'm guessing you inherited this thing, else you would know why the cache settings are what they are, but here are some thoughts:
    Caches:
    3) Datafile cache setting is 1.5 GB
    4) Datafile cache current value is 0 (?? not sure why??)You're running the database in Buffered I/O, so the data file cache is ignored.
    1) Index cache size is 1 GB for this DB
    2) Index cache current value is 1gb You have consumed all of the cache -- I'm a little confused, as you state your .ind file to be 700 megabytes -- generally the index cache consumption doesn't go beyond the .ind file size. When you look at your hit ratio statistics in EAS, does it show a 1 against the index cache? If yes, then you don't need to look any further as that's as good as it's going to get.
    5) Data cache setting 4.1 GBUnless you're using MEMSCALINGFACTOR, I don't think Essbase is actually addressing all of the memory you've assigned. What are you showing as actually used? In any case, having a data cache almost twice as big as the .pag files is a waste as it's way too large.
    Easy, off the cuff suggestions without knowing more about your db:
    1) Try AGG instead of CALC DIM for sparse dimensions.
    2) Try turning off (yes, turning off, you'd be surprised) parallel calc, and benchmark it. It will probably be slower, but it's nice to know.
    3) Dimension order? Modified hourglass?
    4) Tried defragmenting the database and benchmarking the performance?
    5) What is your block size? Big? Small?
    6) I think you are not calculating your Accounts/Measures dimension in your calc? If you are, and it's dense, could you make those Accounts dynamic calc -- dropping a dimension from the calc can be huge.
    I'm sure there will be other suggestions -- these are the easiest.
    Regards,
    Cameron Lackpour

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Automate the process of changing the subvariables in Essbase calc script?

    Hi Experts,
    I have two calc scripts called HourlyAgPre & HrlyAgPost and in these calcs I am using Subvariables. Like wise i have 4 regions and there are so many calc scripts. during month end close i have to go and change the subvariables manually. is there any way to change the subvaribles at one time using Maxl script?
    Eg:
    In BD9 My subvariable needs to point to Preclose
    In BD-3 my subvaribles need to poit to Postclose.
    Please suggest me if you come across this?
    Thanks in advance.

    Hi,
    Here is example of setting variables through Maxl and passing parameters into the maxl script Re: Update variables
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problem with view object for global variables

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    We are using view object with transient attributes for global variables.
    we defined the view as explained here:
    http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    also we defined one of the attributes as primary key.
    When we start to test our application with disable connection pooling we got some problems.
    sometimes the row in the global view object is deleted.
    (for example after using executeEmptyRowSet on other view object).
    it looks strange, we couldn't fוnd why does it happen.
    Any idea?

    As Timo said, it is very hard to help without source.
    Are you sure that you do the next step:
    After the call to super.prepareSession(), add code to create a new row in the transient view object and insert it into the view object.

  • Problem with Exchange 2010 scripts after installing PowerShell 4.0

    Hi
    After installing new updates for MS Exchange 2010 and PowerShell 4.0 I've got problems with PS scripts using buil-in
    exchange commands.
    I wrote interactive script for searching e-mails. Here is a pice of code where I get error after installing PS v4.
    $SearchContent=Read-Host "Write sentence to find"
    Get-Mailbox | Search-Mailbox -SearchQuery "$SearchContent" -TargetMailbox "Discovery Search Mailbox" -TargetFolder "Inner box" -LogOnly -Loglevel Full | Out-Null
    After installing PowerShell 4.0 I get that bug and report in TargetMailbox is not genereated.
    The property keyword isn't supported.
    At C:\Administration\Scripts\T-SearchMail.ps1:122 char:1
    + Get-Mailbox | Search-Mailbox -SearchQuery "$SearchContent" -TargetMailbox "Disco ...
    + ~~~~~~~~~~~~~~~~~   
    + CategoryInfo          : InvalidArgument: (:) [], ParserException
        + FullyQualifiedErrorId : 35E6C841
    Using PowerShell 2.0 everything was ok.
    How to solve this problem?
    Tomasz
    Kind Regards Tomasz

    But http://blogs.msdn.com/b/powershell/archive/2013/10/25/windows-management-framework-4-0-is-now-available.aspx is dated
    October 2013, while the current Windows Management Framework 4.0 System Requirements section states:
    Servers that are running the following applications can now run WMF 4.0. The versions listed are the minimum releases required to run WMF 4.0.
    Microsoft Exchange Server 2013 Service Pack 1
    Microsoft Exchange Server 2010 SP3 with Update Rollup 5
    Since
    Update Rollup 5 For Exchange 2010 SP3 (KB2917508) was published Febrary 2014, shouldn't Exchange 2010 now be compatible with PowerShell 4.0?

Maybe you are looking for