Advanced Datagrid with average and sum at bottom

I have an xml file which has the following elements
<element>
     <price>12</price>
     <type>b</type>
     <name>name1</name>
</element>
I'l like to have a tree which is first sorted by name, and then by type. Then it should sum up and average all the prices of each of those elements which have the same type and name.
Any advice on how I can achieve this is highly appreciated.
thanks

Hi,
try this.
data w_cat type lvc_s_fcat,
t_cat type lvc_t_fcat.
w_cat-fieldname = 'CITYFROM'.
  w_cat-do_sum = 'X'
  APPEND w_cat TO t_cat.
  CLEAR w_cat.
CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
   i_buffer_active               =
   i_bypassing_buffer            =
   i_consistency_check           =
      i_structure_name              = 'FS'
   is_variant                    =
   i_save                        =
   i_default                     = 'X'
      is_layout                     = w_lay
   is_print                      =
   it_special_groups             =
   it_toolbar_excluding          =
   it_hyperlink                  =
   it_alv_graphics               =
   it_except_qinfo               =
   ir_salv_adapter               =
    CHANGING
      it_outtab                     = itab
      it_fieldcatalog               = t_cat
EXCEPTIONS
   invalid_parameter_combination = 1
   program_error                 = 2
   too_many_lines                = 3
   others                        = 4

Similar Messages

  • Help with count and sum query

    Hi I am using oracle 10g. Trying to aggregate duplicate count records. I have so far:
    SELECT 'ST' LEDGER,
    CASE
    WHEN c.Category = 'E' THEN 'Headcount Exempt'
    ELSE 'Headcount Non-Exempt'
    END
    ACCOUNTS,
    CASE WHEN a.COMPANY = 'ZEE' THEN 'OH' ELSE 'NA' END MARKET,
    'MARCH_12' AS PERIOD,
    COUNT (a.empl_id) head_count
    FROM essbase.employee_pubinfo a
    LEFT OUTER JOIN MMS_DIST_COPY b
    ON a.cost_ctr = TRIM (b.bu)
    INNER JOIN MMS_GL_PAY_GROUPS c
    ON a.pay_group = c.group_code
    WHERE a.employee_status IN ('A', 'L', 'P', 'S')
    AND FISCAL_YEAR = '2012'
    AND FISCAL_MONTH = 'MARCH'
    GROUP BY a.company,
    b.district,
    a.cost_ctr,
    c.category,
    a.fiscal_month,
    a.fiscal_year;
    which gives me same rows with different head_counts. I am trying to combine the same rows as a total (one record). Do I use a subquery?

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    user610131 wrote:
    ... which gives me same rows with different head_counts.If they have different head_counts, then the rows are not the same.
    I am trying to combine the same rows as a total (one record). Do I use a subquery?Maybe. It's more likely that you need a different GROUP BY clause, since the GROUP BY clause determines how many rows of output there will be. I'll be able to say more after you post the sample data, results, and explanation.
    You may want both a sub-query and a different GROUP BY clause. For example:
    WITH    got_group_by_columns     AS
         SELECT  a.empl_id
         ,     CASE
                        WHEN  c.category = 'E'
                  THEN  'Headcount Exempt'
                        ELSE  'Headcount Non-Exempt'
                END          AS accounts
         ,       CASE
                        WHEN a.company = 'ZEE'
                        THEN 'OH'
                        ELSE 'NA'
                END          AS market
         FROM              essbase.employee_pubinfo a
         LEFT OUTER JOIN  mms_dist_copy             b  ON   a.cost_ctr     = TRIM (b.bu)
         INNER JOIN       mms_gl_pay_groups        c  ON   a.pay_group      = c.group_code
         WHERE     a.employee_status     IN ('A', 'L', 'P', 'S')
         AND        fiscal_year           = '2012'
         AND        fiscal_month          = 'MARCH'
    SELECT    'ST'               AS ledger
    ,       accounts
    ,       market
    ,       'MARCH_12'          AS period
    ,       COUNT (empl_id)       AS head_count
    FROM       got_group_by_columns
    GROUP BY  accounts
    ,            market
    ;But that's just a wild guess.
    You said you wanted "Help with count and sum". I see the COUNT, but what do you want with SUM? No doubt this will be clearer after you post the sample data and results.
    Edited by: Frank Kulash on Apr 4, 2012 5:31 PM

  • (Advanced)DataGrid with selectable columns

    Hello -
    I'm trying to make a Flex (Advanced)DataGrid component with some mechanism where the user can toggle the visibility of the columns.  I've crudely implemented this by reading in the columns into the right-click menu, and when a column name is selected here, the visibility is toggled.  It works, but it's not the most elegant solution.
    Specifically, I'm trying to emulate the "datagrid" that Mozilla Thunderbird uses to display emails.  Here is an image:
    In the upper right, there is an icon over the scroll bar.  If there is no scrollbar, the icon remains in the same place.  When clicking the icon, it opens up a menu that shows all the possible columns, with the visible ones having a check mark next to them, like this:
    Also, the scroll bar always appears under this button, never "pushing" it over into it's own column.
    I'd like to re-create this in Flex.  I believe the menu part and creating a column with a button headerRendered is easy enough.  But I can't figure out how (if at all possible) to do this with the scrollbar, because the scrollbar always seems to be "its own column".  Any ideas or help would be appreciated.  Thank you.
      - Ian

    This blog post seems to answer your question:
    http://blog.flexgeek.in/2007/06/tips-tricks-adding-a-combobox-to-a-datagrid-header-as-head errenderer/
    http://omalraj.com/2009/06/flex-datagrid-header-with-a-combobox-filter/
    http://franto.com/custom-header-in-datagrid-part-2/
    http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • Datagrid with Horizontal and vertical header?

    Hi,
    I need to set a datagrid with a vertical and horizontal header, something like this:
    http://www.poirrier.be/~jean-etienne/info/csharp/datagrid-app.png
    But I need to be able to add labels to the vertical header cells too. Is there anyway to accomplish this with datagrid or advanced datagrid? I have been checking the docs without any luck.
    Thanks in advance,
    Aron.

    Hi!,
    Thanks a lot for the information Daiji (As allways). Anyway, this is not what I need. I think I did not provide all needed information.
    This grid I will show to the user must be editable. The user must be able to enter data for each row/col combination. I mainly need same funcionality as a datagrid but being able to add a vertical header column for the Y axis.
    Thanks in advance,
    HexDump.

  • Advanced datagrid with grouped columns and grouped rows

    hello every body, plz need your experience help. 'cause Im so new using FLEX
    I have an XML (like an XML data type) something like this
    <Table>
      <Rows>
        <cAgencia>F0002</cAgencia>
        <cAgNombre>SanBorja</cAgNombre>
        <cTVentanilla>V0002</cTVentanilla>
        <dTVNombre>Plataforma</dTVNombre>
        <TcksEnEspera>20</TcksEnEspera>
        <VentsEnAtencion>50</VentsEnAtencion>
      </Rows>
      <Rows>
         <cAgencia>F0003</cAgencia>
         <cAgNombre>Miraflores</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>30</TcksEnEspera>
         <VentsEnAtencion>40</VentsEnAtencion>
       </Rows>
      <Rows>
         <cAgencia>F0002</cAgencia>
         <cAgNombre>SanBorja</cAgNombre>
         <cTVentanilla>V0003</cTVentanilla>
         <dTVNombre>Caja</dTVNombre>
         <TcksEnEspera>55</TcksEnEspera>
         <VentsEnAtencion>25</VentsEnAtencion>
       </Rows>
       ...... (continue)
    </Table>
    so, I need to make a table (I guess with advancedDataGrid) something like this
    as you can see,   I have to group them by columns and Rows.  I have found a "mx:groupedColumns" that maybe could help me , but I couldn't find something like "mx:groupedRows".
    The grid may be dynamic,   for example if I have another XML node like:
      <Rows>
         <cAgencia>F0004</cAgencia>
         <cAgNombre>SanMiguel</cAgNombre>
         <cTVentanilla>V0002</cTVentanilla>
         <dTVNombre>Plataforma</dTVNombre>
         <TcksEnEspera>15</TcksEnEspera>
         <VentsEnAtencion>52</VentsEnAtencion>
       </Rows>
    the grid may add a ROW and in the column of plataforma add the data: 15 and 52, so the grid may be something like this:
    as you can see, the grid may add rows and columns in depends of the count of XML data.
    plz help.
    thanks, regards  from Lima, Peru.
    JS

    any help ????????? I found OLAPDataGrid .....   I was thinking to send all the data into a bidimensional Array , then pass the data of my bidimensionalArray to  OLAPDataGrid ...  but I'n not sure if Flex is able to do it  .... 
    the really serious problem is the special ROW I must use ...
    regards
    JS

  • Flex Advanced DataGrid with dynamic grouping

    Can we implement something similiar as in below link, using flex 3.
    http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/grouploadmodeclient/defaultcs.a spx
    I am not sure if flex 3 allows grouping of columns based on drag - drop component. Plus how to show the pictorial view of grouped columns, same as in the above example.
    Any help greatly appreciated.

    This blog post seems to answer your question:
    http://blog.flexgeek.in/2007/06/tips-tricks-adding-a-combobox-to-a-datagrid-header-as-head errenderer/
    http://omalraj.com/2009/06/flex-datagrid-header-with-a-combobox-filter/
    http://franto.com/custom-header-in-datagrid-part-2/
    http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • Advanced Feedback with Drag and Drop Interaction

    Hello,
    I am trying to create a drag and drop interaction that will blend in a "thumbs up" or a "smiley" after each dragable has been correctly placed. The dragables in my interaction are medical terms and the drop sources are smart shape boxes. Each drop source has been assigned one correct answer, so that when the correct answer has been dragged a "success caption" appears immediately. The opposite occurs with an incorrecty dragged term. I figured, I need a "code" that
    askes each dropable if it is the last one to be answered, and when answered correctly, will show the "smiley"
    checks if all other dragables have been placed correctly
    Since I lack the basic coding knowledge, I am having a hard time trying to figure this one out. Thanks for the help, again!
    -Nik

    Hi Jay,
    Yes, could create such a scenario, but the Submit button is not used in that case, because the feedback will appear immediately when a drag object has been placed on the target. Is that OK?
    Here the work flow:
    Besides the object, create all the feedback text containers that you need, correct and incorrect and label them so that they are easily recognizable. I labeled them FB_1, FB_2... because my objects were Drop1, Drop2...
    Make those feedbacks initially invisible and group them in Gr_FB
    Create the drag&drop in the normal way with one correct link
    Select the target and in the in the D&D panel, click on the Accept button, change the settings like this
    The advanced actions are pretty simple, standard, with two statements: Hide Gr_FB and Show FB_n  (with the appropriate feedback container - you cannot use Shared actions in this dialog).
    In the D&D panel, choose Infinite for the number of attempts and uncheck the Failure caption.
    Lilybiri

  • Select query with group and sum

    Friends I have a table which has a list of item that are sold in many provinces and their selling price.
    EMP_TABLE
    item_code
    item_desc
    item_province
    item_selling_price
    Now I want a query which a row containing
    distinct item code ,item desc,province ,sum of item_selling_price for Ontario,sum of item_selling_price for British Columbia,sum of item_selling_price for Quebec
    Can anyone please tell me how to do it.
    thx
    m

    Hello
    It's always usefull to provide some test data and create table scripts etc, but does this do what you're after?
    create table dt_test_t1
    (item_code                     varchar2(3),
    item_desc                    varchar2(10),
    item_province               varchar2(20),
    item_selling_price          number(3)
    ) tablespace av_datas;
    INSERT INTO dt_test_t1 VALUES('ABC','Item1','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item1','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item1','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item2','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item2','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item2','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item3','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item3','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item3','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item4','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item4','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item4','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item5','Province2',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item5','Province1',10);
    INSERT INTO dt_test_t1 VALUES('ABC','Item5','Province2',10);
    SQL> SELECT
      2     item_code,
      3     item_desc,
      4     SUM(DECODE(item_province,'Province1',item_selling_price,0)) province_1_total,
      5     SUM(DECODE(item_province,'Province2',item_selling_price,0)) province_2_total
      6  FROM
      7     dt_test_t1
      8  GROUP BY
      9     item_code,
    10     item_desc;
    ITE ITEM_DESC  PROVINCE_1_TOTAL PROVINCE_2_TOTAL
    ABC Item1                    10               20
    ABC Item2                    30                0
    ABC Item3                     0               30
    ABC Item4                    20               10
    ABC Item5                    10               20HTH
    David

  • Mx_internal_uid problem with advanced datagrid

    I have a XML structure like this:
    <Projekti ...attributes>
    <Tehtava ....attributes />
    <Tehtava ...attributes />
    </Projekti>
    <Projekti...>
    ...etc
    And I'm populating advanced datagrid with this hierarchial
    data, so I can get a tree view in datagrid where there is Projekti
    -nodes and inside them is the Tehtava-nodes.
    Problem:
    When I bind the XML, and the hierarchialdata (that is created
    from the XML) flex automatically adds
    <mx_internal_uid>a324235351514......</mx_internal_uid>
    -nodes inside of the Projekti-nodes. And this causes empty folders
    added in a tree view when user clicks them.
    Is there a simple way to:
    a) prevent thos uid-nodes being created?
    b) filter thos <mx_internal_uid>-nodes out from the
    dataprovider of the advanced datagrid?

    I know this is way after-the-fact, but I just ran into this problem myself today. I found that it generated the mx_internal_uid if the node I was selecting was an XMLList instead of XML. A simple cast fixed the problem.
    P.S. "And this causes empty folders added into a tree view when user clicks on them." makes perfect sense when you're using the XML inside a <mx:Tree>. As soon as you select the item (whether by clicking or programmatically), you get extra nodes in the tree.

  • Grouping issue on Advanced DataGrid

    Hello,
    I've got an advanced datagrid with 5 columns, The number_Group column has data like this...
    1-10
    1-10
    11-20
    11-20
    11-20
    21-30
    21-30
    21-30
    41-50
    101-110
    When I apply Grouping, it works as expected but the 101-110 group is displayed before the 11-20 group.
    I've tried to set groupingField.numeric = true but that screws it up even more... because 11-20 isn't a number I'm guessing.
    Does anyone know a way around this? I could change the number_Group column to this...
    1
    1
    11
    11
    21
    41
    101
    and groupingField.numeric = true should work but I need the Grouping display to show 1-10, 11-20. Perhaps I can intercept this and modify it?
    Anyone got any ideas?
    Thanks,
    Nick

    Hi, Nicky
    u can solve this problem by grouping function.
    u create ur dataprovider like
    private var myData:ArrayCollection = new  ArrayCollection([{data1:1, data2:10,......},
                                                                                         {data1:1, data2:21, ....}]);
    u declare the grouping function in following manner
    private function myGroupLabelFunction(item:Object, column:AdvancedDataGridColumn):String
    // here u write ur logice to formatting ur dispalying data in advance grid.
    //suppose ur labelfield of datagrid are data1,data2, data3 respectively.
    return item.data1+"-"+item.data2;
    if u do in this way i think it will work.
    if u sucess then give me mark.
    Thanks
    Niranjan

  • SortcompareFunction is not working properly for more than 1 column in advanced datagrid

    Hi Guys,
    I am using an advanced datagrid with groupingCollection.
    I have more than 1 grouped column. How ever I am using 2 sort compare function to sort date and time.
    The problem is when I am trying to sort date its workinf properly then when I jump to time column its not working and sorting few rows only inside the  column but not the entire column. samething happen when I sort time first and the date is not sorting.
    any help will be really appriciable .
    Thanks in advance.

    In our application we tend to use views to return appropriate values for a particular user.
    For example (we do building inspections) the publication item sql is like
    select * from inspection_sites where id in (select site_id from v_pda_bi_sites where bi_id=:bi_id)
    The view acts like a dynamic parameter table (in this cases looks at experience level, status of sites, and responsibility allocations). Once the driving views are tuned this works quite efficiently, and as the dependant tables for the publication item automatically includes all of the tables in the driving view, the object gets refreshed if there is any change to any of them, even if the site details themselves have not changed

  • Calculate Average and Maximum of KeyFigure values by Date.

    Hi Experts,
    There are certain KeyFigures such as CPU Utilization, Memory Allocated, etc in BEx Analyzer coming from InfoCube by Date (0CALDAY).
    The End-user is interested in looking at Average CPU Utilization / Day and Maximum CPU Utilization / Day as different Columns.
    I tried to change the configurations of these KeyFigures to Average and Maximum in the Back-end (BI ETL) but it is not working.
    We are working on BI 7.0.
    Could anyone please help with this?
    Your time is much appreciated. Points will be assigned.
    Thanks,
    Chandu

    Hi Chandra,
    I'm having the same issue, how did you solved this with a Formula in BEX?
    I need have one key figure with two behaviors average and sum, is it possible?
    Regards,
    Fernando

  • Advanced datagrid dropline

    I have used dragStart and dragDrop event in advanced datagrid for drag and drop row. While draging drop line show above the drop row. I need it will be below the drop row.
    Can any one help me?

    My answer to your other question is also applicable here. The dataField property can be accessed via the listData property of your renderer if your renderer implements the  IDropInListItemRenderer interface. You'll need to cast listData to AdvancedDataGridListData.

  • Pagination in Advanced Datagrid ..

    I need to use pagination for Flex advanced datagrid...how should i get the length of the groupingcollection for calculating my page size....
    For the Flex datagrid i have it working as I have the length of dataprovider which will be my page size....
    Any ideas...or can anyone post an example of advanced datagrid with pagination...Will be of great help...
    Thanks

    have a look @ this http://www.adobe.com/devnet/flex/articles/flashbuilder4_datapaging_php.html

  • DataGrid with multi-row headers

    Hello!
    How can I have a DataGrid with header and sub-headers so to speak.
    Something like this:
    [     Main Header     ]
    [ sub1] [sub2] [sub3]
    Thanks!

    There is a SplitDataGridColumn example on my blog
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

Maybe you are looking for

  • Hi; i created a poster from pages, how do i save it to have it printed by a photo lab?

    Hello; Can documents and posters with photos and text created in pages be printed by a photo lab, or is it only on my own printer?  I can save my document onto a USB flash drive, but then will the photo lab be able to open it to print? do you know ho

  • How Do You Change the Direction of an Effect?

    Hey everyone! I've been searching for a clear answer on this all over the web, and can't seem to find anything. I want to change the starting direction of a title effect - Motion Blur Left specifically, so that it goes from the left side of the scree

  • Help ios 5.0.1

    i try to update my 3gs with over the air but it give me error i try reset  home and power for 30 sec but noth anyone seen this bft

  • Upgrade basic phones

    Hi all~ We have an old Nationwide plan, 1400 minutes of talk, 3 basic phones 1 smart phone with 2GB of data. I would like to upgrade two of the basic phones but we don't qualify for upgrades until 10/2015. I don't like the Edge program, we aren't int

  • Hola... Ayudenme mi mac arranca con un signo de interrogación

    cuando mi mac arranca aparece una carpeta y un signo de interrogación por encima, la prendo con command y R me conecto a wi-fi e inicia la recuperación de datos pero mi internet es lento y se cancela muy rápido (también la enciendo option) Díganme co