6 Replies Latest reply on Jun 7, 2013 10:53 AM by Anubhav

    Performance impact with @currmbr function

    870218
      hi all,

      in recent time i have encountered that use of @currmbr decreases the performance. i have browsed the Web but didnt get any meaningful information.
      can someone please Specify that whether it is the case or not and why using @currmbr decreases the Performance.

      Thanks in Advance
      Anubhav
        • 1. Re: Performance impact with @currmbr function
          Celvin Kattookaran
          Let's look at the example in techref.
                  "Average Sales"
                  (IF(@ISLEV(Product,0))
                  Sales;
                  ELSE
                  @AVGRANGE(SKIPNONE,Sales,@CHILDREN(@CURRMBR(Product)));
                  ENDIF;);
          I think what they are missing in the code is a higher level member in FIX for products, so it'll now be
          FIX(@LEVMBRS(Product,1), "New York",Actual, Sales)
                  "Average Sales"
                  (IF(@ISLEV(Product,0))
                  Sales;
                  ELSE
                  @AVGRANGE(SKIPNONE,Sales,@CHILDREN(@CURRMBR(Product)));
                  ENDIF;);
          ENDFIX
          What that code does is it goes and check which level 1 product is calculated and it has to now get the children of that product and then do an avg of that range (Sales, children of current product which is calculated).

          I've seen people using (abusing) @CURRMBR

          like
          IF (@ISMBR(Sales))
          @CURRMBR(Product);
          ELSE
          something
          If you have products in your fix, you don't need to specify @CURRMBR because Essbase already knows it.

          So use @CURRMBR only in places where you are performing something like avgrange of currmbr or if you are using a substring and finding another member.

          Regards

          Celvin
          http://www.orahyplabs.com
          • 2. Re: Performance impact with @currmbr function
            Fastmindz
            Heh Celvin,


            This is one good example you gave but I think Anubhav is looking more for where the performanc degrades due to @CURRMBR function ? Like earlier there were 5 members under a parent which is been enclosed in @CURRMBR & with recent changes there are now 80 members under the same parent. The calculation script performance degrades like anything. Apart from being a Run time function what else is do you think the reason for CURRMBR to behave in such adamant manner ?

            Many Thanks,
            Narendra Singh
            • 3. Re: Performance impact with @currmbr function
              Anubhav
              hi Celvin,

              got your Point but what Narendra has said i am looking for more Possible Explainnation regarding this function.

              suppose i have 5 members and i am using currmbr in a concatenation function the scripts executes in acceptable time but whenever i add member lets say 100 and execute the same script it takes a hell lot of time.

              any possible explaination about that.

              also lets say if i use @member(@parent(@currmbr())) & instead i use @parentval() there is a huge diff in execution time.

              is there when we group one or more function with @currmbr the performance decrease???

              just want to gather some idea how currmbr behaves.
              • 4. Re: Performance impact with @currmbr function
                GlennS_3
                There are a number of functions that slow performance @currmbr, @prior to name a couple. Sometimes you can work around using these functions other times you can not. In the case of @prior, I had a formula that had multiple @priors for multiple years. I got it to work mush faster by hard codeing the years in
                • 5. Re: Performance impact with @currmbr function
                  Celvin Kattookaran
                  Isn't that true for all the calcs? when you throw more members into the calc, it takes more time.

                  As glenn mentioned sometimes you've a work around.

                  In your case maybe it is not currmbr which is causing the problem but @parent.
                  In some cases, the @PARENT function is equivalent to the @PARENTVAL function, except in terms of calculation performance. For example, the following two formulas are equivalent:
                  Sales = @PARENT(Profit);
                  Sales = @PARENTVAL(Profit);
                  In this case, using the latter formula results in better calculation performance. In general, use @PARENT as a member rather than as an implied value of a cell. For example:

                  Sales = @AVG(SKIPMISSING, @ISIBLINGS(@PARENT("100")));>

                  I'm using concat and currmbr on a dimension which has around 15000~ members. However I've some udas inbuilt which reduces the number of members that I'm pulling.

                  Regards

                  Celvin
                  http://www.orahyplabs.com
                  • 6. Re: Performance impact with @currmbr function
                    Anubhav
                    hi Celvin,

                    i agree, but celvin if you write a script in such a way that you ar using only @currmbr then also execution time is more.
                    what i want to know is :-
                    1) how the @currmbr works/Behave
                    2)what is the Possible reason for @currmbr to impact the script performance even if wrote in a simple manner.

                    Thanks in advance for your Reply.

                    Regards
                    Anubhav