Group by function in a measure object

Hi All,
    I am trying to create a measure in universe which is the sum of ticket amount group by country. like,
sum(Payments.Ticket_Amount) group by country name. When i place this measure in a report group footer it should display the sum to that particular group. But it is not working.
Could anybody help me how to write a group by function to create a measure.
Thanks,
swati.

Hi swati.
You don't need to write the GROUP BY statement at the universe level.
The universe knows that aggregate functions require group by statements and will group the aggregate measure objects by whatever dimension objects are included in the query. If you have a measure object that is not based on an aggregate but has a projection of Sum, it will only be aggregated at the report level once the data has been returned by the query.
Measure: sum(sales_fact.value)
Measure: sales_fact.price
Dimension: country_dim.country
This would generate SQL along the lines of:
SELECT sales_fact.price, country_dim.country, sum(sales_fact.value)
FROM sales_fact, country_dim
WHERE sales_fact.country_key = country_dim.country_key
GROUP BY sales_fact.price, country_dim.country
Hope that clears it up for you.
Regards,
Mark

Similar Messages

  • Drill function implemented on Measure object column in the webi report

    Post Author: madan kumar
    CA Forum: WebIntelligence Reporting
    Hi,
    I have a small issue in my project.(Maintenance Project)I created a measure object in the fact table of the existing universe and saved and exported to the repository. (Say Measure object is D where D = A-(B+C))I inserted the same object as a column between two measure objects columns of a existing WebI report.
    The report has two hierarchies involved  - each hierarchy has dimension objects involved.I have checked with the hierarchies to make sure that measure object is not involved.The scope of analysis is None for the query.Version is BO XI R2.
    The issue is the Drill function is implemented on that particular new column.The drill function should be applicable only to the two dimension objects involved in the report.But this measure object column is also getting drilled once the Drill option is selected.I had to remove the drill optiion from the Measure object column.
    Can anyone help me on this issue...
    Thanks in advance...
    Madan Kumar

    Sushil
    Thanks for your reply. I did the date diff on the columns. It does not  break into 3 different groups. I am using a function called previous on the date column. So the report is like this
        DATE                           Pervious (DATE)                 Date - Pervious(DATE)
    01-01-2008 01:06              Null                                
    01-01-2008 01:12              01-01-2008 01:06               :06
    01-01-2008 01:18              01-01-2008 01:12               :06
    01-01-2008 01:24              01-01-2008 01:18               :06
    01-01-2008 01:30             01-01-2008 01:24              :06
    01-01-2008 01:36             01-01-2008 01:30               :06
    Basically we are breaking on the Date - Previous ( Date) column which does not work. I am not sure if there is a way to break this. I even tried it in Crystal REports XI and it does not work their either. Any help with this issue with be greatly appriciated.
    Edited by: Srinivasa Prabu on Aug 4, 2008 2:55 PM
    Edited by: Srinivasa Prabu on Aug 4, 2008 2:56 PM

  • Partner function;Partner procedure; Partner object; Procedure assignment??

    Hi,
    If we check T-code: VOPA, we could find below:
    Partner function(Partner type inside);
    Partner procedure;Procedure details;Procedure assignment;
    Partner object(Customer Customer Master;Sales Document Header Sales Document Item..etc)
    Account Group;
    Anybody could explain clearly on above relations? Would be better if could attach an example by connecting to XD01 creating customer master data, especially the useage of Account Group.
    thank you very much!

    Let's take kinds of example like this..
    I went to an bookstore, bought an book and got the invoice. Then i paid the money, the book is deliveried to me.
    Analysis this business process:
    Partner type:
    I as an person who purchase goods, so i  should belong to partner type Customer.
    Bookstore sell goods, they should belong to partner type Vendor...
    Partner function:
    I as an customer but also play roles like pay the amount, receive the invoice..etc
    As an customer, i am function like an Sold-To Party.
    I pay the amount, then i function like an Payer.
    I receive the invoice , then i function like an Bill-to Party.
    Also i got the book from bookstore, then i founction like Ship-To Party.
    All above function belong category:Customer.
    So in SAP system, VOPA, i need first define corresponding partner function, and assign it to partner type.
    Partner object:
    Partner object is Customer master;Sales document Header,Sales document item..etc
    We define above mentioned Partner functions into corresponding partner object, also we need define Partner procedure and assing account group inside it, so as ?????
    Sorry, i think idont know what Partner procedure works? And why we need PArtner procedure??
    Seems partner procedure is related with Account Group...
    I remembered we had assign the Partner function to Account Group once, why we still need Partner procedure to Account Group again???? Coz inside PArtner procedure is partner function...
    And what imapct when we creating customer master data XD01 or processing sales order..Billing document...
    Hope could kindly help to clear my doubt......
    Thank you very much!

  • Functions applied to BW Objects in Designer

    Hi All,
    I have cubes in BW that I want to Query in Webi
    The structures appears in Designer, and the question is can I apply Functions to the Objects representing the structures?
    With Relational RDBMS, I can use SQL functions, but with BW Queries, I have a message telling me I need to do XML.
    Can I apply functions to the Measures and Dimensions and if yes waht kind of language?
    Many Thanksfor your answers
    Vince

    Hi,
    Since BOE XI3.0 we can create calculated measures in MDX. We also support Designer functions such as @Select, @Prompt and @Variable to enrich the objects definition.
    Olap universes use and generate XML and use MDX for calculated measures.
    I suggest that you have a look on the follwing URLs that give you help on how to cutomize OLAP universes:
    [Link 1|https://wiki.wdf.sap.corp/wiki/display/globalregions/OLAPUniverses-howtosamplesand+recommendations|]
    [Link 2|https://wiki.wdf.sap.corp/wiki/display/globalregions/OLAPuniversesonSAPNetweaverBW-Metadataanddatatypes]
    [Link 3|https://wiki.wdf.sap.corp/wiki/display/globalregions/SAP+Integration|Link 3]
    Didier

  • About report groups and read programs for the object EC_PCA_SUM

    Hi Friends,
    Hope every one is doing well..!
    I've an issue with the report groups and read programs for the object EC_PCA_SUM. As we know that the report groups and read programs available for this object in the application customizing are used to analys the archived data.
    That is these programs comes into picture after the archiving operation.
    For more information, you can visit the below web site:
    [http://help.sap.com/erp2005_ehp_03/helpdata/EN/e4/69f353b75a11d1b5850000e82debc6/frameset.htm]
    Now, my question is how would I check the code for these analysing programs available for this object. I can't see this in SE38.
    Thanks to reply for this..
    Full marks will be awarded.
    Regards,
    Shamim

    Hi Lakshman,
    Thanks for the reply.
    Hi Deiter,
    You're right.
    Your provided transaction "GR55" helped me to find out the program name for a particular group. However, these are just Write and Painter reports.
    But can you please let me know the functionality of these report groups ?? what are these used for ???
    Do we have these programs for other archiving objects like CO_ITEM,CO_ML_BEL,MM_MATBEL,CO_ORDER,
    PP_PLAN,PP_BKFLUSH ??
    More points will be awarded.
    Thanks a lot.
    Regards,
    Shamim
    Edited by: S H A M I M on Sep 19, 2008 3:19 PM

  • Function Groups and Function Modules

    Hi,
    Can anyone give me the detail steps for creating Function Group and then from that function group creation of function module with example?
    Regards,
    Chandru

    Hi,
    Function Group creation -
           A function group is a program that contains function modules. With each R/3 system, SAP supplies more than 5,000 pre-existing function groups.
         In total, they contain more than 30,000 function modules. If the functionality you require is not already covered by these SAP-supplied function modules, you can also create your own function groups and function modules.
          We can put all the relevant function modules under one function group and all the global variables can be declared in this FG.
    FG Creation:
    1)     Function group can be created in SE80. There choose the 'Function Group' from the list of objects.
    2)    Then give a name for ur function group (starts with Y or Z) and press ENTER.
    3)   The click 'YES' in the create object dialog box and give a short desc. for this FG and save.
    Function Module:
                 A function module is the last of the four main ABAP/4 modularization units. It is very similar to an external subroutine in these ways:
    Both exist within an external program.
    Both enable parameters to be passed and returned.
    Parameters can be passed by value, by value and result, or by reference.
    The major differences between function modules and external subroutines are the following:
    Function modules have a special screen used for defining parameters-parameters are not defined via ABAP/4 statements.
    tables work areas are not shared between the function module and the calling program.
    Different syntax is used to call a function module than to call a subroutine.
    Leaving a function module is accomplished via the raise statement instead of check, exit, or stop.
    A function module name has a practical minimum length of three characters and a maximum length of 30 characters. Customer function modules must begin with Y_ or Z_. The name of each function module is unique within the entire R/3 system.
    Defining Data within a Function Module
    Data definitions within function modules are similar to those of subroutines.
    Within a function module, use the data statement to define local variables that are reinitialized each time the function module is called. Use the statics statement to define local variables that are allocated the first time the function module is called. The value of a static variable is remembered between calls.
    Define parameters within the function module interface to create local definitions of variables that are passed into the function module and returned from it (see the next section).
    You cannot use the local statement within a function module. Instead, globalized interface parameters serve the same purpose. See the following section on defining global data to learn about local and global interface parameters.
    Defining the Function Module Interface
    To pass parameters to a function module, you must define a function module interface. The function module interface is the description of the parameters that are passed to and received from the function module. It is also simply known as the interface. In the remainder of this chapter, I will refer to the function module interface simply as the interface.
    To define parameters, you must go to one of two parameter definition screens:
    1) Import/Export Parameter Interface
    2) Table Parameters/Exceptions Interface
    Then in the FM interface screen, give the following
    1) Import parameters
    2) Export parameters
    3) Changing parameters
    Then give
    1) Define internal table parameters
    2) Document exceptions
    You enter the name of the parameter in the first column and the attributes of the parameter in the remaining columns. Enter one parameter per row.
    Import parameters are variables or field strings that contain values passed into the function module from the calling program. These values originate outside of the function module and they are imported into it.
    Export parameters are variables or field strings that contain values returned from the function module. These values originate within the function module and they are exported out of it.
    Changing parameters are variables or field strings that contain values that are passed into the function module, changed by the code within the function module, and then returned. These values originate outside the function module. They are passed into it, changed, and passed back.
    Table parameters are internal tables that are passed to the function module, changed within it, and returned. The internal tables must be defined in the calling program.
    An exception is a name for an error that occurs within a function module. Exceptions are described in detail in the following section.
    Syntax for the call function Statement
    The following is the syntax for the call function statement.
    call function 'F'
        [exporting   p1 = v1 ... ]
        [importing   p2 = v2 ... ]
        [changing    p3 = v3 ... ]
        [tables      p4 = it ... ]
        [exceptions  x1 = n [others = n]].
    where:
    F is the function module name.
    p1 through p4 are parameter names defined in the function module interface.
    v1 through v3 are variable or field string names defined within the calling program.
    it is an internal table defined within the calling program.
    n is any integer literal; n cannot be a variable.
    x1 is an exception name raised within the function module.
    The following points apply:
    All additions are optional.
    call function is a single statement. Do not place periods or commas after parameters or exception names.
    The function module name must be coded in uppercase. If it is coded in lowercase, the function will not be found and a short dump will result.
    Use the call function statement to transfer control to a function module and specify parameters. Figure 19.9 illustrates how parameters are passed to and received from the function module.
    sample FM
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = ' '
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
      IT_FIELDCAT                       =
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          =
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Example
    1  report ztx1905.
    2  parameters: op1 type i default 2,   "operand 1
    3              op2 type i default 3.   "operand 2
    4  data rslt type p decimals 2.        "result
    5
    6  call function 'Z_TX_DIV'
    7       exporting
    8            p1      = op1
    9            p2      = op2
    10      importing
    11           p3      = rslt.
    12
    13 write: / op1, '/', op2, '=', rslt.
    Regards,
    Shanthi.P
    Reward points if useful ****
    Edited by: shanthi ps on Jan 26, 2008 12:03 PM

  • Sum Distinct for a measure object

    Hi,
    Can anybody let me know how to go ahead and get a sum distinct for a particular measure object in a Universe?

    If your database supports the syntax, you can simply use SUM(DISTINCT table.measure_column) and it should apply the distinct function. Note, however, that this can result in under-reporting certain values. For example, assume you have two sales orders with the same amount: $100. As long as you include the order number (or primary key order_id or otherwise) you will get a total of $200. But if you remove order number, the sum(distinct) will see two equal values (both $100) and your total will only be $100 instead of the correct answer $200.
    What is the real problem you are trying to solve?

  • Functional location in Measuring Point and while creating M.plan or differe

    Hi,
    we found that functional location in Measuring point and M.plan functional location Measuring point are differrent, how to restrict that one ,we need automatically flow of functional location from measuring point to Maintenance plan.
    --Ganesh

    Hi,
    If you created the Measuring Point for the selected FL, then that measuring point will be populated automatically. If you have more than one measuring point, then you can select using Possible entries option.
    In this case, I think its not possible to restrict with configuration.
       IPRM0004 Maintenance plan / item: Customer check for time "SAVE"
    Use this user exit, while saving check for the functional location for the selected measuring point & give error message.
    Use tables IMPTT to get Object Number of FL. Use IFLOT to get the FL.
    Regards,
    Maheswaran.

  • Automatic assignment responsible group partner function of Activities

    Hi,
    I need help on below requirement>>
    Automatic assignment responsible group partner function of Activities when status is set to u201CIncorrectly Assignedu201D.
    Thanks

    you can check with order status badi
    BR
    Radek

  • Sort order for group by functions

    I have table TAB1(notenum number, linenum number, linetext varchar2(100)).
    Each note can have multiple lines of text. Eg data
    NOTENUM     LINENUM     LINETEXT
    1     1     THIS IS LINE1.
    1     2     THIS IS LINE2.
    2     1     THIS IS LINE1 OF NOTE2.
    2     2     THIS IS LINE2 OF NOTE2.
    I need the text of lines of the most recent note (max notenum)
    <Note>THIS IS LINE1 OF NOTE2. THIS IS LINE2 OF NOTE2</Note>.
    I have a query like this
    SELECT XMLAGG(XMLPARSE(CONTENT LINETEXT WELLFORMED))
    FROM TAB1
    GROUP BY NOTENUM
    ORDER BY NOTENUM DESC
    Above query would return the text of all lines concatenated for each note and the first row would be the one with highest notenum value.
    My problem is that concatenation of the LINETEXT should happen in ascending order of LINENUM. Since LINENUM is not in GROUP BY clause I cannot specify it in ORDER BY.
    How can I specify to XMLAGG (for that matter any group by function) to concatenate text in a specific order.
    I hope I was able to explain my problem clear enough for somebody to help.
    thanks for all the help
    Message was edited by:
    user448703
    Message was edited by:
    user448703

    Never mind. I just found out that XMLAGG function has the option to specify ORDER BY. I think that will work.

  • Group by function use in sql

    I want to get an output using group by function of there is no data in the table to display a particular value
    for eg:
    SELECT TRUNC(updated_date) DATE1 , COUNT(1) COUNT FROM table
    where TRUNC(updated_date) >=TRUNC(SYSDATE-18) AND TRUNC(updated_date) <=TRUNC(SYSDATE)
    GROUP BY TRUNC(updated_date)
    ORDER BY TRUNC(updated_date) DESC;
    DATE1 COUNT
    6/16/2012 14208
    6/15/2012 307825
    6/14/2012 172988
    6/6/2012 138790
    6/5/2012 167562
    6/4/2012 51870
    6/2/2012 130582
    6/1/2012 239806
    But i need the missed out date i.e 6/3/2012 - 0, 6/7/2012 - 0 to be displayed since there is no data on the repective dates.

    Hi,
    You can only display things that are in a table (or result set, but from now on, I'll just say table), or that can be derived from a table. If you want to display dates that are not in your table, then you have to get them from another table, or derive them from some table.
    Some people actually keep tables of possible dates for queries like this. In this case, all you need is a table of the last 19 dates, ending with today. That's easy to derive from dual:
    WITH     all_dates     AS
         SELECT     TRUNC (SYSDATE)     - LEVEL     AS date1
         ,     TRUNC (SYSDATE) + 1 - LEVEL     AS date2
         FROM     dual
         CONNECT BY     LEVEL <= 19
    SELECT    a.date1
    ,        COUNT (x.updated_date)     AS count
    FROM                all_dates     a
    LEFT OUTER JOIN    table_x     x  ON     x.updated_date     >= a.date1
                                AND     x.updated_date     <  a.date2
    GROUP BY  a.date1
    ORDER BY  a.date1
    ;If you'd care to post CREATE TABLE and INSERT statements for some sample data, and the results you want from that data, then I could test this.

  • How to create the change document functionality for a dependent objects?

    May I please know how to create the change document functionality for a dependent objects?
    I have done it follow the same process as for business process objects. But when i try to test it in BOBT, there is no records under "FIELD_CHANGE_WITH_FILTER". It seems the change hasn't been recorded.
    If the way I did to create change document for dependent object is correct, please also kindly advise the possibilities for why there is no record during testing.
    thanks in advance.

    I also have some doubts about the business object.In this case,one abstract BO hase a subnode wihich is root extended.I added the change document for this node under the category "root_extended" and then tested the function in BOBT.I got some error message "can't find the root key".Shall i redefine the method /BOFU/IF_CDO_CREATION~IS_CDO_CREATION_ACTIVE so as to solve the problem?
    Thx.

  • ADMT 3.2 Group Migration - Include File error: The object was not found in the domain

    Hello,
    I have been digging for weeks and still no answer. I am trying to migrate Group across two domains and if I select the group, it works just fine. But I want to bulk-migrate groups. So I am going the Include-File route. when ever I load the file I get
    the bulk of the groups processed but I get a dialogue box that states:
    The following objects are either not found or do not meet selection requirement. No migration will be performed on these objects.
    Then I get a list a group and the message states:
    The object was not found in the domain "contoso.com"
    Does any one know anything about this or how to fix it? I have compared the files with good/bad versions using ADSI edit and from its POV they look the same.

    Hi,
    Thanks for your post.
    There is an attribute named "showInAdvancedViewOnly" which specifies whether the object is to be visible in the "Advanced" mode of user interfaces. This is to say, if the schema attribute "ShowInAdvanceViewOnly" is set to TRUE for any security principal
    in AD, we would not be able to find that account or group while trying to migrate it except the simple ADUC search. Just as the issue you encountered.
    Therefore, please enable the "Advanced" mode in Active Directory Users and Computers, and then check if the three groups could be migrated or not.
    If anything unclear or you have any questions about this case, please feel free to let me know.
    Thanks and I look forward to your reply.
    Best regards,
    Ann Zhu

  • 5- 6 Measure Objects in A Single Query

    Hi Techies,
    I want to see the consolidated value of the measure object's of my universe,
    when I place my measure objects(6) in the single query, with a conditional object and wen I run the query I am seeing an error message as no data to retrieve.
    and If I take one measure object in each query I am able to see some data, is there any reason behind this ..
    can't I proceed with single query with all my measure objects in the same query rather than many data providers for each measure object.
    Please suggest me on this
    Thanks in advance .............

    All the measure objects are coming from single table only,
    and the conditional object means we have written some condition at universe level and these objects refer to another table and there is a necessary join between these two tables...

  • Sort order issue in with Evaluate function ( Next Quarter measure)

    Hi All,
    I have report requirement where I have to show measures for a particular geography for previous, current and next quarters in a pivotal view.
    ---------------Previous Quarter| Current Quarter|     Next Quarter
    Geography               
    ABC|xx|xx|xx
    PQR|xx|xx|xx
    XYZ|xx|xx|xx
    Next quarter values are displayed for other geography like
    ABC value is shown for XYZ and XYZ value is shown for PQR
    I have derived measure for pervious quarter using Time Series Function > Ago function,
    However the problem is with next quarter. I used following Evaluate Function to derive measure for next quarter.
    EVALUATE ('LEAD(%1,1) over (order by %2)' AS DOUBLE PRECISION , X, Y)
    Here X = Measure and Y = Level (Quarter)
    X is delta of two other measures A and B.
    X = (A- B)
    Thanks,
    SMA

    Hi user10300020,
    That's a fairly common problem with months that happens regardless of database source.
    In the logical layer of OBIEE you can specify the sort order on the month name column. Just double click on the month name column and look for the option to set sort order based on a different column. I typically sort the month name based on the month number.
    Give that a shot and tell me if it works.
    -Joe

Maybe you are looking for

  • New System Opinion?

    What do you guys think of this price? $1,445.00 × CAS: Apevia X-Supra Gaming Mid-Tower 420W Case CPU: Intel® Core2 i7-920 2.66 GHz 8M L3 Cache LGA1366 CD: LG 20X DVD±R/±RW + CD-R/RW DRIVE DUAL LAYER FAN Intel LGA1366 Certified CPU Fan & Heatsink HDD:

  • HT1206 can you have multiple itunes accounts one computer with seperate music library for multiple iphones?

    is it possible to seperate multiple itunes store accounts and music libraries on 1 computer for 2 iphones ?

  • Problems with Java and Business Objects

    <p>Hello everybody,<br /><br />I'm new in BusinessObjects/Crystal Report. Now, I have some problems with Business Objects for Java (Business Objects XI Release 2 Developer).</p><p> </p><p>1)  I create a report in the report designer. This report has

  • How do you identify when a report has finished?

    Hi all, I've got a big report that is taking a while to run (approx 1min) and the problem I'm having is that my users are getting bored of waiting and starting to click around my web application and re-running the report because they think it has fai

  • I can't select text with the mouse

    When I click anywhere in a text string the cursor automatically goes to the 'home' position. If I try to select text by scrolling across text with the mouse button down the cursor also returns to the 'home' position and no text is selected. Any ideas