Iterate single Column in a Datagrid

How to iterate single column of datagrid using flex3.
i want to iterate only one column.for eg  say column-5.
and sum of all the data in col-5.

Here is an example for enumerating the datagrid.  You can easily change it to do selected items instead.  You could also access the dataprovider source directly vs going through datagrid.
//Summary function
protected function UpdateTotal():void
   var fRunningTotal:Number = 0.0;
   var nNodeCount:int = 0;
   //Check if the dataprovider is empty.
   if (dgMyDatagrid.dataProviderLength == 0)
      //Nothing to total, return out.
      return;
   //Loop through all the nodes
   for (nCount = 0; nCount < dgMyDatagrid.dataProviderLength; nCount++)
       //At the current row in the dataprovider convert the 5th object (0 index = start).
       //Add to the running total.
       //If the dataprovider is an XMLListCollection you could address it by name.
       fRunningTotal += Number(dgMyDatagrid.dataProvider.getItemAt(nCount)[4])
   //Do something with the total here... like store it for displaying in a label.

Similar Messages

  • Bargraph,icon and a numeric value, together in a single column of advance datagrid

    Hiii,
    I am trying to embed an icon, a bargraph with two values and a numeric value in a single column of advance datagrid. can anybody help me out in giving a solution for this...I have read a  blog where the code explains about the bargraph in advance datagrid, I want to embed numeric value and icon too including bargraph in the column. I am looking for a Bargraph which  takes two values
    In the above image, the graph and rate is shown in a separate column , I require graph to be shown along with the numeric value and a icon in a single column.
    The blog which i refered and got the above output is placed below, it can be used for the reference.
    http://symmetri.blogsome.com/2009/05/22/render-a-bar-graph-within-a-datagrid/

    RVR,
    This is a great exercise to get familiar with LabVIEW's array functions.  A great place to start is actually the LabVIEW help on arrays, located here:
    http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/grouping_data_with/
    Depending on your data format, you can probably use the Read From Spreadsheet File VI to bring your data into a 2-d array.  You could then use the index array VI to pull your column out.  You could do this in a For loop and use Autoindexing to build your 1,000 column resulting array.  I would leave everything as a String format until I'm done. 
    This doesn't sound like a very difficult task.  Good luck!
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • Removing header, border for only single column in mx:DataGrid

    Hi,
        I am using Flex4 SDK and FlashBuilder4.
    I have a requirement where i need to remove column header, borders and grid lines for only last column in datagrid.
    It should look like there is no column present. This column will be used to show some icon for only selected row.
        Can any one suggest how to implement this. Please provide any sample if you can.
    Thanks

    hi Johnny, it was helpfull for me.
    With the given example i am still getting the grid line gaps with the selected row or hover color between verticle cells of the column.
    As gridlines can only be removed for complete datagrid not for a single column. is it possible ?
    Thanks

  • Putting multiple items into a single column in a datagrid

    Okay,
    So I can put information into a datagrid, I can select a row
    and make sure that it populates that row. I can even make it hit
    that specific row and column.
    How do I got about having several different buttons all
    writing in the same column? And perhaps even ordering it? i.e. The
    column would look like this: buttonOneInput, buttonTwoInput,
    buttonThreeInput etc etc
    I'd also like to sort the way this information goes in (just
    being able to sort by alpha right now would be fine, but better yet
    if I could sort it so button one always was in the front, button
    two always in the middle, button three always in the end)
    The end application of this is that I need to populate a
    datagrid with several different button groups, there are 5 groups,
    each group contains about 10 buttons. The groups need to appear in
    a specific order in the datagrid, and I need to be able to add as
    many button's information to the grid as possible.
    After this stuff all goes in, I need to get it back out too.
    I think I'll be able to figure that part out.
    Now, I know this is a lot of stuff. I don't even know if it's
    possible, but it seems like it should be, I've been trying to
    figure it out all day to no avail.
    Any tips / suggestions / code snippets / links to tutorials
    would be helpful.
    Thanks.

    Well, specifically. They're binded data (swfs) I need the
    ability to add as many of these as possible to a datagrid. I'll be
    extracting them and using them in a list.
    So to break it down, I've got a bunch of different strings I
    need to add to a datagrid item. I need to add these in the proper
    order. I then need to pop them back out to a list (I know how to do
    this part).
    Basically what I'm going on right now, is I'm calling a
    flashfile.source from a selected item. Then I'm adding it into a
    datagrid, I just need to know how to add it in without destroying
    the current items.
    Would something work where I'd ask for the current data
    datagrid.selectedItem.column and then also add the new data work?
    Thanks for your help miaomm, I'd really appreciate some code
    showing this .

  • Click event for single column in DataGrid

    I can add an event listener to a DataGrid of type
    ListEvent.ITEM_CLICK, which is triggered when the user clicks any
    part of an entire row in a DataGrid. I want to trigger a click
    event for just one column. I only want to run a function when the
    user clicks in just the first column of the DataGrid, and not run
    trigger the event if they click in any other column. Any help would
    be much appreciated.

    Accessing the event.target returns the entire DataGrid, not
    the DataGridColum. Any way to get just the DataGrid column?

  • How to access single column in table?

    Hi,everybody!
    How to access a single column in table.
    I sorted my table with standard TableSorter.
    Now I need to get one column from this table to
    do something with it's data.How do I get it?
    Regards,
    Michael

    Hi Michael,
    If you just want to retrieve the data, you could use the following code.
    //Get the node which the table is bound to
    IWDNode node = wdContext.nodeTable();
    //iterate thru the elements
    for(int i = 0 ; i<node.size();i++)
      IWDNodeElement ne = node.getElementAt(i);
      Object value = ne.getAttributeValue("<column name>");
      //Here you have the data in the value variable
      //and you can manipulate this now
    Regards,
    Sudeep

  • Detect Column on mx:Datagrid drop event

    I've been searching for a way to detect the column index when I drop on an mx:datagrid using Flex 4.  I can find the way to get the row index, but not the column.   Is the only way to define an itemeditor for each column, or is there something better (cleaner).
    If it must be an itemeditor, is there an example of one that handles the dropevent out there somewhere?
    I'm reluctant to try the AdvancedDatagrid after seeing all the posting about bugs and poor code quality.

    if it's not necessary for the user to resize the column widths, i'd say use a single column with an itemRenderer, and handle what gets shown inside that.
    if you must use multiple columns, then probably you're going to blaze the trail on performance testing.
    but it sounds like you are asking if you should limit the data to only 10 <items>.
    if so, probably convert the xml to ArrayCollection.  Large XML can freeze an app when the XML is updated.
    then, if you need more optimization after that, you can disclude <items> when converting to arrayCollection

  • How To Concatenate Column Values from Multiple Rows into a Single Column?

    How do I create a SQL query that will concatenate column values from multiple rows into a single column?
    Last First Code
    Lesand Danny 1
    Lesand Danny 2
    Lesand Danny 3
    Benedi Eric 7
    Benedi Eric 14
    Result should look like:
    Last First Codes
    Lesand Danny 1,2,3
    Benedi Eric 7,14
    Thanks,
    David Johnson

    Starting with Oracle 9i
    select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
    from
    (select last, first, code, row_number() over(partition by last, first order by code) rn
    from a)
    connect by last = prior last and first = prior first and prior rn = rn -1
    start with rn = 1
    group by last, first
    LAST       FIRST      CODES                                                                                                                                                                                                  
    Lesand         Danny          1,2,3
    Benedi         Eric           7,14Regards
    Dmytro

  • Display two heading in single column using ALV report

    Hi Experts,
    I got a requirement for displaying 2 rows heading in a single column report. Is it possible that I can perform this task using ALV. How to get this 2 rows in ALV.
    This is a criteria that need to be output in ALV REPORT.
    MATERIAL CODE--MATERIAL NUMBERSTORAGE LOC----SLOC1     SLOC2
    --DATE--DATE1      DATE2
    123445--TEST MATERIAL22--
    3
    As mentioned above storage loc and date will be changing with respect to data dynamically and under this double heading qty will be displayed.
    Just want to know how to get double heading. It is clear that how to display dynamically but unaware of double heading using fieldcatalog.
    Regards,
    Yahya

    Hi Yahya,
    Please pass row position in fieldcatalogue for the respective columns.
    E.g  MOVE '2' to w_fieldcat-row_pos.  " This will display the field in 2nd row.
    Thanks,
    Rupali

  • How to display two or more links in a single column

    Hi,
    Is there a way to display two links in a single column in a sql query report . I am able to specify one but I am not able to add links to the same column . I want to take the same column id and redirect the user to different pages based on the values selected .
    Thanks

    There is no way to this declaratively that I know of. Some alternatives...
    1. Put the conditional branching logic in the report SQL itself. e.g. case when ... then '< a href=..' else '< a href=...' end and make sure the column display type is Standard Report column
    2. Have the declarative column link go to a dummy/intermediate page and setup On Load: Before-Header branches on that page to redirect to the desired page based on the item value(s) passed in to the intermediate page.

  • How to use single column in a group by clause

    hi frs
    i hve used sum function in a sql how to use a single column in a query.
    for ex
    select sum(sal),ename,job,deptno,empno from emp
    group by deptnowhether its possible to use single column in a group by class.
    i want like this because in my custom report i need it. Report query has more than 30 column so its not possible to use 30 columns in a group by.
    pls help.
    Thanks
    Rajesh

    Maybe something like this -
    Select ename, job, deptno, empno, sal, col1, col2, col3, col4 ......, coln
    From
    Select SUM(sal) sal, deptno deptno_i
    From Emp
    Group By deptno
    ,Emp
    Where deptno = deptno_i
    Shailender Mehta

  • Multiple Hotspots in a ALV Grid single column

    Hi Experts,
    My ALV Grid report output looks like below....
    If you observe below output, column 3 has multiple documents each one separated by ' ; '. Now, I would like to assign hotspot on each documents like DOC1, DOC2, DOC3, etc.
    Heading#:          COL1 | COL2 | COL3 |
    Records1:              1      |  xxxxx  | _DOC1_ ; DOC2 ; *DOC3*
    Records2:              2      |  xxxxx  | _DOC1_ ; DOC5 ;
    I know, we can assign hotspot for entire column. but my requirement is multiple hot spots in a single column.
    Please help me on this?
    Thanks in Advance
    Raghu

    As I mentioned earlier,
    My ALV Grid report output looks like below....
    Heading#: FIELD1 | FIELD2 | FIELD3 |
    Records1: 1 | xxxxx | DOC1 ; DOC2 ; DOC3
    Records2: 2 | xxxxx | DOC1 ; DOC5 ;
    If you observe above output, field 3 has multiple documents each one separated by ' ; '.
    When I click on DOC1, it supposed to display related picture on the POP-Up Screen. Similarly when I click on DOC2, it supposed to display that document picture on POP-up screen.
    Before going to do this, first I need to assign hotspots on each documents like DOC1, DOC2, DOC3, etc.
    Please help me.

  • Using intersection of dimension members in a SINGLE column/row name

    I need help understanding how a single row/column name in a report can be populated with an intersection of two different dimension members of an Essbase cube (ASO). For example, suppose I have two dimensions members in my cube - Sales and Qtr1. Now I want to create a single column-name in my Smartview or FR report called "Sales in Qtr1" that would store values for Qtr1->Sales. Also, i want to have a single column name such as (Qtr1->Sales % Qtr2->Sales).
    Is this done via a report script or some other method?
    My report would look as follows:
    Sales in Qtr1 | Sales in Qtr2 | Qtr1 Sales as a percent of Qtr2 Sales
    Region1 100 | 200 | 50%
    Region2 25 | 100 | 25%
    Would appreciate any guidance.
    Thanks.
    Axe

    Getting the data the way you've described is really easy, just nest the dimensions in Excel (or whatever reporting tool), one dimension over the other.
    It's the same for rows as it is columns (okay, in rows instead of columns).
    Essbase is very good about doing asymmetrical reports. Take a look at the DBAG and scroll down for the section labelled "Generating Symmetric Reports" -- the second example shows a asymmetric report.
    Making the label one cell? A bit hard in Excel -- you'd have to create separate retrieve ranges and report ranges or play a game with hiding rows. Very easy indeed in Financial Reports -- you basically hide a row and put whatever custom label you want in the dimension that remains (technically speaking you could hide both rows and do this with a text row -- whatever you prefer -- but I've generally seen this with the former technique.
    Regards,
    Cameron Lackpour

  • Multiple conditin on a single column in a single query

    i want to select data from the table using diff conditions on a single column
    for eg:
    i need emp details like whose having empno as 5-15,19-45,50-89 ..etc this how can i give a condition in a single query
    we can use in or between for 2 or 3 conditions but i have plenty off like this

    Hi,
    848525 wrote:
    i want to select data from the table using diff conditions on a single column
    for eg:
    i need emp details like whose having empno as 5-15,19-45,50-89 ..etc this how can i give a condition in a single query
    we can use in or between for 2 or 3 conditions but i have plenty off like thisYou can use OR for any number of conditions; it works the same for 4 or more.
    You could also put the ranges into a table (or a sub-query, as shown below) and join:
    WITH     empno_ranges     AS
         SELECT     3000 AS low_val, 5000 AS high_val  FROM dual  UNION ALL
         SELECT     7000,           7499               FROM dual  UNION ALL
         SELECT     7500,           7599               FROM dual  UNION ALL
         SELECT     7800,           7899               FROM dual
    SELECT       r.*
    ,       COUNT (e.empno)     AS emp_cnt
    FROM            empno_ranges     r
    LEFT OUTER JOIN     scott.emp     e  ON  e.empno  BETWEEN r.low_val
                                                 AND     r.high_val
    GROUP BY  r.low_val, r.high_val
    ORDER BY  r.low_val
    ;Output:
    LOW_VAL   HIGH_VAL    EMP_CNT
       3000       5000          0
       7000       7499          2
       7500       7599          2
       7800       7899          3

  • Can I get multiple sums in a single column based on a "code" I place.

    After importing a file of check/debit card activity from my bank, can I 'code' the line items based on tax categories ie Utilities, Medical expenses, Auto expenses, etc. and then get sums for each based on that code I placed in a single column? That would mean multiple sums in a single column based on the code used for each tax related expense. For instance, I would put UT in the column for utilities expenses and MED in the same column if it were a medical expense. I would then want the sum for all items in that column for each item code. Is this possible or do I need to use a different approach to get this information.

    My guess is that the SUMIF function may be your friend.
    It's well described in the *iWork Formulas and Functions User Guid*e which every user may download from the Help menu.
    Yvan KOENIG (VALLAURIS, France) samedi 2 janvier 2010 21:56:39

Maybe you are looking for