(Calculate Result via update rule) vs. (Calculate Result in a query)

Hi,
I got requirements to count number of people who sold the same product category in the same region.
I'm not sure if query could fullfill the following requirements or not.
<b>Example data in the ODS:</b>
for Period: 06/2005
People-A (region-M1) sold product category-C1.
People-A (region-M1) sold product category-C2.
People-B (region-M1) sold product category-C1.
People-B (region-M1) sold product category-C3.
People-C (region-M1) sold product category-C3.
People-D (region-M2) sold product category-C3.
In a report,
- user filter: Month/Year
- user filter: only one People at a time
- it should display all product categories.
I'm thinking to count number of people through an update rule and store the result directly in the ODS. I'm not quite sure whether this is a good idea or not.
Any suggestion would be sincerely appreciated.
Thanks much.
-WJ-

Hi Wachira,
We usually fulfill the "counting" reqts by adding a Counter KF to the InfoProvider (supply a constant of 1 in the transfer rules). Then in the query you can use exception aggregation for calculating different Count By...this is a more flexible approach.
Hope this helps...

Similar Messages

  • Record in DSO Active Table different from result of Update Rule Simulation

    Hi,
    I have a problem with the update of a particular Data Field for certain records via an Update Routine in 3.x Update Rules, from a Source DSO to one Target DSO.
    The DSO Key is the same in the Source DSO and the Target DSO. The Update Routine for the particular (target) Key Figure performs a calculation based on a number of COMM_STRUCTURE Data Fields and gives the Result. For this specific record, the Result being written to the target DSO is 0.00 (It is an 'Amount' Key Figure).
    Based on the Update Routine (which I have run through functionally), this is the incorrect result.
    However, I have run Simulation for this record and the correct result is simulated into the Data Target. I have also run the simulation with Debugging on the Update Rules. Each component/step of the Update Routine is processed correctly, eventually giving the correct result.
    I have tried to re-perform the load and I continually get the same result. This is occurring for a number of records being updated, but not all. Some records where the result of this Data Field is being calculated correctly are 'identical' in all important areas to the problem records.
    The problem records all appear to be in the same Data Package, however that Data Package also contains records being processed correctly.
    Based on the Simulation/Debugging it appears that the Update Routine is correct, however if anyone is willing to have a stab at this I am happy to send you the code.
    Also, a short time ago, we took a copy back from our Production system to our QA system. As a result, this record exists in the QA system as well. I have performed the load there and the record is processed correctly. The Production and QA systems are in line.
    Thanks and Regards,
    Tom

    Hi Ramesh,
    Thanks for posting a response. This is an Update Routine rather than a Start Routine.
    Also, in answer to the Sudhi's reply/post, Yes, the Update Type has been set to Overwrite.
    The problem is actually only present in Production.  Changes was made through our landscape some time ago (this is not my development).
    These changes have been tested through QA and were working. It is only when a reload has taken place in production that this issue has been occurred. A reload has then taken place in QA and has worked successfully.

  • Unit calculation at routine in update rule

    Hello,
    Can anybody explain me how to calculate unit in update rule routine.
    In update rule routine how to access infocube keyfigure like we access communication structure as comm_structure.
    Is there any sample code?
    Please help me out.
    Thanks,
    Regards,
    Steve

    Hi,
    You can find out the no of routines with standard Update rules.
    one of them is :
    <i>for 'Net weight in kilograms' 2LIS_13_VDITM-->0SD_C03</i>
    IF COMM_STRUCTURE-UNIT_OF_WT NE 'KG'.
        WEIGHT = COMM_STRUCTURE-GRS_WGT_DL.
        CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
             EXPORTING
                  INPUT                = COMM_STRUCTURE-GRS_WGT_DL
                  UNIT_IN              = COMM_STRUCTURE-UNIT_OF_WT
                  UNIT_OUT             = 'KG'
             IMPORTING
                  OUTPUT               = WEIGHT
             EXCEPTIONS
                  CONVERSION_NOT_FOUND = 1
                  DIVISION_BY_ZERO     = 2
                  INPUT_INVALID        = 3
                  OUTPUT_INVALID       = 4
                  OVERFLOW             = 5
                  TYPE_INVALID         = 6
                  UNITS_MISSING        = 7
                  UNIT_IN_NOT_FOUND    = 8
                  UNIT_OUT_NOT_FOUND   = 9
                  OTHERS               = 10.
        IF SY-SUBRC NE 0.
          CLEAR MONITOR.
          MONITOR-msgno = '009'.
          MONITOR-msgid = 'SDBW'.
          MONITOR-msgty = c_msgty_e.
          MONITOR-msgv1 = COMM_STRUCTURE-UNIT_OF_WT.
          append MONITOR.
          RETURNCODE = 4.
          WEIGHT = 0.
        ELSE.
          RESULT = WEIGHT.
          RETURNCODE = 0.
        ENDIF.
      ELSE.
        RESULT = COMM_STRUCTURE-GRS_WGT_DL.
        RETURNCODE = 0.
      ENDIF.
    With rgds,
    Anil Kumar Sharma .P

  • Copying of Update Rules

    Hi,
    I need to copy the update rules. Let me explain the requirement:
    The standard business content in SD provides the update rules from InfoSource 2LIS_12_VCHDR to InfoCube 0SD_C03.
    We have created an ODS (ZSD_O01) on the InfoSource 2LIS_12_VCHDR, with the one-to-one field mapping in the update rules.
    As a result, the update rules from ODS ZSD_O01 to InfoCube 0SD_C03 are exactly identical to the Business Content Update rules between the InfoSource 2LIS_12_VCHDR and InfoCube 0SD_C03.
    Can I copy (All) the update rules "between the InfoSource 2LIS_12_VCHDR and InfoCube 0SD_C03" and paste them for the update rules "from ODS ZSD_O01 to InfoCube 0SD_C03" ??.
    If you right-click on any individual update rule line (Go to Change Update rules), you see two options: 1. Copy Rule (F6), 2. Copy Update Rules (Ctrl + F12). What is the purpose of these two?
    Regards,
    Milind

    Hi,
    I hope update rules can be copied only if they are based on same Datasource.
    For example if you want to copy update rules for Cube1 to cube2 it can be done only if these two cubes are based on same ODS or Infosouce.
    Also check some of the similar thread..
    Copy update rules from one InfoSource to another one
    Copy Update Rules
    Regards,
    Prema

  • Cube has correct value that cucl. by update rule but Query value wrong

    I need to calculate number of working days.I created a KF and wrote a update rule to calculate number of working days. However cube has correct number of working days. In Bex, I am getting wrong answer. 
    How can I define a KF?
    currently In infoobj, Aggregation - SUM, Exc. AGGR - Firstvalue, Agg.ref.char - 0calmonth with Cumulative val
    Is that any wrong with this defn for KF?
    Do I need to create a char with this KF?
    Thanks,
    SKM

    It all depends on how data is stored in your cube.
    The Exception Aggregation( Exc. AGGR - Firstvalue, Agg.ref.char - 0calmonth ) which you have defined,would do the following :
    If you have loaded No of Working days /Month
    01.2006, 20
    02.2006,22
    03.2006,23
    And if you happen to create a report and either have a Higher Charact than 0CALMONTH or dont have 0CALMONTH, then it will display the FirstValue for the No of working days
    for eg. if i have CALYEAR /No of working days in my report, this would be the display
    2006, 20

  • Update Rule: DEC to NUMC (4) returning 0000

    Hi SDN,
    I have a DEC key figure in ods1 that I would like to load into a NUMC characteristic in ods2.  The NUMC is set to a length of 4, and the DEC values from ODS are always 4 digits long.
    I have created an update rule for the NUMC characteristic and set it to overwrite.  I am using a routine to load this infoobject.
    in my update rule i have:
    RESULT = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
    I am always getting 0000 returned as a result, even though there are DEC values (eg. 1234.000) in ZMYDECFIELD.  I'm assuming that a type conversion is not working correctly.
    I have also tried:
    date: tempNumc TYPE n LENGTH 4.
    *try conversion
    tempNumc = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
    RESULT = tempNumc.
    This also did not work.  Does anyone have any suggestions?
    Thanks!!

    Hi..
    Check your code:
    date: tempNumc TYPE n LENGTH 4.
    *try conversion
    tempNumc = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
    RESULT = tempNumc.
    Here the Variable TempNumc is of length 4.
    While assigning the value of DEC field it is transferring from Right to Left. So it is only copying 0000.
    You declare the Variable TempNumc with More LENGTH.
    date: tempNumc TYPE n LENGTH 20.
    *try conversion
    tempNumc = COMM_STRUCTURE-/BIC/ZMYDECFIELD.
    RESULT = tempNumc.
    Try this... It should work for u.
    Cheers.

  • Using result from an update rules in another

    Hello all,
    I have the problem that I have a very large update rule for the derivation of the sales division. This sales division is needed in another update rule for the derivation of the sales employee. As well as i know, it's not clear in which direction the updates rules are done so that I can't refer to the result of the update rule for the sales division. Can anybody tell me if there's a way to avoid to do this for a second time?
    Kind regards
       Anja Schlimme

    Hi Anja:
    Best Solution:
    Try to derive Sales Division & Sales Employee in Start Routine of Transfer Rule. Remember, here, you have to write good ABAP Code where you derive Sales Division and assign it to data_package-SALESDIVISION. Use this to derive Sales Employee.
    Better Solution:
    Try to derive Sales Division & Sales Employee in Start Routine of Update Rule. Remember, here, you have to write good ABAP Code where you derive Sales Division and assign it to data_package-SALESDIVISION. Use this to derive Sales Employee.
    Good Solution:
    You can derive Sales Division in Transfer Rule.
    Then, you can use this do derive Sales Employee in Update Rule.
    Ram Chamarthy.

  • How to calculate the runntime of a routine in an update rule

    I'm facing a performance problem with the loading of an ODS.  After some analysis I'm almost sure that the problem is due two routines (in the update rule) that are looking into master data tables 200.000 times ( quantity of records loaded every day).  But before moving that logic back into the extractor I need to be sure that the runntime will be reduced.  Is there any way to obtain the amount of time spent by those routines?.  I have been checking into the transactions ST03N and STAD but I'm not able to find this information.
    Thank you very much in advance.
    My best regards.
    Pablo Mazzucchi

    Hi,
    For performance problem you can try to get the look data in an internal table at start routine and use them and read for the fields you need which will help you in decreasing the run time vs hitting the database direclty for getting the look up information.
    This will bring you a noticable change in run time of data load.
    Lets wait if some other has routines to get run time of the routine
    Thanks,
    Arun.

  • Calculate Data Form - Business Rule

    I am a little confused on how the default "Calculate Data Form" business rule works which is available when we create a new data form.
    When run, does it calculate the entire cube as in it works like - CALC ALL; ? Or does it just calculate the dimensions/members specific to the form. I always thought that it is specific calculation for the data form - which considers the selection that we have in our POV, Page and rows and columns and it doesn't calculate the entire cube. Please correct me if I am wrong.
    If anyone has any resourse that has more about it, please share the link or information. It will be a big help.
    Please let me know.
    Thank you!
    ~ Adella

    Thank you so much John for responding to my question.
    So, if I understood it right you were telling me that it doesn't calculate the entire database, but it only calculates the subtotals for those specific member combinations that are there on the dataform and displays it on the form after the business rule is launched. Hope now I understood it right.
    Actually, I am running into an issue where I am just changing two cells on my dataform, then running the "Calculate Data Form" to see the totals changing accordingly but it is taking way too long than expected and also it is not rendering the right result. I am not sure what is causing this delay if it were only to calculate things specific to the data form and show the results.

  • Calculate factorial via powershell scripting

    hello guys i written script until calculate the factorial via powershell but i do not know what does not work !
    function factorial( [int] $n ) 
        $result = 1; 
        if ( $n -gt 1 ) 
            $result = $n * ( factorial ( $n - 1 ) ) 
        $result 
    this function can not work with big number like that 999 how can i solve that problem?

    I get similar results, with a slightly different function. I get results up to at least 170. From 180 through at least 990 I get "Infinity" for the answer. At 999 I get your error, which I believe cannot be avoided. Even if you avoided the
    call depth error, PowerShell seems to refuse to deal with such large numbers, and simply outputs "Infinity".
    This article goes into factorials in depth:http://en.wikipedia.org/wiki/Factorial
    It includes a table for very large values, plus a formula for approximating factorials of large numbers. You might be able to code the approximation formula.
    Richard Mueller - MVP Directory Services

  • I have an iPod touch, 3rd generation, and when I push the button to put it to sleep, my iPod takes a screen shot.  It's really annoying.  Is this a result from updating to iOS 4.3.3?  Also, my screen is EXTREMELY sensitive-breathe on it and it turns on.

    I have an iPod touch, 3rd generation, and when I push the button to put it to sleep, my iPod takes a screen shot.  It's really annoying.  Is this a result from updating to iOS 4.3.3?  Also, my screen is EXTREMELY sensitive—breathe on it and it turns on.

    - Are you also having problems with the Home button?  Maybe it is sticking a little since to take a screen shot you depress the Home and Power/Sleep buttons at the same time.
    - I have not seen your problem discussed here before.
    - I would first try resetting the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Next would be to restore the iPod via iTunes.  First from backup and if problem persists, restore to factory defaults/new iPod.

  • Crawl ifs using ultrasearch with results via portal

    I would like to be able to crawl ifs and have results via portal.
    The only thing I can find concerning making ultrasearch crawl ifs is this, http://otn.oracle.com/products/ultrasearch/htdocs/FAQ.html, which has the statement "you can crawl Oracle Files with Ultra Search through HTTP - it is just another web data source - or database crawling. However, only public documents can be crawled through HTTP."
    So, I set up a web datasource using the url to ifs login page.
    Does not work. Does anyone know how to do this? Is there a document I am missing?
    Thanks for any ideas.

    You are correct. This is what I found out:
    "Crawling of iFS is not supported in ultrasearch 9.0.2. It is a new feature of 9.0.4"
    HOWEVER:
    "ultrasearch 9.0.4 only runs with iAS 9.0.4 so you would have to upgrade both. According to my records these products have not been released yet and are due sometime later in the year."

  • I have a problem with my ipad when choosing software update it is continously loading the message checking for updates without showing any results

    I have a problem with my ipad when choosing software update it is continously loading the message checking for updates without showing any results  

    Hello SuzMiller
    Check out the article for the troubleshooting steps for issues with email on your iPhone and iPad.
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Rule to Calculate Average

    I need help writing a rule to calculate average units. I know the HFM admin documentation contains an Average Function, but my calculation needs to be a little different. I need to dynamically calculate average units based on the POV. Also, I need to always use "Beginning Units" in my calculation. I've listed some examples below...
    1.) Periodic AvgUnits for May 2008 = (Apr 08 Units + May 08 Units) / 2
    2.) QTD AvgUnits for May 2008 = (Mar 08 Units + Apr 08 Units + May 08 Units) / 3
    3.) YTD AvgUnits for May 2008 = (Dec 07 Units + Jan 08 Units + Feb 08 Units + Mar 08 Units + Apr 08 Units + May 08 Units) / 6
    Does anyone have any sugestions?
    Thanks,
    Clint

    You need to use 3 different formulas here are some examples, you can derive the quarterly from this two:
    Function Avg2(Acct)
    Avg2 = "(" & Acct & " + " & Acct & ".P#Prior) / 2"
    End Function
    Function AccumYTD(Acct,pov_period)
    AccumYTD = "(" & Acct
    Select Case pov_period
    Case 1
    AccumYTD = AccumYTD & " ) "
    Case 2
    AccumYTD = AccumYTD & " + " & Acct & ".P#CUR-1 ) "
    Case else
    For PastMonth = 1 to pov_period - 1
    AccumYTD = AccumYTD & " + " & Acct & ".P#CUR-" & PastMonth
    Next ' PastMonth
    AccumYTD = AccumYTD & " ) "
    End Select ' Case pov_period
    End Function

  • Send query's result via SMS (BW3.0b)

    Hi
    we need to send query's results via sms.
    We're going to use reporting agent (we configured an exception in bex and created a follow up action).
    Now I can only send a SAP office message.
    In order to send a sms, could you help me to understand which are the necessary configuration?
    It is enough configure adequately users?? Is any configuration on the system needed?
    Is any additional component needed? we're working on a BW 3.0B release.
    Thanks in advance for your cooperation.
    Regards,
    Stefania Iandolo

    Hi dear,
    look here to have more info about BEx Mobile Intelligence:
    http://help.sap.com/saphelp_bw30b/helpdata/en/f1/50583cf7388362e10000000a114084/frameset.htm
    Hope it helps!
    Bye,
    Roberto

Maybe you are looking for