Local variables with cross dimensional operator

Hi,
I have a business rule, which has the following calculation :
VAR TOTPROD;
TOTPROD = "Prod1"+"Prod2"+"Prod3";
"MBR1" = "MBR2"->"Jan"->TOTPROD/"MBR2"->"YearTotal"->"TotalProducts";
The above statement does not run for obvious reasons that TOTPROD is not a member name.
Is there a way to use a local variable in a cross dimensional operator statement?
I want to use the local variable in order to avoid making an alternate hierarchy.
I am using Essbase / HPB 11.1.2.2
Please help.
Thanks.

Hi
As you state, I dont think the approach that you have is going to work.
What about either
a. Creating a dummy product member in your outline and place your result on it (or use an existing 'dummy' product member)
b. Re-write your code to handle what you wish to do....something like (assuming you are adding Prod1, 2 and 3):
"MBR1" = ("MBR2"->"Jan"-> "Prod1"+"MBR2"->"Jan"-> "Prod2"+"MBR2"->"Jan"-> "Prod3")/"MBR2"->"YearTotal"->"TotalProducts";
Not sure if I am missing anything here, but do either of these suggestions help?
JB

Similar Messages

  • Substitution variable in a cross-dimensional operator

    All,
    Essbase doesn't like this:
    "Jan"(
    ("Actuals"->"2011"->"001"->"abc") = ("Run1"->"2011"->"000"->&varAP);
    can I have a substitution variable inside a cross-dimensional operator?

    The basic construct works for me in Sample.Basic. When you say Essbase doesn't like it, what exactly happens - fails syntax check, errors on execution or just doesn't produce the right results?
    Sometimes it's necessary to include quotes in the subvar value itself, e.g. setting your subvar to *"X Y Z"* including the quotes rather than X Y Z.
    I would guess you've already tried this, but does the script validate and run successfully if you replace the subvar with the value of the subvar?

  • Using local variables with a case structure

    I recently decided that I didn't want to nest a bunch of case structures for a program I am creating. I have two variables, N1 and N2, and I want to say execute Case 1 if the integer input to the terminal is less than N2. Case 2 if the integer input into the terminal is greater than N2 but less than N2+N1. Case 3, integer greater than N2 + N1, but less than N2+N1+N2. Case 4, you guessed it, Greater than N2+N1+N2, but less than N2+N1+N2+N1. When I try to type the variable name into the bar and use the ... like you do with integers it changes the variable name to a string.
    Am I just thinking of this the wrong way? I have a sensor setup in a square and I am using a matrix card hooked up to the sensor bundle to send signals from each sensor to each other sensor, but not for those along the same sides.
    Tom

    I see the nested case structures which is what I didn't want to do, but I will have to because I am tired of looking at this. Thank you for the help on this. I appreciate it.
    The sensor network is shown in the image included.  Lets say we number the sensors in a clockwise direction starting on the lower left hand corner. Each element needs to both send and recieve data to all other elements except for the one in the row it is in. So sensor 1 would sent to sensor to sensors 5 - 18. Then sensor 2 would send to 5 - 18. Sensor 5 would sent to 1 - 4 and 10 - 18. Etc.
    Lets say if this were a circular array it would be easy. Two nested while loops. And the only condition I need to worry about is that sensor N is not both sending and recieving at the same time. Each while loop, or for loop - doesn't matter, will start at 0 and go to N-1. Each i and j will have +1 added to them, and as long as they are not equal preform the data operation. 
    Just some fun logic to think about
    Tom
    Attachments:
    rectangular.jpg ‏12 KB

  • Default initialisation of member variables and local variables

    I don't understand why member variables are initialized with default values by Java.
    Objects are initialized with "null" and primitives with "0", except boolean, which is initialized with "false".
    If these variables are used locally they are not initialized. The compiler requires them to be initialized by the programer, for example "String s = null".
    Why? What is the use of that difference?
    And why are arrays always initialized with default values, no matter if they are member variables or local variables? For example String[] s = new String[10]; s[0] to s[9] are initialized with "null", no matter if "s" is a local or member variable.
    Can someone please explain that strange difference, why it is used? To me it has no sense.

    Most of the time I have to initialize a local variable
    with "String s = null" in order to use it because
    otherwise the compile would complain. This is a cheap
    little trick, but I think everyone uses it.
    I wouldn't agree with "most of the time". The only cases where it is almost necessary to do that is when the variable should be initialized in a loop or a try-catch statement, and that doesn't happen too often.
    If local variables were initiliazed automatically without a warning it would be a Bad Thing: the compiler could tell when there is a possibility that a variable hasn't been assigned to and prevent manymanymany NullPointerExceptions on run time.
    And you didn't answer me why this principle is not
    used with arrays if it is so useful as you think.
    Possibly it is much more difficult to analyse the situation in the case of arrays; what if values are assigned to the elements in an order that depends on run time properties such as values returned from a random number generator.
    The more special rules one has to remember, the more
    likely one makes errors.I agree, but what is the rule to remember in this case?

  • Alternatives for 250+ cross-dimensional operators

    Our geographical product segmentation has altered. I have to change the outline. We have departments and products. Normally we could report on the sum of departments and on the sum of products. Now because of the switch in segmentation we can only report on products. Some of the same products are made by mutiple regions. I have to make an hierarchy which can report on products for regions. In this instance in the outline, there is one product member and two department members. I have made formulas to pull the product apart to regions.
    I have done this with cross dimensional operators:
    For example product A is made by department 1 and 2. I made two formulas in the product dimension ProdAdep1 and ProdAdep2:
    Member formulas:
    ProdAdep1 = Product A -> Department 1;
    ProdAdep2 = Product A -> Department 2;
    Product A is now made ~ and ProdAdep1,ProdBdep1, ProdCdep1 count up to Total products department 1.
    I made all these formulas dynamic calc. Both the product and department dimension are sparse. There are now 250+ formulas and the caculation of the database became very slow. In my Essbase bible 'Look smarter than you are with Essbase 11' I found that the usage of a lot of cross dimensional operators is unseemly and slow.
    So I figured out an alternative, a calcscript with a fix.
    FIX("Product A")
    ProdAdep1 = "Department 1";
    ProdAdep2 = "Department 2";
    ENDFIX
    But this doens't work either. Can anyone help me to think out the best solution?

    Thank you Steve, its a bit more complicated.
    Departments roll up to regions, products also roll up to regions, but we also have shared (central) products.
    For example department 1 in region X (department dimension) can have product A (product dimension) and department 2 in region Y (department dimension) can have product A (product dimension) also. The wish is to report on products and have a full view of the regions within the product dimension.
    How it is now:
    Department dimension:
    Total Region X
    |- Department 1
    |- Department 3
    Total region Y
    |- Department 2
    |- Department 4
    Product dimension:
    Total Region X
    |-Product C
    |-Product D
    Total Region Y
    |- Product E
    |- Product F
    Central Products
    |- Product A
    The Wish:
    Department dimension:
    Total Region X
    |- Department 1
    |- Department 3
    Total region Y
    |- Department 2
    |- Department 4
    Product dimension:
    Total Region X
    |-Product C
    |-Product D
    |-Product A (for region X based on department)
    Total Region Y
    |- Product E
    |- Product F
    |- Product A (for region Y based on department)
    Central Products
    |- Product A ~
    It isnt possible to add a dimension, because the problem occurs on level 0.

  • Deleting all unwanted local variables at once (same name)

    Hi Everyone,
    Is it possible to delete all local variables (same name) at once instead of deleting one by one?  In other words, select all local variables with the same name and delete them at once or quickly.  I am using LV 8.5.
    Thanks,
    Frank

    If you right click on the control or indicator on the front panel, or the terminal, or a copy of the local variable on the block diagram, you can select find local variables.  It will pop up with a list of all of them.  But you will have to cycle through them one by one with Ctrl-G and delete them one by one.

  • Create Local Variable in Custom.pll

    Hi,
    I want to create and calling local variable in custom.pll. As i know, we can create local variable with personalization form. but i didn't find the way to create local variable in custom.pll.
    Is there any way to create local variable in custom.pll and calling that variable ?
    Thanks

    I think what you want is to create a GLOBAL variable, a LOCAL variable would be available to the Procedure/Function being executed.  But to create the local variable, you add it between the Function/Procedure declaration and the begin
    PROCEDURE abc(p_input    VARCHAR2);
      v_count       NUMBER := 0;
    BEGIN
    END;
    A GLOBAL reaches out past the execution of the proc defined in CUSTOM.pll.  You can simply type GLOBAL.<var_name> := <value>.
    BEGIN
      GLOBAL.xx_count := 0;
    END;
    Though I like the ability Personalizations give you of using Init Value vs. Value,  Init Value will assign a value if the variable does not exist ... and creates it.  Value just assigns a value.
    Some say you have do a COPY(value, NAME_IN('variable name')) instad of GLOBAL.<variable_name>, I have never had to use this.

  • Local variable hides a field

    hi everyone ,
    i am creating a button but it will show that local variable hides a field . this not an error or warning
    JRadioButton a1Btn = new JRadioButton("Physical connectivity");
           a1Btn.addActionListener(this) ;here a1Btn shows local variable hides a field.

    Correct, it is not an error to have a local variable with the same name as a field of the class.
    IDE's such as Eclipse often have options that will flag such name shadowing as a warning, so you'll know when you accidentally do this.
    But note that you can always access the class's field by prepending "this.", for example, "this.a1Btn".

  • Properties/Local variables

    Hi experts,
    I try to use properties or local variables.
    I have a scenario package with two scenario step link by predecessor/successor relation.
    I define a local variable with DocEntry from the inbound message of my first step and I want to use it in my second step.
    But when I debuf my second step I see that the system hasn't the value of my variable whereas in my first it's ok.
    I don't understand why? and I don't know how to get back this value?
    any ideas please?
    Thank you
    best regards
    Sarah

    I think it's a problem of syntax because when I put a direct value in the variable it's work. But I don't know how to get back this value from the inbound message of the first step

  • RE: local variable cross-talk?

    Jeff
    A global can be considered as a variable to the entire code, where lots of
    different vi's can operate it. Locals only have any meaning within their
    own vi, or instances of their own vi.
    If anything writes to a particular global, whether in reenterent vi's or
    not, it's available everywhere in the code.
    What you were asking was about locals though. If a vi is non-renentrant
    (i.e. as they come out of the box) then the values in the locals are vi
    specific, no matter where the vi is, where it was last used, it retains the
    data from it's last operation. If it is re-entrant, then the values in the
    locals for each occurance of the vi are its own for EACH instance, i.e. just
    like different locals in different vi's, it doesn't matter where else the vi
    is used, the data held is that from the last operation of that specific
    instance.
    Simple way to demonstrate this. Make a vi that has one numeric control,
    then code in +1 and get it to write to a local variable for that control.
    Throw in an indicator to wire out the result of what is written to the local
    for the control.
    Then take this vi, put it in a for loop, then put another copy in the for
    loop as well. Wire the indicators to the side of the for loop and create
    indicator arrays for them. Get the loop to run 6 times say. Now try
    running this with the vi in the for loop non-reentrant and then reenterrant.
    One way the arrays will contain either all the odd no.s 1,3,5,7,9,11 and
    then the other array 2,4,6,8,10,12 (don't know which array will be which,
    depends which executes first in the for loop of this example). The other
    way they will both be 1,2,3,4,5,6. In the first example, the same vi has
    run 12 times, i.e. one copy of the vi which retains its info and is called
    in many places and therefore only has one set of values, and the other with
    two re-enterant copies where they have their information specific to that
    instance of them i.e. effectively they are different vi's. Both ways are
    useful, depends what you want.
    If you're looking for a use for non-reenterant vi's then consider this:-
    For instance. Supposing you get many things to try to write to a global
    array of numbers, and you have two vi's one "A" writes to the first element
    in the array and the other "B" writes to the second element. Because in LV
    you have to read a global first and then write to it to perform a change,
    these independant vi's "A" and "B" (be they re-enterant versions of the same
    vi, or different vi's), can be performing the tasks simultaneously in the
    code. I.e. "A" reads, "B" reads, "A" writes, and "B" writes over the top
    with a modified version of what it read, and "A"'s changes are lost. This
    is what's known as a "race condition" as "A" hadn't finished and "B" needed
    to know what "A" was going to write before "B" performed "A" read. Try it,
    hours of fun if you code this kind of thing in inadvertantly!
    If the same vi is used, and is not re enterant, it can only run in one
    instance at a time, hence two read / write operations cannot be performed
    together, problem solved. Unless that gives you timing issues of course,
    waiting for one to finish, to write the other......but that's another whole
    can of worms.
    cheers
    Tim Price
    This e-mail, its content and any files transmitted with it are intended
    solely for the addressee(s) and are confidential and may be legally
    privileged. Access by any other party is unauthorised without the express
    prior written permission of the sender. If you have received this e-mail in
    error you may not copy, disclose to any third party or use the contents,
    attachments or information in any way.
    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Jeffrey W Percival
    Sent: 29 November 2001 21:12
    To: [email protected]
    Subject: Re: local variable cross-talk?
    Another useful reply! What a great news group this is.
    One last thing I wanted to ask about, though, is global vs. local. I see
    you talk about globals, but in fact the variables in my subVI's were locals.
    I can easily understand the behavior I observed accompanying the use of
    global variables, But I guess the use of the word "local" stumped me.
    Should I interpret "local" in LabVIEW's sense to mean "local to all
    instances of this VI"? And global to mean "visible to all instances of this
    VI as well as other VI's"?
    -Jeff
    Tim Price wrote:
    This facility is actually very useful, for instances where you want to
    encapsulate some code so that it can only run in one place at a time,
    i.e.
    global arrays that are written to in more than one place. This method
    can
    eradicate race conditions completely for example when used like this.
    There
    are multiple other uses as well.
    However, using a vi as a module of code, to run in more than one
    instance at
    a time simultaneously, re-entrant is the way to go. Just make sure you
    debug it first!!!
    Remember though, just because a vi may be re-eneterant, doesn't mean
    that
    everything inside is; sub-vi's, Globals etc. The classic one I've seen
    is
    where people think that a re-enterant vi is talking to it's own copy of
    any
    Globals used within it, i.e. counters etc., where in actual fact of
    course,
    they are all using the same Globals.
    Worth playing with a few examples to get familiar with it.
    Tim Price
    Jeffrey W Percival, Senior Scientist and Associate Director
    Space Astronomy Laboratory, University of Wisconsin - Madison
    1150 University Ave, Madison, WI 53706 USA
    608-262-8686 (fax 608-263-0361) [email protected]
    http://www.sal.wisc.edu/~jwp

    Tim Price wrote:
    Tim, thanks very much. I'll try the experiment you suggest.
    Thanks for taking the time.
    -Jeff
    Jeffrey W Percival, Senior Scientist and Associate Director
    Space Astronomy Laboratory, University of Wisconsin - Madison
    1150 University Ave, Madison, WI 53706 USA
    608-262-8686 (fax 608-263-0361) [email protected] http://www.sal.wisc.edu/~jwp

  • Are the read and write operations atomic for an array in a local variable.

    Hi,
    I would like to know when you access an array in a local variable, is it an atomic operation?
    Thanks,
    Mat

    Thanks for the comments. I agree with you. However, I my case, race conditions and synchronization are not issues. Therefore, the only thing that matters to me is that the write and read operation of the array must be atomic. I know that I can implement that with a LV2 style global but I want to avoid it if possible.
    If writing and reading to an array are atomic operations then I can simply use local or global variables.
    All I need to know is: Is reading or writing an array in a local variable an atomic operation?
    Thanks,
    Mat

  • How can I Change data in a type def control containing a Xcontrol with a local variable

    Hello
    I made a Xcontrol and I inserted this control in a type def.
    When I want to change the control's data with a local variable in a VI, the VI change nothing. The change of data isn't perform
    How can I correct this issue?
    Thanks for your help
    Solved!
    Go to Solution.

    Hello,
    What's your LabVIEW version ? Do you have a simple example program which demonstrates this behavior ?
    I found another discussions related to your issues with Xcontrols:
    updating type defs in Xcontrol Facade
    No Data Change event generated for a XControl in a Type Def
    XControl facede.vi 
    Hope this helps.
    Regards, 
    Steve M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Vidéo-t'chats de l'été : présentations techniques et ingénieurs pour répondre à vos questions

  • How come my local variable is not updating it's value with respect to what's happening in the while loop?

    Hello,
    I am trying to extract data out of a while loop as my declarations update with respect to the iteration number. I have attempted to use both local variables and shift registers, but with no luck.
    I have also done the following example: http://www.ni.com/white-paper/7585/en and it works like a charm.
    I attached the PNG file with local variable declaration circled in red. Will attach a VI in the next respnose.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Local Variable.png ‏366 KB

    OK, looking at the code...
    Can you explain what it is supposed to do? What's the purpose of the value property node read which only seems to update an indicator.
    The inner while loop should proably be a FOR loop, because the number of iterations is known before the loop starts.
    Your use of formula nodes seems overly complicated.
    LabVIEW Champion . Do more with less code and in less time .

  • Sampling local variable and synchroniz​e with DAQmx

    Hello, 
    I made a small change in the set-up I used with labview and now when I wanted to change the code I'm having a rather complicated problem.
    In my old set-up I was measuring three variables: x and y with a QPD and the power of a laser with a power detector. I was using the DAQmx and I was getting a matrix with three columns with n (sample rate) values. Now, for various reasons I had to take out the second detector. So now I want to build the same matrix as constructed before, but instead of putting the measured values of the laser power I want to put the theoretical values (they are in a local variable) as I cannot measure them. The problem is that this local variable, in general, changes during the DAQmx acquisition time and I would need to sample it at the same rate as I acquire the data from DAQ and then combine all them. How I could sample this variable and attach it to my DAQ results? DAQmx doesn't accept local variables.
    Thanks

    A local variable is not something standalone. It is always associated with a control or indicator. Hows is it updated?
    From your description, it is not clear what you are doing. Can you show us some code instead?
    (Also be more clear when using acronyms. QPD cound mean many things)
    LabVIEW Champion . Do more with less code and in less time .

  • Approval task SP09: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'

    Hi everyone,
    I just installed SP09 and i was testing the solution. And I found a problem with the approvals tasks.
    I configured a simple ROLE approval task for validate add event. And when the runtime executes the task, the dispatcher log shows a error:
    ERROR: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'
    And the notifications configured on approval task does not start either.
    The approval goes to the ToDO tab of the approver, but when approved, also the ROLE stays in "Pending" State.
    I downgraded the Runtime components to SP08 to test, and the approvals tasks works correctly.
    Has anyone passed trough this situation in SP09?
    I think there is an issue with the runtime components delivered with this initial package of SP09.
    Suggestions?

    Hi Kelvin,2016081
    The issue is caused by a program error in the Dispatcher component. A fix will be provided in Identity Management SP9 Patch 2 for the Runtime component. I expect the patch will be delivered within a week or two.
    For more info about the issue and the patch please refer to SAPNote 2016081.
    @Michael Penn - I might be able to assist if you provide the ticket number
    Cheers,
    Kristiyan
    IdM Development

Maybe you are looking for

  • PDF documents that cannot be edited in Reader for IOS

    Hello, I've been trying to edit (highlight and add comments) a PDF document on my iPad, but the app is not cooperating with me. I was able to edit it with Adobe Reader on my PC, but the same file cannot be edited with the ios app.  I tried some other

  • Acknowledgement of ACH Payments

    We are currently making non-tax ACH (CT) payments and are about to begin making tax payments via ACH (CCD+ TXP).  However, our Tax Dept. is hesitant because we can't provide them some kind of acknowledgement or proof that the payment was made and rec

  • Offline file availability

    I just bought a macbook pro which i will be using in a windows environment at work. We are running Microsoft Exchange Server 2003 which is not supported by Snow Leopard. I currently keep all my files on the server in a personal account which only I h

  • How to transfer iTunes library from iMac to macbook pro?

    i recently got a macbook pro but all of my music is on my imac. how do i transfer the music?

  • Hotkey Integratio​ns is silent install even possible?

    So I've been struggling with this for a few days. When deploying new computers. along with 20 other applications I aim to install 'Hotkey Integrations' both for t61, t500, t520, x230 and x240.. I use SCCM 2012. now the problem is attempting to unatte