Using Dimension Formulas to sum data based on different criteria

Hi all,
I am trying to use a u201CDimension Formulau201D to perform the following calculation:
We have an account dimension which has 2 important properties:
1.     CRITERIUMTYPE: This property can have 3 different values: u201CWERKu201D, u201CINVu201D OR u201CLIQu201D
2.     ACCTYPE: This property can have 2 different values: u201CEXPu201D or u201CINCu201D
The client wants to have a report that sums data based on these 2 properties. An example will help to clarify this:
ACCOUNTS     CRITERIUMTYPE     ACCTYPE     VALUE
ACCOUNT A         WERK                          EXP               100 u20AC
ACCOUNT B         WERK                          INC               150 u20AC
ACCOUNT C         WERK                          EXP               200 u20AC
ACCOUNT D         WERK                          INC               300 u20AC
ACCOUNT E         INV                          EXP               50 u20AC
ACCOUNT F         INV                          INC               100 u20AC
ACCOUNT G         INV                          EXP               200 u20AC
ACCOUNT H         INV                          INC               500 u20AC
The clients wishes to see this data in the following way:
CRITERIUMTYPE     ACCTYPE     VALUE
   WERK                         EXP              300 u20AC
                                    INC              450 u20AC
   INV                         EXP              250 u20AC
                                 INC              600 u20AC
In order to achieve this I have created several new accounts, one for each combination e.g.: Account WERKEXP is used to sum the data on the combination CRITERIUMTYPE=WERK and ACCTYPE=EXP. I have created a dimension formula in my account dimension but this is where I am stuck. I have created the following formula to calculate the account WERKEXP:
IIF([BUDGETPOSITIE].CURRENTMEMBER.PROPERTIES("ACCTYPE")="EXP",IIF([BUDGETPOSITIE].CURRENTMEMBER.PROPERTIES("CRITERIUMTYPE")="WERK",[BUDGETPOSITIE].CURRENTMEMBER,0),0)
The problem with this formula is the following:
The formula will add all amounts that meet the 2 criteria mentioned in the formula, EXP and WERK, but as soon as it finds an accounts that does not match the 2 criteria it will set the account WERKEXP back to 0. I need to know if there is a way, using dimension formulas, of adding these values together without the new account being set to 0 as soon as one of the accounts it needs to check does not meet 1 of the 2 criteria.
We are working on SAP BPC 7.5 for NW with SP04
All help is very much appreciated!
Kind regards,
Stefano

Hi,
You can also use ParentHn property to have different grouping of accounts within the dimension.
So in your case rather using the member formula you can have four accounts and add them in the Parenthn property for grouping it.
1. The Solution proposed by Nilanjan is specific for a Report/IS and Performance will be good
2. My solution will be global something similar to MDX formula, but performance may be slightly lesser than using excel function.
Hope this helps,
Regards,
G.Vijaya Kumar

Similar Messages

  • Can i use one interface to load data into 2 different tables

    Hi Folks,
    Can i use one interface to load data into 2 different tables(same schema or different schemas) from one source table with same structure ?
    Please give me advice
    Thanks
    Raj
    Edited by: user11410176 on Oct 21, 2009 9:55 AM

    Hi Lucky,
    Thanks for your reply,
    What iam trying is ...Iam trying to load the data from legacy tables(3) into oracle staging tables.But i need to load the same source data into two staging tables(these staging tables are in two different schemas)
    can i load this source data into two staging tables by using single standard interface(some business logic is there)
    If i can then give me some suggestion how to do that
    Thanks in advance
    Raj

  • Using SQL Loader to insert data based on conditionally statements

    I would like to use sql loader to insert records from a single text file into an Oracle database table. Sounds easy but the problem is that I need to check the existence of data in another table (Table A) before data can be loaded into Table B.
    Table A has two columns: dept_no (primary key value) and dept_name (char)
    Table B has five columns: emp_no (primary key value), dept_no (foreign key value to Table A), employee (char), job_title (char) and salary (number)
    Text File looks like this:
    Finance Jones President 10000
    HR Smith Admin 2000
    HelpDesk Jenkins Technician 3000
    Problem:
    1. I need sql loader to insert records into Table B by first checking if the first field in the file is in Table A.
    2. If value exists get it's dept_no value.
    3. If value doesn't exist discard record ( I might want to have sql loader insert a new record for this into Table A)
    4. Using value from #2, insert the value in Table B for dept_no column.
    5. Also assign a sequence value for the emp_no value in Table B.
    Any guidance is greatly appreciated.
    Thanks,

    Hello,
    I am not sure this is possible with SQL loader. I would rather use an external table based on your file.
    Then, I would use SQL to load your data into your table, based on your conditions.
    Your request is not very complicated, writing the SQL to do that will be really more simple than trying to do it with SQL loader.
    Hope it will help.
    Regards,
    Sylvie

  • Extracting information from a table based on different criteria

    Post Author: shineysideup
    CA Forum: Formula
    Hi Folks
    I have a bit of a strange one here.
    I need to extract information from a single table based on different critera.
    Sounds simple enough but here's the tricky part.
    This table is a table that contains the build of a product. All the parts that are used to make the product and also the sub-parts that are used to make the primary product parts.
    Example:
    I have a part that is in the product and the part no is 1111. This part is actually part of another part that is part no 1112
    What I need to do is display part no 1111 with all of its details but then also show that it is also part of part no 1112.
    The way the table holds this information is as follows.
    Seq_No      Parent_Seq_No     Part_No
    The seq_no is item no that is given to the part number. If the part is a member of another part then there is also a parent_seq_no.
    Everything needs to tie back to the seq_no and the parent_seq no as the part itself can be used in a parent or it can be used on its own. This way you can actually have the same part appearing in the list several times but the seq_no will be different for each one. If the part can be used in two different sub-builds (with each part being used twice in each sub-build) and also on its own once then you would have 5 different seq_nos two parent_seq_nos.
    What I need to do is to list all of the parts but then also when a part is part of a parent_seq_no I need to be able to display the parent seqno but also the part_no for that as the parent would also be listed as an individual item in the part list.
    At the moment listing the part_no, seq_no and parent_seq_no is easy but when I try to list the part_no for the parent I jsut keep getting the original sub part again. I can do this with a sub-report but with what I need to do with the data after listing the parts a sub-report is not an option for me.
    This make sense?
    Thanks

    Post Author: Charliy
    CA Forum: Formula
    As long as the chain only goes one link deep, you should be able to Alias the table and link it (left outer)  from the child part to the parent part.  Then build a Detail B (or Group Footer if that's where you're printing) and conditionally suppress is if there is no "Parent Part".

  • How to calculate Average using Dimension Formulas  or Default Logic

    Hello
    I am trying to calculate the average without success. Do you know how I can Achieve the following? :
    We have multiple u201Cofficesu201D in the ENTITY dimension that fall under a Region. Let´s say 400+ offices under 20 Regions
    For example:
    Region1
       Office A
       Office B
    Region2
       Office C
       Office D
       Office E
    We have an Account named 'SalesUnits', and I am looking to get an Average Sales by Region and then be able to compare one Office against the Average of the REGION it belongs to.
    So If I have:
                                Sales Units
    Office C                   20
    Office D                   10
    Office E                   15
    Average of Region 2 would be 201015/3 =15
    But the number of office is variable, Sometimes I can have more offices.
    So I will have to count the number of offices that belongs to that region.
    I need this average so every office can compare their sales against the Region Average.
    Do you know how I can do this? I have tried some MDX syntax but without sucess.
    Thanks in advance!
    Anna

    Hi Anna,
      This will need to be done in Dimension logic as I assume, you;'d like to have the average up the region heirarchy.
    I'd suggest having 3 accounts for this
    ID .....................................FORMULA
    SALES_UNITS...................
    OFFICE_COUNT.................1
    UNITS_AVEREAGE............SALES_UNITS/OFFICE_COUNT
    The formula bit, goes in the formula column. When look at office count against the region heirarchy, it will sum up the 1's thereby giving you the denominator for the formula and you'll get the avereage up the region heirarchy.
    Tim

  • Can I use a formula to show data in a indesign file?

    I am wondering if it is possible to pull some data from within a file within indesign or illustrator.  I would like to create a shape filled with CMYK values and then was hoping to create a formula or script that would show the values of the shapes color build.  Is this possible if so how?

    DVD@cess works for all sorts of stuff- a link to a website, links to all sorts of files on the disc. It's very cool feature.
    One gotcha for PC's: there's a one time install of a little applet needed to be fully functional on a pc- otherwise you'd have to go to the root level of the dvd to open any files.

  • Using Excel Formula to Submit Data

    Has anyone tried this - In the data range of an ad-hoc view, build excel vlookups to retrieve data from an excel table and press submit? I tested this process and the data submitted and when refreshed, the ad-hoc grid returned the vlookup values and retained the vlookup formula. I did further testing by creating another ad-hoc grid in a different worksheet without any of the vlookup and the ad-hoc grid returned the correct value.
    Is what I described above a smartview functionality?
    Thanks,

    Because you have formula preservation turned on, the vlookup formulas will be retained and not refreshed with the Essbase values. If you turn off the retain formulas then after the submit, the Essbase values will be returned, but you will lose the vlookup formulas

  • Conditional Select  - How to retrieve data based on different cond.

    Hi
    I have a requirement to retrieve Equipments for Sales orders. But the selection criteria includes that if an Equipment with a EQTYp = 0 exists, only that record needs to be retrieved. And if no such equipment (Eqtyp = 0) exists, then retrieve any equipment from the Sales Order.
    I have for this reason selected a process as follows:
    First collect all sales orders, collect Equipments for them from SER02 and OBJK. And then look for a EQtyp = 0 equipment for each sales order line item. If no such one is found, then one of the other equipments is selected.
    As the report needs to be run open (without specifying any sales orders) at times, the amount of sales orders that are to be checked becomes huge and so retrieving the equipmets also becomes hectic in my current process.
    So, is there any other way to retrieve this information? or can a select be formulated in such a way that it can decide to pick a EQTYP <> 0  equipment when a EQTYP = 0 equipment is not found.
    Thanks in advance.
    Jr.
    Message was edited by:
            Jr Abaper

    Hi
      Is Equipment is an selection-screen field?
    If so give Equipment value = o and # in the selection-screen while executing?
    If that is not an selection-screen field in the select query in the where condition you can mention Equipment = 0 or
                             equipment # 0.
    This can optimize the code some what.
    Regards,
    Sreeram

  • Error while searching a customer based on different criterias

    Hi,
    I am working on Smart Service Manager 3.0 and came across an error recently.
    I have a customer screen which has the search functionality. Search can be done on various criterias such as Customer ID, Name ,Serial Number etc.
    When we are searching customer on the basis of serial no.
    Example L62560, Cp_12345 ,172, 461
    We are getting the below error
    No more storage space available for extending an internal table.
    Function is ZSYCLO_CRMMD_DOCUSTOMER_GET
    If anyone can suggest the cause and potential resolution of this issue.
    Thanks,
    Star
    Tags edited by: Michael Appleby

    Star,
    It sounds like there a lot of rows being build and causing an error within SAP and thrown to the Mobile Server.
    I would suggest looking at the log file to all the values being set with the bapi and then debug the bapi in the sap system to see if you find where it is erroring.
    Stephen

  • Dimension Formula versus Script Logic that runs on default

    Hi Experts,
    Which is better to use dimension formula or script logic that runs on default? We have a lot of dimension formulas and when noticed that it has a huge impact in the performance of our AppSet. When we try to remove them, the performance seems better. We we're thinking of transforming these dimension formulas into script logic which will run by default instead. Right now I'm hesitant with two things, 1.) Will there be improvement in performance if I all these formulas are run at default via script logic? 2.) The maintenance seems to be much more complex for the user if we use script logic.
    Thanks,
    Marvin

    Hi Marvin,
    Actually you pointed very well the advantage and disantavage regarding dimension formula.
    Dimension formula are executed into run time which means that value are not calculated. Of course this will have an impact regarding performances.
    Usually our recommendation is to use dimension formula just when yoiu have KPI's to calculate which will be very difficult to be implemented into SQL scrip logic or when you have very simple calculation like Account A = Account B+ Account C.
    For other calculation we advice our customer to use script logic.
    But attention:
    Default formula should not become very heavy because you will arrive into other issue with performances.
    When you will send data if default formula script will be heavy you will arrive into situation to wait may be minutes just to send one figure and of course this will be not acceptable for users.
    So you have to use script logic but you have to run into batch mode (schedule package) that script logic.
    Into default formula you have to keep just minimum (you have to calculate just figures which have importance for user imediat, real time).
    Also you have to be aware that moving dimension formula into scrip logic actually your fact table will grow a lot because the number of records generated will be probably 3-4 times bigger than number of records from fact table with dimension formula.
    Maintenance of script logic is more complex than dimension formula and you pointed very well this.
    So it is a balance and I tried o provide you suggestions or best practice when you have to use dimesnion formula and you have to avoid dimension formula.
    I hope this will help you to arrive to best combination for your application.
    Kind Regards
    Sorin Radulescu

  • Error in Dimension formula to find the average price

    Hi all,
    I have tried a dimension formula to find the average price of Product.
    if the product is a parent level member then average price should be the average of the list price,other wise it should be the list price itself.
    IIF([PRODUCT].CURRENTMEMBER.PROPERTIES("CALC")="N",[KEYFIGURES].[LISTPRICE],AVG(DESCENDANTS([PRODUCT].CURRENTMEMBER,[KEYFIGURES].[LISTPRICE],LEAVES)))
    While i tried the same i received some strange error , i don know whether its having some dependency on the Customer dimension. since K0030101 is a memebr belonging to CUSTOMER dimension.
    MDX statement error:"Value K0030101 for characteristic /CPMB/U6D7SXT un"
    I'm not sure whether its an error with  the formula i created or any dependancy issue or whether this scenario is possible  using  dimension formulas or not.
    Thanks in advance .
    Anila Mohan

    Hi everyone!
    We are using BPC 7.5 NW SP08 and we've had the same error message while adding a formula to the Account dimension:
    'MDX statement error: "Value 1 for characteristic /CPMB/S9D7Q23 un".
    We then checked in BW for /CPMB/S9D7Q23 and found out that it was the Product dimension.
    The solution for the issue was quite interesting. I had seen in another post that sometimes CALC property was not correctly determined for SP08. The solution proposed was to edit dimension members, clear ParentH1 column, process dimension, re-edit, paste back ParentH1 values and process dimension again. This corrected CALC property problem.
    It also worked for my case. After doing it to Product dimension I tried again to set the formula in Account dimension and it worked!!
    Hope this helps.
    Regards,
    Luigi Laporte

  • Dimension formulas+aggregate

    Hi gyus!
    Have i got it right, that members that was calculated using dimension formulas can't be aggregated in time dimension.
    for example
    Member P_ACC1 is calculated as PACC2*PACC3
    so
    ________  Q1    jan    feb   mar
    P_ACC1    81      9     9    9
    P_ACC2    9        3     3    3
    P_ACC3    9        3     3    3
    but i need smthng like this
    _________ Q1   jan    feb   mar
    P_ACC1    27      9     9    9
    P_ACC2    9        3     3    3
    P_ACC3    9        3     3    3
    is it possible to archieve it using dimension logic?
    Edited by: susersuser on Jan 25, 2011 9:31 AM

    Try using SOLVE_ORDER=0 in dimension formula for P_ACC1.
    Check the link http://help.sap.com/saphelp_bpc75_nw/helpdata/en/79/3643be0cec44cc819cf3c7e697b2b7/frameset.htm for more information on SOLVE_ORDER.

  • Use of SAP memory to transfer data between two different sessions.

    Hello experts,
    I wish to know how to use SAP memory to transfer data between two different sessions.
    The scenario is that when I run a report and change a variable, the value of changed variable should be availabe to another user on another terminal.
    Thanks & Regards!
    Sumit

    Hello,
    Just to add what Max has already mentioned. IMPORT TO / EXPORT FROM DATABASE statements can be used to store data in special "cluster" tables (you can't use any DDIC table) e.g., INDX.
    @OP: You can opt for Shared Memory(SHM) for this specific requirement as well. In my opinion SHM is a bit tricky to code, but it is easier to monitor. The opposite holds true for "data clusters".
    You should remember SHM is app-server specific. So if you've a load balancing scenario, using SHM can cause problems.
    Hope i'm clear.
    BR,
    Suhas
    Edited by: Suhas Saha on Nov 19, 2010 4:12 PM

  • Selecting data from two different tables.

    Do we need to use join two tables with primary/foreign key while trying to use select statement for getting data from those to table.? If no who can i go about do it.

    872959 wrote:
    If i am using From clause to get data from two different tables, is it necessary that both tables have column of identical data in them.In general, they ought to (or you need to join in a third table that tells you how to map rows from one table to rows of the other table).
    It is not strictly necessary that there be any join condition between tables. If you don't provide a join condition, Oracle has to do a Cartesian product. That means that if there are n rows in one table and m rows in the other, the result set will have n * m rows. It is very rarely a good idea to write queries that do Cartesian products but it does occasionally happen.
    Justin

  • MDX Dimension formula - sum using property

    Hi All,
    I am trying to add a dimension formula on the account dimension sheet and the goal is to add all the accounts that have a property TEST='Y' into a new account TESTACCOUNT
    Here is the formula that I am using but it errors out while processing.
    ID----
    FORMULA
    TESTACCOUNT----
    SUM([ACCOUNT].[H1].properties("TEST")="Y"),solve_order=10
    Can you please tell me where I am going wrong.
    Thanks in advance for your help.
    Swaroop
    Edited by: SwaroopLalam on Aug 13, 2009 4:18 PM
    Edited by: SwaroopLalam on Aug 13, 2009 4:19 PM

    Hi Petar,
    Thanks for your prompt reply. I tried the following and even that did not work. Am I doing something wrong here? Please see the error I received while processing the dimension;
    'sum(FILTER(descendants(ACCOUNT.[TESTACCOUNT],99,leaves),account.properties("TEST")="Y"),measures.periodic),solve_order=15
    ERROR:
      - [ACCOUNT].[H1].[#TESTACCOUNT] CustomRollupFormula([Account].[Account_H1_ID6].[TESTACCOUNT]) (1, 61) The 'Account' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.
    after that I gave the Heirarchy [H1], below;
    'sum(FILTER(descendants([ACCOUNT].[H1].[TESTACCOUNT],99,leaves),account.properties("TEST")="Y"),measures.periodic),solve_order=15
    ERROR:
      - [ACCOUNT].[H1].[#TESTACCOUNT] CustomRollupFormula([Account].[Account_H1_ID6].[TESTACCOUNT]) (1, 65) The 'Account' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.
    Thanks,
    Swaroop
    Edited by: SwaroopLalam on Aug 17, 2009 5:14 PM

Maybe you are looking for

  • How to Create a specific control?

    I have a Panel or a Container,,in which i place a list or any control..it should be such that when i place a list in the panel or container..it should start scrolling in a loop vertically...just like the way we see in News Feed...or another example i

  • Problems with a car adapter?

    I have an ipod nano along with 3 other members of my family who also have ipod nanos. We purchased an adapter for the car to listen to the music through the radio. The adapter we bought wasn't apple brand, but 3 of the ipods work fine with it. When I

  • Email wizard says "no accounts activated". How do I activate?

    I have just received my first Blackberry via amazon, and connected to my carrier O2 using the sim from my previous phone (PAYG), and my ISP BT Broadband on my home wi-fi.  When I try to send an email I get "No message services configured..."  when I

  • PCUI:Add REF_TO_HEADER to pcui(CRMD_BUS2000112) BILLPLAN TAB at item level

    Hi , We are trying to add Header billing plan check box REF_TO_HEADER (Billplan Tab) TO pcui application service contract'S(CRMD_BUS2000112) BILLPLAN TAB AT item level. 1.Append the structure CRMT_BSP_SRC_SERVICEDATA_2_IL  with REF_TO_HEADER field 2.

  • Infotype 207- creation help...

    Hello, I work for a client who operates in most of the states in USA. The issue we are facing is when creating the info type 207 there are different values with the same description. How can we accurately choose what the right value is For example: P