Best way to write this calc?

All currents are RED.  All others are Sparse.   'Has' members accounts.  This works very well and runs quickly, but just wants to make sure that it is recommended, etc.  I tried to make ElseIf instead of opening of blocks every time, but it stopped working after all that 20th.  I am also uncertain on what block missing is correct.

SET AGGMISSG
UPDATECALC OFF SET;
SET CREATENONMISSINGBLK
SET CREATEBLOCKONEQ


Difficulty ({RTP_Scenario}, {RTP_Year}, 'Work', 'No_Location')

Difficulty ("TPD-90000", "PRJ-90001-LTVDS', 'No_Category')

("A-65000"
If (@ISMBR ("EC-OFFICESUPP") AND @ISMBR('Jan': 'Feb') AND @ISMBR ("TwoPlusTen") AND @ISMBR (& CurrFcstYr))
"A-65000"="A-65000"->"Pre real Alloc"->"Final"->"Total departments '->' locations '->' Total Categories '->' Total Total of charges Code."
Endif)

("A-65100"
If (@ISMBR ("EC-SHIPPING') AND @ISMBR ('"Jan ":" Feb"') AND @ISMBR ("TwoPlusTen") AND @ISMBR (& CurrFcstYr))
"A-65100'='A-65100"->"Pre real Alloc"->"Final"->"Total departments '->' locations '->' Total Categories '->' Total Total of loads Code";
Endif)

etc...

etc...

Two things you could try

1. put all Calc in a block unique member instead of each of them having its own

("A-65000"

If (@ISMBR ("EC-OFFICESUPP") AND @ISMBR('Jan': 'Feb') AND @ISMBR ("TwoPlusTen") AND @ISMBR (& CurrFcstYr))

'A-65000'='A-65000"->" Pre Alloc real '-> 'Final'-> 'Total departments'-> 'Total locations'-> 'Total categories'-> 'the Total expenses Code ";

Endif

If (@ISMBR ("EC-SHIPPING') AND @ISMBR ('"Jan ":" Feb"') AND @ISMBR ("TwoPlusTen") AND @ISMBR (& CurrFcstYr))
'A-65100'='A-65100"->" Pre Alloc real '-> 'Final'-> 'Total departments'-> 'Total locations'-> 'Total categories'-> 'the Total expenses Code ";
Endif

etc...

)

the way in which each block is visited once

2. If you want to be more weird to get rid of the if statements (if the statements are slow)

'A-65000'-> ='A-65000"->" Pre Alloc' real' Final '-> 'Total departments '->' locations '->' categories Total Total'-> "The Total expenses Code" / @ISMBR("EC-OFFICESUPP") / @ISMBR("Jan":"Feb") / @ISMBR (& CurrFcstYr);

@ismbr returns a 1 if the Member and 0 if it is not. whatever this is divided by 0 is #missing

Tags: Business Intelligence

Similar Questions

  • best way to write this query

    Hello

    I have a problem and I realized a simplified version of it:

     
    
    create table deals (id_prsn number, id_deal number, fragment number); 
    create table deal_values (id_prsn number, id_deal number, value_ number, date_ date); 
    
    insert into deals values(1,1,50); 
    insert into deals values(2,2,40); 
    insert into deals values(1,3,50); 
    insert into deals values(2,4,80); 
    insert into deals values(1,5,20); 
    insert into deals values(2,6,80); 
    
    insert into deal_values values(1,1,10 ,sysdate - 3); 
    insert into deal_values values(2,2,208, sysdate - 3); 
    insert into deal_values values(2,4,984, sysdate - 3); 
    insert into deal_values values(1,null,134,sysdate - 3); 
    insert into deal_values values(1,1,13, sysdate - 2); 
    insert into deal_values values(2,2,118, sysdate - 2); 
    insert into deal_values values(2,4,776, sysdate - 1); 
    insert into deal_values values(1,null,205,sysdate - 1); 
    insert into deal_values values(2,null,-5,sysdate - 1); 
    The id of the requirement to join these two tables based on:

    1.) ID_PRSN and ID_DEAL
    2.) max DATE_ grouped per person and deal
    (3.) in the case that ID_DEAL is defined in the AGREEMENTS, but not defined in the DEAL_VALUES table, I have to join this records to DEAL_VALUES based on the person where id_Deal is null.

    Number 3 gives me headache. I realized the following query:
     
    
    select *from ( 
    select a.id_prsn, 
           a.id_deal, 
           a.fragment, 
           b.value_, 
           b.date_, 
           max(b.date_) over (partition by b.id_prsn, b.id_deal) max_date 
      from deals a 
    inner join deal_values b 
        on a.id_deal = b.id_deal or b.id_deal is null 
       and not exists  (select 1 from deal_values 
                                  where id_prsn = a.id_prsn 
                                    and id_deal = a.id_deal) 
       and a.id_prsn = b.id_prsn 
    ) 
    where date_ = max_Date; 
    It returns the correct result of he,


    ID_PRSN ID_DEAL FRAGMENT VALUE_ DATE_ MAX_DATE
    1 1 50 13 16.10.2012 09:59:48 16.10.2012 09:59:48
    1 3 50 205 17.10.2012 09:59:48 17.10.2012 09:59:48 OK
    1 5 20 205 17.10.2012 09:59:48 17.10.2012 09:59:48 OK
    2 2 40 118 16.10.2012 09:59:48 16.10.2012 09:59:48
    2 4 80 776 17.10.2012 09:59:48 17.10.2012 09:59:48
    2 6 80-5 17.10.2012 09:59:48 17.10.2012 09:59:48 OK



    but the join clause:
     
    
    
        on a.id_deal = b.id_deal or b.id_deal is null 
       and not exists  (select 1 from deal_values 
                                  where id_prsn = a.id_prsn 
                                    and id_deal = a.id_deal) 
       and a.id_prsn = b.id_prsn 
    in fact the query much slower.

    I was wondering is there a different way to write this join and manage the logic.

    Thanks in advance

    Here's a different approach:

    select * from (
      select a.id_prsn, a.id_deal, a.fragment, B.value_, b.date_,
      ROW_NUMBER() over(
        partition by a.ID_PRSN, a.ID_DEAL
        order by B.ID_DEAL nulls last, B.DATE_ desc
      ) RN
      from DEALS a
      join DEAL_VALUES B
      on a.ID_PRSN = B.ID_PRSN and a.ID_DEAL = NVL(B.ID_DEAL, a.ID_DEAL)
    )
    where rn = 1
    order by 1, 2;
    

    "nulls last" is the default sort order; I just put that for clarity.

    Published by: stew Ashton on October 18, 2012 12:58

  • What is the best way to read this binary file?

    I wrote a program that acquires data from a card DAQmx and he writes on a binary file (attached file and photo). The data I'm acquisition comes 2.5ms, 8-channel / s for at least 5 seconds. What is the best way to read this binary file, knowing that:

    -I'll need it also on the graphic (after acquisition)

    -J' I need also to see these values and use them later in Matlab.

    I tried the 'chain of array to worksheet', but LabView goes out of memory (even if I don't use all 8 channels, but only 1).

    LabView 8.6

    I think that access to data is just as fast, what happens to a TDMS file which is an index generated in the TDMS file that says 'the byte positions xxxx data written yyyy' which is the only overload for TDMS files as far as I know.

    We never had issues with data storage. Data acquisition, analysis and storage with > 500 kech. / s, the questions you get are normally most of the time a result of bad programming styles.

    Tone

  • Can you help me? Is there a simpler way to write this short code?

    Hi, I'm quite new to coding and EDGE and think there must be a simpler way to write this? :

    sym.getSymbol("USA_animation").play ();

    sym.getSymbol("World_map").play ();

    sym.getComposition () .getStage ().getSymbol("UK_animation").$("UK").fadeOut ();

    sym.getComposition () .getStage ().getSymbol("UK_animation").$("Piechart").fadeOut ();

    sym.getComposition () .getStage ().getSymbol("UK_animation").$("people").fadeOut ();

    sym.getComposition () .getStage ().getSymbol("UK_animation").$("PeopleText").fadeOut ();

    sym.getComposition () .getStage ().getSymbol("UK_animation").$("UKText").fadeOut ();

    sym.getComposition () .getStage ().getSymbol("AUS_animation").$("AUSTRALIA").fadeOut ();

    sym.getComposition () .getStage ().getSymbol("USA_animation").$("USA").show ();

    sym.getComposition () .getStage ().getSymbol("USA_animation").$("USAText").show ();

    Can you help me?

    Obivious to increase efficiency is

    var USA_animation = sym.getSymbol ("USA_animation")

    USA_animation. Play();

    sym.getSymbol("World_map").play ();

    USA_animation.$("UK").fadeout ();

    USA_animation.$("PieChart").fadeout ();

    USA_animation.$("people"). fadeOut();

    USA_animation.$("PeopleText").fadeout ();

    USA_animation.$("UKText").fadeout ();

    USA_animation.$("AUSTRALI_A").fadeout ();

    USA_animation.$("USA"). Show();

    USA_animation.$("USAText"). Show();

    If you perform a single operation on all the symbols of the "USA_animation" child, you can also reduce somethinng as

    sym.getSymbol("World_map").play ();

    var USA_animation = sym.getSymbol ("USA_animation")

    USA_animation. Play();

    var childSymbols = USA_animation.getChildSymbols (); f

    for (var i = 0; i)

    childSymbols [i] .fadeOut ();

    I don't know if these are the best ways, but these are in a way that I could think of.

    Let us know if offer you a lot shorted way to write this

  • Better way to write this sql?

    Hi guru, I was able to get what I want, but I find there must be a better way/more efficient way to write this sql?

    Database: Oracle 11g

    This is the create for the test database statement:

    create table sample_test (prog_id number (9) DEFAULT 0 NOT NULL, chan_rights CHAR (2) DEFAULT ' ' NOT NULL)

    This is the insert statement:

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A1')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A2')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A3')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A4')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A5')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A6')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (555633, 'A7')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'A1')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'A2')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'A3')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'B1')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'B2')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'B3')

    INSERT INTO sample_test (prog_id, chan_rights) VALUES (495641, 'B4')

    Here's what I did to get the data:

    Select distinct a.prog_id, rt_cnt, CASE

    WHEN a.rt_cnt = 7

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = 'A1')

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = "A2")

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = "A3")

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = 'A4')

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = 'A5')

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = 'A6')

    and there are (select 'Y' b sample_test where a.prog_id = b.prog_id and b.chan_rights = 'A7')

    THEN "A_ONLY".

    else 'SINGLE '.

    end CHAN_GROUP

    from (select prog_id, count (chan_rights) rt_cnt

    of sample_test

    Prog_id group) a, b sample_test

    where a.prog_id = b.prog_id

    That appears as follows:

    PROG_ID RT_CNT CHAN_GROUP
    4956417UNIQUE
    5556337A_ONLY

    As seen:

    1 / I count how many rights is available, and in this case, each program gets a "7"

    Set 2 / from these data, for each programme, I try to make sure it belongs to the company chan_rights right, for example, "A_ONLY". Therefore, as shown, Prog_ID 495641 does not contain "A_ONLY" channels listed in the case statement and there is unique. "A_ONLY" should only contain A1 to A7 inclusive and nothing else.

    Can I create a function that returns the value "Chan_Group", but is there a better way to rewrite the statement 'BOX' like a LOOP or something? I have millions of records to go through and someone told me that using "is" slows down the database so just thought that I could ask ahead...

    Please indicate if there is a better and more efficient method to get what I need?

    Thank you

    John

    I would do something like

    select prog_id,
          rt_cnt,
          (case when rt_cnt = 7 and num_a = 7
                then 'A_ONLY'
                else 'UNIQUE'
            end) chan_group
      from (select prog_id,
                  count(chan_rights) rt_cnt,
                  sum( case when chan_rights in ('A1','A2','A3','A4','A5','A6','A7')
                            then 1
                            else 0
                        end ) num_a
              from sample_test
            group by prog_id)
    

    View of inline, I count the number of values chan_rights, as well as the number that are in your list of A1 - A7.  In the outer query, I implement the logic that checks that the two charges are 7.

    Here is an example of sqlfiddle this http://www.sqlfiddle.com/#! 4/95438/2

    Justin

  • AS3 on Flash CC - best way to write text on a curved path? to rotate the text?

    AS3 on Flash CC - best way to write text on a curved path? to rotate the text?

    you need to incorporate your policy.

  • I'm moving my files to workspaces to cloud.adobe.  What is the best way to achieve this?

    I'm moving my files to workspaces to cloud.adobe.  What is the best way to achieve this?

    Hi Traci,

    So big that you get ready for the transition to cloud.acrobat.com! Please see that the specified item was not found. For more detailed information on downloading your files.

    When you open a session workspaces, however, you will see a big red box at the bottom left. Click this box, and your files will be packed to the top for you. You will receive an email with the instructions when the packaged files are ready for you.

    Best,

    Sara

  • I have an After Effects project and I want to re-do edge animate. What is the best way work for this?

    I have an After Effects project and I want to re-do edge animate. What is the best way work for this?

    Hello

    Sorry, but you will probably need to rebuild everything in Animate. Although their timelines are similar in some ways, there is no interoperability between After Effects and animate dashboard.

    Kind regards

    Joe

  • Best way to film this scene, stitch together plates or green screen?

    I have a call where I walk past a player with him framed on the right of the screen, ' actor A. ' then on the shoulder 'Actor A' (on the left side of the screen) another character is in sight, "actor B." at the end of shooting the camera move to stop and I want at the speed of the actor 'A' of the ramp so that it revolves around very quickly While the 'B' actor maintains a normal speed (which is him walking toward the camera as well). Is the best way to do this shoot with two plates separate and assemble them (if if, what is the best way to assemble the shots)? Or is - this green screen actor 'A' or 'B' and add them in? Remember, the camera moves to the rear while the actor 'A' heading, when moving player 'B' is also in the shot. Ramp speed of the actor 'A' occurs once it stops (it will whisk around extremely fast), how the camera will also be stopped.

    You have a few options. Usually, I start a VFX shot by the thought of the movement of the camera. If I move the camera what are the problems that will result?

    According to your description, you have a dolly with two actors. Tracks camera, the first actor as the second player enters the scene, then the unit stops and the second actor continues to his notes at normal speed while the first actor is accelerating. Two shooting plates will give control the moment where the first actor, but, in view of the camera move, requires you to simulate accurately the moment where two follow-up plans so the point of view between actors is consistent. It doesn't matter if the photos are on a green background. For the view between the two actors to match the camera moves must be identical to the camera angle and the speed of follow up.

    If, however, you shoot all the action in a single pass while you can use rotoscoping to separate into two pieces shooting where the camera stops moving and then adjust the time where the first actor. This works easily if you make sure that you don't move the camera at all once the track ends.

    If the players do not overlap so the second option is a piece of cake because your roto can be a very simple rough mask. If the players overlap in the framework then your roto work will have to be very precise when the players overlap, and you may need to perform a few background replacement to fill in the holes.

    If you decide to do with two plates, then you will probably need to track movement. stabilisation and re-synchronization of two shots to make them at the height. If the camera is moving when you accelerate the first actor, you will have to keep track of movement.

    A final option is to pull the first actor on a green screen and the second player as a bottom plate and then follow and stabilize the two shots to try to combine them. Here again, if the speed and angle of the two plans that you combine are not identical or at least nearby enough that you can easily fix them you'll be in a lot of tweaking to than the shots work.

    If it were my project, I shoot the two actors in a single plug and then divided take it there where should be the first actor have the speed change and make a few roto work. That seems to be the most straightforward approach.

  • What is the best way to write freehand with InDesign?

    I have a Wacom and want to put some writing on my document - what is the best way to do this?

    Try a pencil or pen tools or do it in Photoshop and place.

    Bob

  • Best way to write the Pl/Sql

    Hi all
    Can someone say best written below stored proc:

    procedure missing_authorized_services is
    v_truncate_sql varchar2 (200);
    v_sql varchar2 (2000);
    BEGIN
    v_truncate_sql: = "truncate table missing_authorized_services;
    immediately run v_truncate_sql;
    commit;

    v_sql: = "INSERT into missing_authorized_services select distinct trim (service_group_Cd) as service_group_Cd, trim (service_cd) as stage_1_mg_service_request service_cd
    where (service_group_cd, service_cd) not in)
    Select distinct service_group_cd, stage_3_servcd_servgrp_dim service_cd)';

    immediately run v_sql;
    commit;

    END missing_authorized_services;


    / * I do select the table and then try to insert into another table the result set * /.

    Please help,
    Thank you
    J

    Hello

    The best way to write the PL/SQL (or any code) is by small steps.
    Start with a very simple procedure that does something (anything), just enough to make sure it works.
    Add a lot of statements of output so you can see what made the procedure. Don't forget to delete them after that trial is over.

    For example:

    CREATE OR REPLACE procedure missing_authorized_services IS
            v_truncate_sql  VARCHAR2 (200);
    BEGIN
         v_truncate_sql := 'truncate table missing_authorized_services';
         dbms_output.put_line (  v_truncate_sql
                        || ' = v_truncate_sql inside missing_authorized_services'
                        );
    END      missing_authorized_services;
    

    If you get any errors (for example, ORA-00955, because you try to give the same name to a procedure that you already use for a table), then fix the error and try again.
    When he worls perfectly, then add another baby step. For example, you can add the line

    EXECUTE IMMEDIATE v_truncate_sql;
    

    and test again.

    Do not use SQL dynamic (EXECUTE IMMEDIATE) unless you have to.
    Is there a reason to use dynamic SQL for INSERT statements?

  • I'll do a clean install on a blank hard drive upgrade but want to keep my Firefox settings - what is the best way to do this?

    I'll do an upgrade from Windows XP to Windows 7. I will be installing Windows 7 on a new empty hard drive. I want to keep my bookmarks Firefox and Ad Ons. What is the best way to do it. Thank you for your help.

    Hello

    The best thing for you to do is to make a backup of your Firefox profile. It is a folder that stores bookmarks and Add-ons that you can then add to the reinstalled Firefox on your new operating system.

    Learn you more about the Firefox profile folder, how to backup and restore, here.

    I hope this helps, but if not, please come back here and we can look at in another option for you.

  • I replace a website done previously before Page with a new site that I built in Dreamweaver, but wants to keep the URL address, what is the best way to achieve this?

    I replace a site is at the top with a new website that I'm building in Dreamweaver, but want to keep the same URL which is the best way to go about this?

    If you want to keep the same hosting provider, you have nothing to do. Just delete the old files of the site and download your new.

  • What is the best way to get this layout of the chapter?

    I have a document which is now a large flow of pages.

    However, there are "chapters, in this 'book'. A 'chapter' actually starts on the right page. But I want the left page to participate in the design of the spread of the beginning 'chapter '. This means that left before the start page real "chapter" is reserved in control of layout and all "chapter" before that would end on a left page, needs a right-hand page empty inserted, after which the left page of the early-'chapter' spread follows.

    Now, I can do the pages on the left of the start "chapter" start a section and to correct even a page number. That it is positioned on the left side. But when I add pages from the previous section, this means I have to change the page numbers of the beginning of all the sections that follow hand.

    Are there not a better way to do this? Somehow I don't have to worry about the numbering of the pages myself while still getting the page before the "chapter" included in the section of this "chapter"?

    (I write "chapter" because these aren't chpaters Id in an Id book, but a few sections in a single document Id).

    If the previous "chapter ends with a page of pairs (left hand), you add two pages, if it ends on the right add you a..

    Another way to do this automatically is to set an Option to keep on the paragraph style that you use for the first paragraph on the page at beginning of chapter, then it will start the section on the next odd-numbered page.

  • What is the best way to detect this text is part of the ContainerControllers without scrolling?

    Hello.

    Question

    What is the best way to detect that the text typed by the user (or added programmatically) exceeds the available space container and find where the truncated part begins? There are others (as described below) highlights the easy way to detect or to prohibit controllers to receive more characters that can be displayed in the area of publication given?

    My attempt partially (Simplified)

    For example, lets say I have a textflow editable with joints two instances of ContainerController.


    var flow:TextFlow = createSomeFlowFromGivenString(sampleText),
        firstController = new ContainerController(firstSprite, 100, 30),
        lastController = new ContainerController(secondSprite, 600, 30);
    
    
    flow.interactionManager = new EditManager(new UndoManager());
    flow.flowComposer.addController(firstController);
    flow.flowComposer.addController(lastController);
    
    flow.flowComposer.updateAllControllers();
    

    Vertical scroll policy enabled I can compare the height of the composition in the last controller with the height of the content:

    var bounds:Rectangle = lastController.getContentBounds(),
        overflow:Boolean =  lastController.compositionHeight < bounds.height;
    
    trace('Content does not fit into given area?', overflow)
    
    

    But when I change of vertical scroll policy off (lastController.verticalScrollPolicy = ScrollPolicy.OFF)-Unfortunately this does not work anymore... (In my case scroll must be disabled, since the text boxes can have only one line with narrow width)

    Use cases

    I want to create the form to fill out. Field can have one or more lines. A field could start in the middle of the page, continue in the following line, where it spreads throughout the page and put an end to the third line - long quarter of the width of the page. Text typed by the user may not exceed given the region since it could cover some static text that is located just after in below field.

    Something like ascii image below:

    --------------------------------------------
    |                <PAGE>                    |
    |                                          |
    |                                          |
    |                                          |
    |               [Field starts here........ |  
    | ........................................ |
    | ........................................ |
    | Ends here..]                             |
    |                                          |
    |                                          |
    | [Another field] xxxx  xxxx xxxxxxxx x xx |
    | xxxxxxxxxxxxxxxxxxx                      |
    |                                          |
    |                              [One more.. |
    | .....]                                   |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    --------------------------------------------
    

    Info:

     [......]  <-- form fields starts with '[' character, and ends with ']'
     xxx       <-- sample, static text
     | and _   <-- page borders
    

    If you want to detect the overflow in the final container, there is another thread discussed before.

    http://forums.Adobe.com/thread/795264

    You can detect it with lastContainerController.absoluteStart + lastContainerController.textLength «»<>

Maybe you are looking for