Calculation optimization

Hi Experts
I have an Issue with the business rule ,running long time ,here is the case.
calculation is taking almost 2 hours to run and it needs to be optimized.
The maximum time it should take is 5 - 10 min to execute.
Please suggest me ASAP.

hi this is the macro
FIX("00011")
FIX("No SubLedger", "Amount")
/********* Get Actual Margin % ***********/
FIX(@RELATIVE("Existing FL",0))
FIX([parm1]:[Parm2])
"Margin %"(
IF("500000"->"AllSubLedger"->"Actual"->"Final"->&ACTYR==#MISSING OR
"500000"->"AllSubLedger"->"Actual"->"Final"->&ACTYR==0)
"Margin %"="Margin %"->"No SubLedger"->"No Management Entity"->"ActualJDE"->"Final"->&ACTYR;
"COGS"="500000"->"AllSubLedger" * (1 - "Margin %");
"Initial Margin"="500000"->"AllSubLedger" - "COGS";
ELSE
"Margin %"="Margin"->"AllSubLedger"->"Actual"->"Final"->&ACTYR /
"500000"->"AllSubLedger"->"Actual"->"Final"->&ACTYR;
"COGS"="500000"->"AllSubLedger" * (1 - "Margin %");
"Initial Margin"="500000"->"AllSubLedger" - "COGS";
ENDIF)
ENDFIX
FIX([parm3]:"Dec")
"Margin %"(
IF("500000"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT==#MISSING OR
"500000"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT==0)
"Margin %"="Margin %"->"No SubLedger"->"No Management Entity"->"ActualJDE"->"Final"->&PRIORYRACT;
"COGS"="500000"->"AllSubLedger" * (1 - "Margin %");
"Initial Margin"="500000"->"AllSubLedger" - "COGS";
ELSE
"Margin %"="Margin"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT /
"500000"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT;
"COGS"="500000"->"AllSubLedger" * (1 - "Margin %");
"Initial Margin"="500000"->"AllSubLedger" - "COGS";
ENDIF)
ENDFIX
ENDFIX
FIX(@RELATIVE("New FL",0))
FIX([parm1]:[Parm2])
"Margin %"="Margin %"->"No SubLedger"->"No Management Entity"->"ActualJDE"->"Final"->&ACTYR;
"COGS"="500000"->"AllSubLedger" * (1 - "Margin %");
"Initial Margin"="500000"->"AllSubLedger" -"COGS";
ENDFIX
FIX([parm3]:"Dec")
"Margin %"="Margin %"->"No SubLedger"->"No Management Entity"->"ActualJDE"->"Final"->&PRIORYRACT;
"COGS"="500000"->"AllSubLedger" * (1 - "Margin %");
"Initial Margin"="500000"->"AllSubLedger" -"COGS";
ENDFIX
ENDFIX
/************* Margin by Total Category ****************/
FIX([parm4]:"Dec")
AGG("ManagementEntity");
FIX("No Management Entity")
"Margin %"=("500000"->"AllSubLedger"->"FL" - "COGS"->"FL")/"500000"->"AllSubLedger"->"FL";
"Target Margin %"(
IF("Target Margin %"==#MISSING)
"Target Margin %"="Margin %";
ENDIF)
"Target Margin"="500000"->"AllSubLedger"->"FL" * "Target Margin %";
"Target COGS"="500000"->"AllSubLedger"->"FL" * (1 - "Target Margin %");
"Margin Improvement"="Target Margin" - "Initial Margin"->"FL";
"Improvement Rate %"="Margin Improvement" / "500000"->"AllSubLedger"->"FL";
ENDFIX
FIX(@RELATIVE("FL",0))
"New COGS"="COGS" - ("Improvement Rate %"->"No Management Entity" * "500000"->"AllSubLedger");
"New Margin"="500000"->"AllSubLedger" - "New COGS";
"New Margin %"="New Margin" / "500000"->"AllSubLedger";
"New COGS"(
IF("New Margin Override %">0)
"New COGS"="500000"->"AllSubLedger" * (1 - "New Margin Override %");
"New Margin"="500000"->"AllSubLedger" - "New COGS";
"New Margin %"="New Margin" / "500000"->"AllSubLedger";
ENDIF)
ENDFIX
AGG("ManagementEntity");
FIX("Margin Plug Store")
"611010.1000"="Target COGS"->"No Management Entity" - "New COGS"->"FL";
ENDFIX
AGG("ManagementEntity");
ENDFIX
ENDFIX
/******** Allocate to Category Level **********/
FIX(@RELATIVE("ProductCategory",0))
FIX(@RELATIVE("Existing FL",0))
FIX(@RELATIVE("610000",0), @RELATIVE("620000",0), @RELATIVE("630000",0), @RELATIVE("670000",0))
FIX([parm1]:[Parm2])
"Amount"(
IF("Amount"->"COS"->"AllSubLedger"->"Actual"->"Final"->&ACTYR==#MISSING OR "Amount"->"COS"->"AllSubLedger"->"Actual"->"Final"->&ACTYR==0)
"Amount"="Amount"->"New COGS"->"No SubLedger" * "Amount"->"No Management Entity"->"ActualJDE"->"Final"->&ACTYR;
ELSE
"Amount"="Amount"->"New COGS"->"No SubLedger" * ("Amount"->"Actual"->"Final"->&ACTYR
/"Amount"->"COS"->"AllSubLedger"->"Actual"->"Final"->&ACTYR);
ENDIF)
ENDFIX
FIX([Parm3]:"Dec")
"Amount"(
IF("Amount"->"COS"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT==#MISSING
OR "Amount"->"COS"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT==0)
"Amount"="Amount"->"New COGS"->"No SubLedger" *
"Amount"->"No Management Entity"->"ActualJDE"->"Final"->&PRIORYRACT;
ELSE
"Amount"="Amount"->"New COGS"->"No SubLedger" *
("Amount"->"Actual"->"Final"->&PRIORYRACT /"Amount"->"COS"->"AllSubLedger"->"Actual"->"Final"->&PRIORYRACT);
ENDIF)
ENDFIX
ENDFIX
FIX([parm4]:"Dec")
/* Shrink Rate*/
"640010"="500000"*"Shrink Rate %"->"BegBalance"->"No Management Entity";
ENDFIX
ENDFIX
FIX( @RELATIVE("New FL",0))
FIX(@RELATIVE("610000",0), @RELATIVE("620000",0),
@RELATIVE("630000",0), @RELATIVE("670000",0))
FIX([parm1]:[Parm2])
"Amount"="Amount"->"New COGS"->"No SubLedger" *
"Amount"->"No Management Entity"->"ActualJDE"->"Final"->&ACTYR;
ENDFIX
FIX([Parm3]:"Dec")
"Amount"="Amount"->"New COGS"->"No SubLedger" * "Amount"->"No Management Entity"->"ActualJDE"->"Final"->&PRIORYRACT;
ENDFIX
ENDFIX
FIX([parm4]:"Dec")
"640010"="500000"*"Shrink Rate %"->"BegBalance"->"No Management Entity";
ENDFIX
ENDFIX
ENDFIX
ENDFIX
CALC DIM("Account");
AGG("SubLedger","Company","ManagementEntity");
FIX([parm4]:"Dec","00011", "No SubLedger", "Amount", "No Management Entity")
"New Margin %"=("500000"->"AllSubLedger"->"FL" -
"COS"->"AllSubLedger"->"FL")/ "500000"->"AllSubLedger"->"FL";
ENDFIX

Similar Messages

  • Regarding calculation script optimization

    Hi,
    I have a gone through the calculation optimization in dbag.
    I have a calc script that needs to be optimized.
    So are there any particular ways that can be followed to optimize an calc script inoder to reduce the time taken to run.
    Thanks,
    Ram

    Hi,
    1. When you say , it needs optimized. Is it taking more time , or whats the issue.
    2. In addition to the standard recommendations in DBAG, you need to look your calculation script and which line of your script is taking time ( with the help of logs).
    3. NOt every standard recommendation would work , thats why consultants come handy.
    Sandeep Reddy Enti
    HCC
    http://hyperionconsultancy.com/

  • FIX on a UDA

    I am trying to FIX on a UDA for the 'Period' dimension. The UDA is defined as either 'open' or 'closed'. The dimension is re-built dynamically each night. When some periods are 'open' and others 'closed', this MAXL works. However, when all periods are 'open' - and there are not any 'closed' periods, the FIX statement doesn't operate as expected and the MaxL runs everything under the FIX. Very odd. Can anyone shed any light on this and offer their best work-a-round? Thxs.
    FIX (@UDA("Period", "closed"))
         CLEARDATA "Forecast";
         DATACOPY "Actual" TO "Forecast";
    ENDFIX;

    Hello There.
    Cameron:
    I should have been more clear in my original posting.
    The intent of the suggestion/alternative was from an "ease" of maintenance (and avoiding the "global fix" problem) perspective rather than a speed/performance one.
    Regarding the FIX on the sub vars you are absolutely correct -- it will not make it any faster -- but you could prevent the script from executing the statements within the FIX by using sub vars rather than UDAS (actually you could also create an "opposite" UDA like "open" and use AND/OR/NOT logic within the FIX signature itself if you didn't want to go down the sub var path for whatever reason). As you know the problem the user is having is when there are no UDAs on the members of the period dimension the statements within the FIX execute (older version of essbase and setting option not being available). I was simply stating that you could use sub vars to specify only those months (assuming months are the base level members of the period dimension) that you want the enclosed fix code to operate on -- of course you could/would need another sub var to specify the months to specifically exclude (e.g. &ActMonths, &FcstMonths) and possiibly AND/OR operator within the FIX statement itself if you like. The bottom line is you would make certain each member was always tagged with one of the two sub vars (again - could be done with udas) thereby allowing the script to only operate on those periods that it should. I just looked at the users second entry and it appears the second UDA and conditional route was taken.
    In my opinion, a single substitution variable that evaluates to 1 - 12 months (modified in one place - the sub var value-string itself) seems easier than manually or via load rule changing (potentially) up to 12 different period base level members -- once again assuming the base level members are indeed months.
    And yes you are correct - datacopy does not work within a conditional -- it would have to be accomplished through another means which I now see the user chose -- and yes you are also correct in that datacopy is very fast and would likely be the hands-down most efficient means.
    Gary:
    With regard to the "Golden Rule" statement -- it was not my intention to imply that it is a "always do this or perish" rule (although - admittedly - using the term "golden" probably made it appear quite the contrary) -- given the fact that rarely is anything always black/white when it comes to hyperion essbase, particularly in the realm of database calculation optimization. Nevertheless, someone should tell the numerous hyperion instructors/technical consultants (including Ed Roske as he has it clearly stated in his Look Smarter book) that I have worked with in the past. Thanks for the food for thought -- I sincerely appreciate it.
    Look Smarter excerpt: "...It is a good rule that can be used even more effectively..."
    Outdated/misguided logic below? You decide sports fans...
    In general, you should try and only use "FIX" statements on SPARSE dimensions.
    FIX statements allow you to take a slice of the database and only perform an action on that slice. If you fix on a SPARSE dimension, then you are limiting the amount of blocks that you are performing the action upon. If you FIX on a DENSE dimension, you are not limiting the number of blocks, but rather just a portion within each block. Using the FIX statement on a dense dimension can cause multiple passes through the same blocks which is very inefficient. On the other hand, the IF statement is well suited to DENSE dimensions because it performs IF logic while the block is in memory.
    Example: If JUL then ..., else .... will all be performed in one pass without the need of multiple passes through the blocks. In general, try and use FIX on sparse dimensions and IF on dense dimensions.
    Thank you both once again for your comments.
    Regards,
    todd rebner
    http://www.advancedepm.com/
    Edited by: todd rebner on Jun 7, 2009 10:32 AM

  • Optimize MRP material package calculation in parallel MRP

    Dear all,
    How to Optimize MRP material package calculation in parallel MRP?
    How and where can i see and change build up package for parallel  MRP  run?
    Thanks
    RAGHU

    Dear,
    Please run report program RMMDMONI
    Important point.
    -Materials
    -Runtime
    -Read situation
    Save result
    -MRP list
    In.Last page of MRP Spool. In the end of the spool, you can see
    how the WPs is used.
    Depending on the usage of WP, you need to think of packet size used for
    parallel planning.
    Also refer the OSS Note 568593 for details.
    Also please test BAdI MD_MRP_RUN_PARALLEL to set the package.
    OPP1 -> Business Add-Ins - > 'Package size in parallel planning contains detailed information about this topic.
    Hope clear to you.
    Regards,
    R.Brahmankar

  • Optimize calculation

    What are the ways to do Calculation script optimization?

    Alll your posts seem to follow the same idea, how to.... how to....
    Unfortunately you won't get much help with questions like that on here.
    You should spend some time reading the docs and formulating useful questions that will be worth answering.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Optimize calculation (Agg)

    I have a cube that is about 75 GB now. I am running a consolidation on this cube. the issue is Consolidation takes more than an HOUR to complete. I am trying to see if I could optimize and bring the time down. I played with Cache size and Data File size - it improved a little but not much. Any suggestions on how to go about optimizing the calc will be highly appreciated. Thanks
    Details ----
    Essbase - 7.1.5. in a 8 quad with 14 GB RAM machine. there are 6 other cubes running on the same box.
    2 with more than 50 GB in size.
    Direct I/O, LRE
    Index size - 3.5 GB
    Page Size - 75GB
    Index Cache - 300 MB
    Data File Cache - 650 MB
    Code format is as below -
    SET UPDATECALC OFF;
    set msg summary;
    set notice default;
    set cache high;
    set calchashtbl on;
    set aggmissg on;
    SET FRMLBOTTOMUP ON;
    SET CALCPARALLEL 3;
    FIX(&budgetYear, "CY Budget")
    agg (Sparse1,Sparse2,Sparse3,Sparse4,Sparse5,Sparse6 );
    ENDFIX

    Alll your posts seem to follow the same idea, how to.... how to....
    Unfortunately you won't get much help with questions like that on here.
    You should spend some time reading the docs and formulating useful questions that will be worth answering.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Which is faster -  Member formula or Calculation script?

    Hi,
    I have a very basic question, though I am not sure if there is a definite right or wrong answer.
    To keep the calculation scripts to a minimum, I have put all the calculations in member formula.
    Which is faster - Member formula or calculation scripts? Because, if i am not mistaken, FIX cannot be used in member formulas, so I need to resort to the use of IF, which is not index driven!
    Though in the calculation script,while aggregating members which have member formula, I have tried to FIX as many members as I can.
    What is the best way to optimize member formulas?
    I am using Hyperion Planning and Essbase 11.1.2.1.
    Thanks.

    Re the mostly "free" comment -- if the block is in memory (qualification #1), and the formula is within the block (qualification #2), the the expensive bit was reading the block off of the disk and expanding it into memory. Once that is done, I typically think of the dynamic calcs as free as the amount of data being moved about is very, very, very small. That goes out the window if the formula pulls lots of blocks to value and they get cycled in and out of the cache. Then they are not free and are potentially slower. And yes, I have personally shot myself in the foot with this -- I wrote a calc that did @PRIORS against a bunch of years. It was a dream when I pulled 10 cells. And then I found out that the client had reports that pulled 5,000. Performance when right down the drain at that point. That one was 100% my fault for not forcing the client to show me what they were reporting.
    I think your reference to stored formulas being 10-15% faster than calc script formulas deals with if the Formulas are executed from within the default calc. When the default Calc is used, it precompiles the formulas and handles many two pass calculations in a single pass. Perhaps that is what you are thinking of.^^^I guess that must be it. I think I remember you talking about this technique at one of your Kscope sessions and realizing that I had never tried that approach. Isn't there something funky about not being able to turn off the default calc if a user has calc access? I sort of thing so. I typically assing a ; to the default calc so it can't do anything.
    Regards,
    Cameron Lackpour

  • Which is faster - Member formula or Calculation scripts?

    Hi,
    I have a very basic question, though I am not sure if there is a definite right or wrong answer.
    To keep the calculation scripts to a minimum, I have put all the calculations in member formula.
    Which is faster - Member formula or calculation scripts? Because, if i am not mistaken, FIX cannot be used in member formulas, so I need to resort to the use of IF, which is not index driven!
    Though in the calculation script,while aggregating members which have member formula, I have tried to FIX as many members as I can.
    What is the best way to optimize member formulas?
    I am using Hyperion Planning and Essbase 11.1.2.1.
    Thanks.

    The idea that you can't reference a member formula in a FIX is false. Here's an example:
    - Assume you have an account that has a data storage of Stored or Never Share.
    - This account is called Account_A and it has a member formula of Account_B * Account_C;.
    - You would calculate this account within a FIX (inside of a business rule) something like this:
    FIX(whatever . . . )
    "Account_A";
    ENDFIX
    If you simply place the member named followed by a semi-colon within a business rule, the business rule will execute the code in the in that member's member formula.
    Why would you want to do this instead of just putting ALL of the logic inside the business rule? Perhaps that logic gets referenced in a LOT of different business rules, and you want to centralize the code in the outline? This way, if the logic changes, you only need to update it in one location. The downside to this is that it can make debugging a bit harder. When something doesn't work, you can find yourself searching for the code a bit.
    Most of my applications end up with a mix of member formulas and business rules. I find that performance isn't the main driving force behind where I put my code. (The performance difference is usually not that significant when you're talking about stored members.) What typically drives my decision is the organization of code and future maintenance. It's more art than science.
    Hope this helps,
    - Jake

  • Aggregation script is taking long time - need help on optimization

    Hi All,
    Currently we are working to build a BSO solution (version 11.1.2.2) for a customer where we are facing performance issue in aggregating the database. The most common activity of the solution will be to generate data on different scenario from Actual and Budget (Actual Vs Budget difference data in one scenario) and to be used for reporting purpose mainly.
    We are aggregating the data to top level using AGG command for Sparse dimensions. While doing this activity, we found that it is creating a lot of page files and thereby filling up the present physical memory of the drive (to the tune of 70GB). Moreover it is taking a long time to aggregate. The no. of stored members that is present are as follows:
    Dimension - Type - Stored member (Total members)
    Account - Dense- 1597 (1845)
    Period - Dense - 13 (19)
    Year - Sparse - 11 (12)
    Version - Sparse - 2 (2)
    CV - Sparse- 5 (6)
    Scenario - Sparse - 94 (102)
    EV - Sparse - 120 (122)
    FC - Sparse- 118 (121)
    CP - Sparse - 1887 (2049)
    M1 - Sparse - 4873 (4874)
    Entity - Sparse - 12020 (32349) - Includes two alternate hierarchies for rolling up the data
    The other properties are as follows:
    Index Cache - 152000
    Data File Cache - 32768
    Data cache - 153600
    ACR = 0.65
    We are using Buffered I/O
    The level 0 datafile is about 3 GB.( 2 year budget and 1 year 2 months Actuals data)
    Customer is going to use SmartView to retrieve the data and having Planning Plus License only. So could not go for an ASO solution. We could not reduce the members of huge Sparse dimensions M1 and CP as well. To improve the data retrieval time, we had to make upper level members as stored which resolved data retrieval issue
    I am seeking for help on the following:
    1. How can we optimize the time taken? Currently each dimension is taking about an hour to aggregate. Calc Dim is taking even longer time. Hence opted for AGG
    2. Will change of dense and sparse setting help our cause? ACR is ona lower side. Please note that most calculations are either on Period dimensions or FC. There is no such calculation on Account dimension
    3. Will change of a few non-level 0 members from store to dynamic-calc help? Will this slow down calculations in the cube?
    4. What should be the best performance order for this cube?
    Appreciate your help in these regard,
    Regards,
    Sukhamoy

    Please provide following  information
    1)  Block size  and other statistic
    2)  Aggreagation script
    >>Index Cache - 152000
    >>Data File Cache - 32768
    >>Data cache - 153600
    Try this settings
    Index Cache - 1120000
    Data cache - 3153600

  • Campaign Optimization using RFM Analysis

    I'm interested in the tools offered by BI for the <i>RFM Marketing Analysis</i> (Recency, Frequency, Monetary Value Analysis). I've read this information:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/bd493b13bab710e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_crm40/helpdata/en/d3/11b71b8182ed4995eaad3dc644c771/frameset.htm
    I understand that the all process needs a CRM deployment as well as BI. However I'm wondering if this kind of scenario can be implemented without a full CRM installation. In particular I'd need to use an Internet Sales - BI landscape.
    When calculating the Response Rate, I have to determine the <i>Addressed Business Partners</i>. One way to provide this data is using the ODS object <i>Campaign/Target Group/Business partner Assignements</i>
    (<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/36/df333bf1047532e10000000a114084/content.htm">0CRM_TGCT</a>). This object is filled by data from the CRM application. Is it possible to take data from Internet Sales instead?
    Otherwise, can you briefly explain the <b>Intelligent Web Analytics</b> feature of Internet Sales? I know it requires BI. How are the two application integrated?
    At http://www.sap.com/solutions/business-suite/crm/internetsales/featuresfunctions/index.epx I read:
    <i>Take advantage of a broad range of Web analytics that enable you to track online sales, capture customer behavior, analyze Web site metrics, and improve online sales performance.</i>
    What kind of <i>customer behavior</i> characterization is offered by these Web analytics?
    Cheers, Davide

    Prem
    The PP/DS Optimiser has quite a few restrictions associated with it, and can cause unpredictable results if any of these restrictions are met. See SAP Note 712066 for full details as I am not sure of the exact conditions you are trying to optimise. The key one may be:
    The campaign optimization is based on the bottleneck resources. There must be no direct or indirect time link (in the form of constraints or material dependencies) between the operations or orders that are planned on the bottleneck resources. In particular, bottleneck resources may be used only once in the production flow.
    Hope this helps
    Regards
    Ian

  • Calculation of Safety Stock and Reorder Point under Forecast Model T

    Hi Gurus!
    Happy Holiday!
    I would like to ask for your assistance on how the the safety stock and reorder point was calculated with the following values available. I would really appreciate it if you could give me details on the calculation.
    Below are the values:
    Basic data
    Forecast date        01.12.2009        Unit                  CTN
    Forecast model       T                 Service level         0.0
    Period indicator     M                 Paramtr profile
    Control data
    Initialization                                Tracking limit        4.000
    Model selection      A                 Procedure selection   2
    Parameter optimizatio                Optimization level    F
    Alpha factor         0,10               Beta factor           0,10
    Gamma factor       0,00              Delta factor          0,30
    Basic value           5.464-           Trend value          5.603-
    MAD                      4.758            Error total              4.722
    Safety stock         1                   Reorder pnt.          1
    No. of values
    Consumption           6                Forecast periods       1
    Initial. periods      0                Fixed periods          0
    Periods per season   12
    Historical data
    Period                Original     Corrected value
    11.2009                3.000              3.000
    10.2009                0.000              0.000
    09.2009                0.000              0.000
    08.2009                9.000              9.000
    07.2009               21.000             21.000
    06.2009               20.300             20.300
    Forecast results
    Period                Original     Corrected value
    12.2009                0.000              0.000
    Appreciate your assistance!
    Thank you and Happy Holidays!
    Ji

    Sweth, you are asking for consulting, and in my opinion it is way beyond what can or should be reasonable to achieve in such a forum. You are asking complex questions, that most probable have more than one possible answer.
    I suggest that you get on-site help from a knowledgeable and experienced consultant. These are crucial business issues, and should be dealt seriously.

  • How to Optimize SCXI 1600 for speed with Thermocouples

    I'm working on a data acquisition system for my engineering firm and I'm trying to find a way to use our new thermocouple system as fast as possible.
    The requirements for the DAQ process are:
    Read 32 voltage channels from a PCI-6071E card
    Read 32 thermocouple channels from a SCXI-1600 with an 1102C accessory
    Complete the entire operation in under 5ms (this is so other parts of the program can respond to the incoming data quickly and trigger safety protocols if necessary)
    Using LabVIEW 7.1 and MAX 4.4, I've got the voltage channels working to my satisfaction (with traditional DAQ VIs) and the rep rates I measure when I run the program are around 1ms (I do this by putting the DAQ code in a loop and reading the millisecond timer every time through that loop, then calculating the average time between loop executions).  I have been trying to get similar performance from the thermocouple channels using DAQ Assistant and DAQmx.  Some of the problems I've encountered are:
    Very slow rep rates with 1-sample and N-sample acquisition modes (300-500ms)
    Good rep rates when I switch to continuous mode, but then I get buffer overflow error -200279.
    When I attempted to correct that error by setting the DAQmx buffer to overwrite unread data and only read the most recent sample, the calculated sample rate went to 20ms.  It was around 8ms when I left the error unhandled and continued acquisition.
    At this point I'm out of ideas and am just looking for something to try and optimize the DAQ process for speed, as much as is possible.
    Thank you for any help.

    I guess I would be interested in checking out your code to see if there is anything I can recommend on changing.  However, I do have a few general Ideas of how to improve your performance.  These recommendations are purely based on what you could be doing to slow down the speed of the program because I am not sure how exactly you have everything set up.  
    -Are you setting up the task and closing the task each time that you read from your daq card?  the way to get around this is to only have the DAQmx read vi in the while loop so you do not have time alloted for opening and closing the task each time.
    -Try using a Producer/Consumer architecture.  This architecture uses queues and splits the aquisition with the post processing.  Here is a link to how to set up this architecture and some information on when to use it.
    Application Design Patterns: Producer/Consumer
    http://zone.ni.com/devzone/cda/tut/p/id/3023 
    Message Edited by Jordan F on 02-06-2009 04:35 PM
    Regards,
    Jordan F
    National Instruments

  • Optmization of calculation script Please help urgent

    hi all,
    I know three ways to tackle the block creation issue.
    1. Set CreateBlockon equation.
    2. try some data copy.
    3. calcualte a member via sparse dimension.
    I have a calc as shown below:
    Set CACHE HIGH;
    Set UPDATECALC OFF;
    SET AGGMISSG ON;
    FIX( @Relative("Entity",0),
         @Relative("Business Unit",0)
         @Relative("Branch",0),
         &CurScenario,
         &CurVersion,
         &CurYr,
         "M00",
         "P00000",
         "I000"
    FIX("AAAA")
    "DH" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    ENDFIX
    This is the third method that i mentioned above i am trying to apply to this calc that is calcualtion it via sparse dimesion as first 2 are not working good.
    "AAAAA" is dense dimesion member in accounts and rest every member is sparse.
    The member gross sales, External sales and MEU are all dynamic calc.
    This Calc run for 45 mins just to calculate one account and i have 4 accounts that need to be calculated by this in the same manner and i am trying to optimize this script so that i can reduce its run time.
    However i made another copy of this script in the following way:
    Set CACHE HIGH;
    Set UPDATECALC OFF;
    SET AGGMISSG ON;
    FIX( @Relative("Entity",0),
         @Relative("Business Unit",0)
         @Relative("Branch",0),
         &CurScenario,
         &CurVersion,
         &CurYr,
         "M00",
         "P00000",
         "I000"
    "DH"
    IF (@ISMBR("AAAAA"))
    @CALCMODE(BLOCK);
    @CALCMODE (Bottomup);
    "DH"= @Round((("Gross Sales"->"External Sales"->"MEU") * ("Freight In Percent"->"U000"->"D00000"->"B000"->"00")),2);
    ElSEIF (@ISMBR("BBBBB"))
    @CALCMODE(BLOCK);
    @CALCMODE (Bottomup);
         "DH"= @Round((("Gross Sales"->"External Sales"->"MEU") * ("Freight Out Percent"->"U000"->"D00000"->"B000"->"00")),2);
    ENDIF
    ENDFIX
    In th above version of the script it runs very fast but dont calculate any value :( for the account "AAAAA" & "BBBB"
    I have tried almost every way to do this and running short of ideas to optmize this.
    Is there any other way in which i can tackle the block creation issue or a way in which i can bring down the run time of this calculation
    Any suggestion regarding this would be great
    Thanks for help!
    Edited by: user4958421 on Jun 29, 2009 10:18 AM
    Edited by: user4958421 on Jun 29, 2009 10:18 AM

    For block creation issue:
    SET CREATEBLOCKONEQ equation will only work if the left side of an assignment statement is sparse.
    If the left side of an assignment is dense, you need to use SET CREATENONMISSINGBLK ON.
    For example:
    1.
    FIX("DH")
    SET CREATENONMISSINGBLK ON;
    "AAAAA" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    With the above, try to fix as little as possible. For example: do you really need to run the above
    formula for @Relative("Entity",0),@Relative("Business Unit",0), and @Relative("Branch",0)? Or
    actually the above formula is only needed for specific entity, business units and branch.
    2.
    FIX("AAAA")
    SET CREATEBLOCKONEQ ON;
    "DH" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    Another technique you can try:
    3.
    FIX("AAAA")
    "DH" = 0;
    "DH" = "Gross Sales"->"External sales"->"MEU" * "Freight Out Percent"->"U000"->"D00000"->"B000"->"00";
    ENDFIX
    And, you can also consider to change member "AAAA" to dynamic calc, and
    put the formula in the member. With this, you will not have calculation performance issue.
    If you use a calc like this:
    Sales (
    IF (@ISMBR(Jan))
    Sales=100;
    ENDIF)
    You do not need to repeat sales, so,
    it will be:
    Sales (
    IF (@ISMBR(Jan))
    100;
    ENDIF)

  • Are Cube organized materialized view with Year to Date calculated measure eligible for Query Rewrite

    Hi,
    Will appreciate if someone can help me with a question regarding Cube organized MV (OLAP).
    Does cube organized materialized view with calculated measures based on time series  Year to date, inception to date  eg.
    SUM(FCT_POSITION.BASE_REALIZED_PNL) OVER (HIERARCHY DIM_CALENDAR.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL DIM_CALENDAR."YEAR")
    are eligible for query rewrites or these are considered advanced for query rewrite purposes.
    I was hoping to find an example with YTD window function on physical fact dim tables  with optimizer rewriting it to Cube Org. MV but not much success.
    Thanks in advance

    I dont think this is possible.
    (My own reasoning)
    Part of the reason query rewrite works for base measures only (not calc measures in olap like ytd would be) is due to the fact that the data is staged in olap but its lineage is understandable via the olap cube mappings. That dependency/source identification is lost when we build calculated measures in olap and i think its almost impossible for optimizer to understand the finer points relating to an olap calculation defined via olap calculation (olap dml or olap expression) and also match it with the equivalent calculation using relational sql expression. The difficulty may be because both the olap ytd as well as relational ytd defined via sum() over (partition by ... order by ...) have many non-standard variations of the same calculation/definition. E.g: You can choose to use or choose not to use the option relating to IGNORE NULLs within the sql analytic function. OLAP defn may use NASKIP or NASKIP2.
    I tried to search for query rewrite solutions for Inventory stock based calculations (aggregation along time=last value along time) and see if olap cube with cube aggregation option set to "Last non-na hierarchical value" works as an alternative to relational calculation. My experience has been that its not possible. You can do it relationally or you can do it via olap but your application needs to be aware of each and make the appropriate backend sql/call. In such cases, you cannot make olap (aw/cubes/dimensions) appear magically behind the scenes to fulfill the query execution while appearing to work relationally.
    HTH
    Shankar

  • Problem with subtotal calculation in ALV reports

    Hi All,
       I am doing one program for calculating subtoals in ALV . For this i want to display subtotal text at each envey subtotal 's row.
    For that i have created one form 'SUB_SUBTOT_TEXT' and it has given to IT_EVENTS-FORM. But SUB_SUBTOT_TEXT Form is not called by IT_EVENTS event.
    what are all the mandatories for displaying subtotal text.
    Can any one please help me.
    Thanks in Advance.

    Hi Sree,
    *& Table declaration
    &----TABLES: ekko.&----
    *& Type pool declaration
    TYPE-POOLS: slis. " Type pool for ALV&----
    *& Selection screen
    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.&----
    *& Type declaration
    &----* Type declaration for internal table to store EKPO data
    TYPES: BEGIN OF x_data,
           ebeln  TYPE char30,  " Document no.
           ebelp  TYPE ebelp,   " Item no
           matnr  TYPE matnr,   " Material no
           matnr1 TYPE matnr,   " Material no
           werks  TYPE werks_d, " Plant
           werks1 TYPE werks_d, " Plant
           ntgew  TYPE entge,   " Net weight
           gewe   TYPE egewe,   " Unit of weight                          
           END OF x_data.&----
    *& Internal table declaration
    DATA:* Internal table to store EKPO data
      i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
    Internal table for storing field catalog information
      i_fieldcat TYPE slis_t_fieldcat_alv,
    Internal table for Top of Page info. in ALV Display
      i_alv_top_of_page TYPE slis_t_listheader,
    Internal table for ALV Display events
      i_events TYPE slis_t_event,
    Internal table for storing ALV sort information
      i_sort TYPE  slis_t_sortinfo_alv,
      i_event TYPE slis_t_event.&----
    *& Work area declaration
    &----DATA:
      wa_ekko TYPE x_data,
      wa_layout     TYPE slis_layout_alv,
      wa_events         TYPE slis_alv_event,
      wa_sort TYPE slis_sortinfo_alv.&----
    *& Constant declaration
    &----CONSTANTS:
       c_header   TYPE char1
                  VALUE 'H',                    "Header in ALV
       c_item     TYPE char1
                  VALUE 'S'.&----
    *& Start-of-selection event
    &----START-OF-SELECTION.* Select data from ekpo
      SELECT ebeln " Doc no
             ebelp " Item
             matnr " Material
             matnr " Material
             werks " Plant
             werks " Plant
             ntgew " Quantity
             gewei " Unit
             FROM ekpo
             INTO TABLE i_ekpo
             WHERE ebeln IN s_ebeln
             AND ntgew NE '0.00'.  IF sy-subrc = 0.
        SORT i_ekpo BY ebeln ebelp matnr .
      ENDIF.* To build the Page header
      PERFORM sub_build_header.* To prepare field catalog
      PERFORM sub_field_catalog.* Perform to populate the layout structure
      PERFORM sub_populate_layout.* Perform to populate the sort table.
      PERFORM sub_populate_sort.* Perform to populate ALV event
      PERFORM sub_get_event.END-OF-SELECTION.* Perform to display ALV report
      PERFORM sub_alv_report_display.
    *&      Form  sub_build_header
          To build the header
          No Parameter
    FORM sub_build_header .* Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.* Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.ENDFORM.                    " sub_build_header
    *&      Form  sub_field_catalog
          Build Field Catalog
          No Parameter
    FORM sub_field_catalog .*  Build Field Catalog
      PERFORM sub_fill_alv_field_catalog USING:     '01' '01' 'EBELN' 'I_EKPO' 'L'
         'Doc No'(003) ' ' ' ' ' ' ' ',     '01' '02' 'EBELP' 'I_EKPO' 'L'
         'Item No'(004) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR' 'I_EKPO' 'L'
         'Material No'(005) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR1' 'I_EKPO' 'L'
         'Material No'(005) ' ' ' ' ' ' ' ',
         '01' '04' 'WERKS' 'I_EKPO' 'L'
         'Plant'(006) 'X' 'X' ' ' ' ',     '01' '04' 'WERKS1' 'I_EKPO' 'L'
         'Plant'(006) ' ' ' ' ' ' ' ',     '01' '05' 'NTGEW' 'I_EKPO' 'R'
         'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM.                    " sub_field_catalog&----
    *&     Form  sub_fill_alv_field_catalog
    *&     For building Field Catalog
    *&     p_rowpos   Row position
    *&     p_colpos   Col position
    *&     p_fldnam   Fldname
    *&     p_tabnam   Tabname
    *&     p_justif   Justification
    *&     p_seltext  Seltext
    *&     p_out      no out
    *&     p_tech     Technical field
    *&     p_qfield   Quantity field
    *&     p_qtab     Quantity table
    FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                            p_colpos    TYPE sycucol
                                            p_fldnam    TYPE fieldname
                                            p_tabnam    TYPE tabname
                                            p_justif    TYPE char1
                                            p_seltext   TYPE dd03p-scrtext_l
                                            p_out       TYPE char1
                                            p_tech      TYPE char1
                                            p_qfield    TYPE slis_fieldname
                                            p_qtab      TYPE slis_tabname.* Local declaration for field catalog
      DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.  wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
      wa_lfl_fcat-col_pos        =  p_colpos.     "Column
      wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
      wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
      wa_lfl_fcat-just           =  p_justif.     "Screen Justified
      wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
      wa_lfl_fcat-no_out         =  p_out.        "No output
      wa_lfl_fcat-tech           =  p_tech.       "Technical field
      wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
      wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table  IF p_fldnam = 'NTGEW'.
        wa_lfl_fcat-do_sum  = 'X'.
      ENDIF.
      APPEND wa_lfl_fcat TO i_fieldcat.
      CLEAR wa_lfl_fcat.
    ENDFORM.                    " sub_fill_alv_field_catalog&----
    *&      Form  sub_populate_layout
          Populate ALV layout
          No Parameter
    FORM sub_populate_layout .  CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'." Optimization of Col widthENDFORM.                    " sub_populate_layout&----
    *&      Form  sub_populate_sort
          Populate ALV sort table
          No Parameter
    FORM sub_populate_sort .* Sort on material
      wa_sort-spos = '01' .
      wa_sort-fieldname = 'MATNR'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.* Sort on plant
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'WERKS'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    ENDFORM.                    " sub_populate_sort&----
    *&      Form  sub_get_event
          Get ALV grid event and pass the form name to subtotal_text
          event
          No Parameter
    FORM sub_get_event .
      CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
    'SUBTOTAL_TEXT'.  DATA: l_s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 4
        IMPORTING
          et_events       = i_event
        EXCEPTIONS
          list_type_wrong = 0
          OTHERS          = 0.* Subtotal
      READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.ENDFORM.                    " sub_get_event&----
    *&      Form  sub_alv_report_display
          For ALV Report Display
          No Parameter
    FORM sub_alv_report_display .
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .* This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort = i_sort
          it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
       MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.ENDFORM.                    " sub_alv_report_display&----
          FORM sub_alv_top_of_page
          Call ALV top of page
          No parameter
    ----FORM sub_alv_top_of_page.                                   "#EC CALLED* To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page&----
    *&      Form  subtotal_text
          Build subtotal text
          P_total  Total
          p_subtot_text Subtotal text info
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.* Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    ENDFORM.                    "subtotal_text
    Hopes its helpful.
    Regards,
    Raj.

Maybe you are looking for

  • Edit drop down list in SHD0(transaction variant)

    Hello all, How can we control the values displayed in drop doen list using transaction variant? i am using SHD0 to create a transaction variant and want only few values to be dispayed in drop down list instead of all the values in orignal transaction

  • Error while creating confirmation for a shopping cart

    Hi, i have created a sample fm and am passing sample values that i got by debugging the standard portal and badi(bbp_doc_change_badi) together, to create a confirmation. I am getting the following error in the process,while debugging, in the lt_messa

  • Audio with optical

    im trying to hook up my astro mixamp to my pc using an optical cable, the pc doesnt detect the cable meaning i cant get any sound out of it. about a year ago i upgraded my pc to a new case but kept the motherboard, processor and hard drive from a hpe

  • Query with condities

    Hi Iu2019ll try to make a query to get a material number with the price (condition). I use the tables KONP and A304, but I get no results. In table KONP Iu2019ve the condition record number and the amount; in table A304 Iu2019ve the condition record

  • ( customer expected price)

    Sap R/3 Customer expected price  formula 9 is used, with stastical l entry. system compares expected price of a line item with net price computed by system .if system net price is not with value range 0.05 customer expected price then item is blocked