Counting the number of values selected in a list box

I'm trying to add a counter to a form that tells the user how many values have been selected from a list box... I tried adding a FormCalc formula to a calculate event in the "counter" field as follows:
count(form1.#subform[0].ListBox1.rawValue)
But for some reason it's not adding them up. It only gives me a value of 0 when none are selected, or 1 where any number of selections are made.
Can anyone help me out?
Thanks in advance

Try putting this in the calculate event of your counter field:
var num=0;
for (var a=0;a<ListBox1.items.nodes.length;a++){
if (ListBox1.getItemState(a))
  num++;
this.rawValue=num;
Exit the list box and the field will calculate.
Kyle

Similar Messages

  • Count the number of values selected in a form

    Hello
    I need to count the number of values selected in a form.
    Here is my form dump:
    I want to count the values circled in red.
    So the number I want in this case is 5.
    Any suggestions?

    Aegis,
    Yeah, good point.  Here is a minor tweak:
    <cfset total = 0>
    <cfloop collection="#FORM#" item="field">
         <cfif field NOT IS "fieldnames">
           <cfset total += ListLen( FORM[ field ] )>
         </cfif>
    </cfloop>
    <cfoutput>
         <p>Total: #total#</p>
    </cfoutput>
    -Carl V.

  • Count the number of values selected in a Dashboard prompt

    Hi,
    I have a requirement to show the count of the number of values selected in a Dashboard prompt. How to do that?
    Thanks in advance.

    Hi,
    Please follow below steps;
    1. create a report(which will show the number of value selected)-
    Pull the dimension column in criteria on which the prompt is created, make this column as IS PROMPTED. Edit the FX and put the expresion as; Count(*)2. In report pull narrative view add your custom text like "Number of prompt selected are @1". (@1 is nothing but he count of prompt selected.)
    3. Put this report on the dashboard which has prompt.
    Mark correct/helpful if it helps.
    Regards,
    Kashi
    Edited by: K N Yadav on 28 May, 2013 2:01 AM

  • Count the number of values in a two dimensional array

    i am trying to figure out how to count the number of values in a two dimensional array.
    numScores = student[i][j].length;This doesn't work, i am trying to find a way of counting the columns

    Object[][] o;
    int tot = 0;
    for(int x = 0 ; x < o.length ; x++)
       tot += o[x].length;
    }If it's not a jagged array, however, this would be easier:
    int tot = o.length * o[0].length;

  • Count the number of elements in comma seperated list of values

    Hello Friends,
    I have a string with comma seperated list of values say
    String v = 34343,erere,ererere,sdfsdfsdfs,4454,5454,dsfsdfsfsd,fsdfsdfsdfs,dfdsfsdfsdfs,sdsfdsf,ererdsdsd45454,fsdfsdfs
    Want to count how many elements are existing in this string .
    Thanks/Kumar

    Hi, Kumar,
    REGEXP_COUNT, which Hoek used, is handy, but it only works in Oracle 11. Which version of Oracle are you using?
    In any version of Oracle, you can count the commas by seeing how much the string shrinks when you remove them.
    LENGTH (str) + 1 - LENGTH (REPLACE (str, ',')) Can str have multiple commas in a row? What if there's nothing between consecutive commas, or nothing by whitespace? Can str begin or end with a comma? Can str consist of nothing but commas? Depending on your answers, you may have to change things. You might want
    REGEXP_COUNT ( str
                 , '[^,]+'
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • How can I count the number of values in one column which answer to a condition in another column?

    I'm using Numbers 3.2 and would like to count the names in a column which satisfy a condition in a different column. There are 3 "streams" through which these names have come to me, and I would like to easily identify how many have come from each stream. Any help?

    Hi DirtyDawg,
    COUNTIF is your friend here.
    If your source is in column C and your streams are 1, 2 and 3:
    =COUNTIF(C,"=stream1")
    =COUNTIF(C,"=stream2")
    =COUNTIF(C,"=stream3")
    These need to be in a footer or header row or in a different column than C.
    hope this helps,
    quinn

  • Disable fields based on value selected from first list box.

    Hi All,
    I am facing a problem in module pool programing. My scenario is there will be around 50 fields in the screen  , within that first field is a drop down list box. In the list box there will be electricuty , gas and csw. If user select gas then the fields corresponding to gas will only be editable other fields not relevent to gas will be non editable(Disable).... Same case for electriciy andcsw also.
    Can any one guide me regarding this....
    Thanks in advance.
    Regards
    Ajoy

    Hi Asaha,
    This link will be of great help for you if you are new to Module pool.
    [Module Pool Notes|http://wiki.sdn.sap.com/wiki/display/Snippets/ModulePoolNotes]
    For [DYNP_VALUES_READ|http://wiki.sdn.sap.com/wiki/display/ABAP/FilteringF4HelpvaluesinTablecontrol,basedonotherfield+value] refer this link.
    For [DYNP_VALUE_UPDATE|http://wiki.sdn.sap.com/wiki/display/ABAP/GettingainputfieldpopulatedonenteringthevalueinoneInputfield]
    Regards
    Abhii

  • Is there a way to count the number of chars in a formatted text box?

    I have a formatted text box in my web dynpro for comments pertaining to workflow.
    in the backend, this is mapped to a char200 field.
    is there a way to have a running counter to let the user know how many chars are left? I'm not sure if there's an event to use for that.
    thanks,
    robert.

    Hello Robert,
    There is no way to get a running total of characters typed by the user - if you really need this functionality - consider creating an Adobe Flash Island.
    There was in the last year another thread which covered pretty much the same theme - it could be worth looking at that - although you will find that the eventual solution is the same as I suggest above.

  • Count the number of business partners on a non-cumulative key figure

    Dear experts,
    I have a problem. We have an InfoCube in BW in which the Activity Journals are loaded every day. In this Activity Journals it is registered that a Material was listed (available) at a customer (value 0 or 1).
    We have a non-cumulative key figure MXW_LISTN with inflow (MXW_LISTI) and outflow (MXW_LISTO). In time this key figure receives +1 or -1 for a customer, material combination.
    I want to use MXW_LISTN in the query in a specific way. The key figure on itselve tells me how many listings there are. However, I want to know how many business partners there are with a listing.
    I was thinking about an exception aggregation on MXW_LISTN with reference characteristic 0BPARTNER and "Count <> 0". BW however refuses to do so and only lets me do simple aggregations such as AVG, MIN, MAX etc.
    Can you think with me and come with an proper solution to count the number of business partners with a listing?
    Your help is very much appreciated and rewarded!
    Best regards, Hans de Klein

    Would anything with virtual key figures be a solution? Please help me out!
    Best regards, Hans de Klein

  • Workflow to count the number of items in a list

    Hello Friends,
    I've a requirement, I need to count the number documents uploaded for a particular list item (identified by a unique Title) and if the count matches with the count stored in another list for that particular list item, bingo......I will update the status
    field to completed.
    Can anybody please help me with this. How do I do this ? Is it possible even ?
    Thank you very much in advance. :)

    Hi,
    I haven't tried this but i think you can achieve it by
    1. Add an Call HTTP activity in your workflow and make a REST call get items
    2. Use Count Items in (Dictionary variable)to get the Items counts of attachment.
    3. Then, lookup for your another list in match item count.
    Your REST query can be similar to this
    url: http://site url/_api/web/lists/getbytitle('list title')/items(item id)/AttachmentFiles/To make Rest call in SharePoint designer https://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/
    https://msdn.microsoft.com/en-us/library/office/dn567558%28v=office.15%29.aspx

  • Count the number of days in the selected range using Customer exit

    Hi Experts,
    we have requirment where user is asking to add a column to report, which will have 'count of days for which key figure is having values' for each of the months and the Header would be 'Day Count'
    Please let me know if its possible using Customer exit?

    Hi,
    In our report we have two characteristics site no. and product and we have 6 key figures of type quantity and Input for the report is Fiscal year/period
    So in the report Key figures are populated with values for respective site no. and product combination
    Now the user wants new column in report which will have header u2018Day countu2019 and it should Simply count the number of days in the selected range that have a volume different than 0 for key figure
    Please let me know if more details are required

  • How do you get  the count of number of  checkbox selected?

    hi,
    plz tell me how do you get the count of number of checkbox selected?

    Not sure what you are doing so I will attempt to answer your question. If have one question which can have multiple answers you have will recieve an array so you have to do getParameterValues("name") and move it into an array.
    If you have multiple questions and only value will be selected do a getParameter("name") on each form element.
    HTH, if not provide more detail.
    J.Clancey

  • Count the number of records between two key values (BTREE)

    How can I count the number of keys between two values?
    I'm using python driver, and BTREE access method.
    ====>
    ideally what I want is to average a whole time-series data set (the intervals can change) to a given number of points. The keys are the time stamps and the values are the data that needs to be averaged. I need to count the number of records between two time stamps so that I can divide that number by the number of points i need, and average the data. What is the best way to do this?  Or should I just keep the intervals for the time stamp constant and use RECNO access method?
    Thank you
    (first post btw.. and why aren't there many people in stackoverflow who answer Berkeley DB questions?)

    BDB is an embedded db and it does not have any internal counters or statistics that you could grap to use for this.    You will need to do it manually.
    You can create a cursor, grap the records you want, each time you get the next record you bump a counter.
    If you are using RECNO, you can use a cursor to get the record number of the record (DB_GET_RECNO), and if all you data is in
    sequentail records with no missing records you can figure out the total count by take last rec # - initial rec # + 1 to get a total count.
    If you switch over to the SQL API, you can issue a SQL query to give you a count.  Select count(*) Where .......
    Since you have to grab the data anyway, then best may be to count records as you go along.
    thanks
    mike

  • How to Count the number of TAB chars value '0A' in a line?

    I have a requirement to count the number of TABs in a text file that I am processing (they must equal 75) to ensure that all the fields have been submitted on the file I am reading?
    How do I identify the TABs in a line?
    I have this so far:
             CONCATENATE gv_unix_file gv_lstfiles-name INTO gv_unix_file.
              OPEN DATASET gv_unix_file for INPUT IN TEXT MODE ENCODING NON-UNICODE.
              IF sy-subrc <> 0 .
                message e000(zz) with 'Cannot access in_uk files'.
              ENDIF.
              CONCATENATE gv_unix_file_arc gv_lstfiles-name INTO gv_unix_file_arc.
              OPEN DATASET gv_unix_file_arc FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
              IF sy-subrc <> 0 .
                message e000(zz) with 'Cannot access in_uk files'.
              ENDIF.
              DO.
                READ DATASET gv_unix_file into lv_str.
                IF sy-subrc <> 0.
                  exit. "exit do loop, file is done.
                else.
                  TRANSFER lv_str to gv_unix_file_arc.
                ENDIF.
              ENDDO.

    Here is a sample code:
    DATA: lv_string TYPE string,
          lv_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
          lv_i TYPE i.
    DATA: result_tab TYPE match_result_tab.
    DO 3 TIMES.
      CONCATENATE 'A' lv_string INTO lv_string SEPARATED BY lv_tab.
    ENDDO.
    " this is how you need to find how many tabs are in your transfer work area...
    FIND ALL OCCURRENCES OF lv_tab IN lv_string RESULTS result_tab.
    DESCRIBE TABLE result_tab LINES lv_i.
    WRITE:'No. of tabs found:', lv_i.

  • Count the number of rows resulting from a select statement

    Hi,
    Is there any way of counting the number of rows resulting from a select statement. i.e I have a select distinct statement and I then want to perform an IF statement on the number of rows resulting from the select statement.
    Any help appreciated
    Thanks
    Gary

    Declare
    var1 number;
    Begin
    select count(distinct column_name) into
    var1 from table_name;
    If var1 > x Then
    End IF;
    End;
    Hope I understood the problem correctly
    null

Maybe you are looking for

  • Disk utility doesn't open, trash works incorrectly.

    After updating to 10.7.3 I have noticed that Disk Utility no longer opens. It pops up into the utility bar for a few seconds, bobs up and down a couple of times, then disappears. The next time I click on Disk Utility I don't even get that much of a r

  • How do I convert a Word hyperlink path to point to a converted PDF document?

    I have a folder with Word documents that I want to convert to PDF. Many of the Word documents have hyperlinks to bookmarks in other Word documents in the same folder. (I'm trying to convert all the Word documents in the folder to PDF.) After I conver

  • Browser problems with IC Web Client

    I receive some errors when I try to launch Interaction Scripts in "My Scripts" section of Interaction Centre Web Client (IC WC) and nothing works after. One of them is "_htmlbMessageBar" - undefined. Then I try to check the situation in FireFox 1.5 (

  • Unable to add Exchange account after upgrading Outlook 2003 to Outlook 2010

    Hello, We have a number of users that we have upgraded Outlook from 2003 to Outlook 2010. I am now trying to add an exchange account to these machines, but it doesn't work. The exchange setup is correct, as we have some machines that came with Outloo

  • Creation of UDF in the AP Invoice Header

    Dear All, We would like to create UDF and Link with Formated search for the List of Customers in the AP invoice. The Idea is to capture for which customer the AP Invoice is made. Can any body help. We tried creating in the Title of Marketing document