Counting Like Responses in a single record

Greetings All,
I have created an online survey consisting of 20 questions
which are to be answered using yes/no radio buttons. I'd like to be
able to count the number of yes answers and no answers for a single
record and display them as a percentage (based on 20, the number of
questions). Is there a somewhat easy way to do this. The only way I
could think of is to create 40 queries, a yes and no query for each
question, pull the recordcount for each query and then use
mathematic operators to create the percentage. There must be an
easier way.

I'm sure you will get a better response than this one, but
here's an idea.
One way would be to use a single query to pull the record,
then use cfset statements to set numerical values (hence to
additional queries to the database). Like:
<cfquery name="getrecord" datasource="yourdatasource">
SELECT *
FROM table
WHERE (your query qualification for pulling the record
</cfquery>
<cfif q01 = "Yes">
<cfset qy1 = 1>
<cfelse>
<cfset qn1 = 1>
</cfif>
<cfq02 = "Yes">
<cfset qy2 = 1>
<cfelse>
<cfset qn2 = 1>
</cfif>
ETC... THEN
<cfset qyestotals = qy1+qy2+ (ETC)>
<cfset qnototals = qn1+qn2+ (ETC)>
<cfset yesaverage = qyestotals/20>
<cfset noaverage = qnototals/20>
Definitely not brilliant, but it should work on a single
query.
If you were showing multiple records, one average at a time,
use a cfloop over the returned recordset with the above within the
loop.
- Mike

Similar Messages

  • Search for and edit single record in database

    I am creating a few forms that access an Access database that will be used to enter data into the database.  I am able to open records from the database and scroll through records one at a time and have added features to be able to search for and display a single record.  The problem that I am having  is when I load a single record and then edit that record, I am unable to save any changes made to the record, in other words, the record doesn't update on the database.
    I can add new records and edit records as long as I scroll to them using .next(), .last(), .first(), and .previous() commands; however, when I load a single record I can't figure out how to save changes to that record in the database.

    Ok...so I think i can get it to work by doing something like:
    xfa.sourceSet.DataConnection.open();
    xfa.sourceSet.DataConnection.first();
    var oRecordList = ???????????
    var nCount = oRecordList.length;
    for (var i = 0; i < nCount; i++){
        if (CurrentRecord.rawValue != SearchField.rawValue){
            xfa.sourceSet.DataConnection.next();
    where CurrentRecord is a text field that shows the index of the current record and SearchField is the field where a user enters the record that they are searching for.
    I think I just need to figure out how to count the number of records in the database.  Any ideas?

  • How to insert sales text (MM02) into a single record of a Ztable.

    Hi,
    I'm extracting data from different data base tables and populating a Ztable which has Matnr as primary key and sales text as a field.
    I have already used READ_TEXT to display the text and it is displayed in multiple records which in turn leads to duplication of Material numbers.
    Now I want to avoid duplication of records (Matnr) as this being a primary record, and display the sales text of a particular material number into one single record.
    Can anyone tell me how to insert sales text (MM02) transaction into one single record.
    Thanks,
    Govind

    sorry i am not enough clear about your requirement...
    as i can understand i am explaining to you.
    suppose your itab contains repaeating matnr.
    matnr
    1
    1
    2
    2
    2
    3
    3
    like this.
    data : text(200),
             matnr like mara-matnr.
    loop at itab.
    call READ_TEXT fnmodule.
    loop at tline.
    concatenate text tline-tdline into text.
    endloop.
    matnr = itab-matnr.
    at end of matnr.
    itab1-matnr = matnr.
    itab1-text = text.
    append itab1.
    clear text.
    endat.
    endloop.
    NB change the code as per your requirement
    regards
    shiba dutta

  • Concatenate multiple records into one single record

    Hello everyone,
    Can anyone guide me how to merge multiple records into one single record
    like......... I am getting the data in the file like
    aaaaa/bbbbbbb/ccccccccccc/dddddddddddd/eee
    ffffff/gggg/hhhhhhhhhhhhhh
    /123/4567/55555/99999999/kaoabfa/eee
    fffff/kkkkkkkk/llllllllllllllllllllllll
    when i use gui_upload I am getting the data into the internal table in the above format.
    My main intension is to split the record at / to multiple lines and dowload it into another file.
    What i am planning to do is... if the line does not start with / then i want to concatenate the multiple lines into single line and then split it into multiple records. Can anyone guide me how to achieve this.

    Yes, it should work.
    In my example
    Loop at itab.
    concatenate i_text itab into i_text.
    endloop.
    You change that loop for the loop of your internal table with the file records
    So if you have this three records
    'aaaa/bbb/ccc'
    '/dddd/efg'
    'hijk/lmn'
    i_text will look like this at the end
    'aaaa/bbb/ccc/dddd/efghijk/lmn'
    then in this part of the code
    split i_text at '/' into table itab2.
    itab2 will have the records looking like this
    aaaa
    bbb
    ccc
    dddd
    efghijk
    lmn'

  • How can I map last of the repeating records into a single record?

    I have a following input schema, I need to take only one of the <Student> records and map that to a single record in output. Doesn't matter if the first, second or last one of the records get mapped, I only need one in the output. Any idea how can
    this be accomplished?
    Input:
      <Students>
        <Student id="1">
            <Name>
              A
            </Name>
            <Roll>
              1
            </Roll>
        </Student>
          <Student id="2">
            <Name>
              A
            </Name>
            <Roll>
              1
            </Roll>
        </Student>
        <Student id="3">
            <Name>
              A
            </Name>
            <Roll>
              1
            </Roll>
        </Student>
      </Students>
    Expected Output:
    <Candidate>
      <Student>
        <Name>
           A
        </Name>
      </Student>
    </Candidate>

    Sounds rather complex for something that could be done very simple in custom XSLT like this:
    <?xml version="1.0" encoding="utf-16"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="Students">
    <Candidate>
    <Student>
    <Name>
    <xsl:value-of select="Student/Name" />
    </Name>
    </Student>
    </Candidate>
    </xsl:template>
    </xsl:stylesheet>
    Morten la Cour

  • Integrating number of records into a single record

    Hi
    I have a table where we store trainees with certifications, it stores trainees address, id, pass/fail flag, course codes, competetion date and certificate expiration date. WHat I need is to display a single record for each trainee in my query. In this case, what we have currently in the table is we might have 11 certificates for a trainee or 1 or maybe 5 etc. All I need is to display all his information, address, trainee id, courrse code..course code11 in a signle record. Is it possible and how? Please help

    Try this one - it points to the same page and looks like it works:
    Re: How to show the SELECT result in a certain form?

  • Getting error " Incomplete update due to error in single records"

    Dear All,
    We are loading data from DSO to Cube using full load and the load is failing giving an error message Collection in the source system ended and when checked the error message button it is showing as  " Incomplete update due to error in single records" . and also one more message "Messages (type E) for data records with record number 0
    Message no. RSM2714". Can any one tell us the reason for the failure of this load ? and how to resolve it ?.
    When we click on the help button of the error message it is displaying the message as below
    Incomplete update due to errors in single records --> Long text
    Message no. RSM2712
    Diagnosis
    In the update rules, one InfoSource record was used to create several records in the data target. These records must be handled in the same way to enable tracking into the PSA and the treatment of errors in individual records.
    In the previous case, one record was updated in this kind of group generated by update rules, whereas other records in the same group were rejected. If you updated the PSA data record again, the records that were already updated would be updated again. Duplicate records would appear in the data target and the data target would thus be inconsistent.
    System Response
    The data record with errors was highlighted in the PSA. However, no error request was generated.
    Procedure
    Delete the request in the data target and, after removing the error, update all records for the request to the data target again.
    Regards,
    JayaKrishna

    hi,
    Can you please check out the PSA error record and check this out in Source DSO as this load is for DSO -> Cube....
    Please correct it in PSA if this is not correct as per DSO ....prior correcting data in PSA pls delete the request from Cube.....then it will allow to correct or delete record in PSA and then further push data from PSA to Target Cube...
    If its correct as per DSO then run load in DSO sometime few records wrongly updated by  end user and they correct it by evening for Submission....So u will get the corrected record and then run manually further load to Cube...
    Hope this will help....
    Regards,
    Mahesh

  • Sender File Adapter cannot send single record per message ?

    Hi,
    I have scenario flat file to jdbc. but then why the sender file adapter didn't split the record to become single record per message eventhough i have set it in "Recordsets Per Message" = 1. ?
    Document Name               MT_APINVOICE
    Document Namespace          urn:file:jdbc:apivinvoice
    Document Offset               8
    Recordset Name               INPUT
    Recordset Namespace          
    Recordset Structure                          RECORD,*
    Recordset Sequence                          Ascending
    Recordset per Message          1
    Key Field Name               
    Key field Type               String
    RECORD.fieldFixedLengths     10,5,10,10
    RECORD.endSeparator     'nl'
    RECORD.fieldNames          F1,F2,F3,F4
    Please advise
    Thank You and Best Regards
    Fernand

    >>but then how to make for example more then 1 records per message.
    like 10 records per message. should i set RECORD,10 ?
    That is right. Just try it out yourself.
    @Shesagiri,
    Number of record is decided by the parameter Recordset structure and number of recordset with in a message is decided by Recordset per Message.
    Regards
    Jaishankar

  • How can I add recording time to a single recording not a series recording?

    If I set-up a series recording it allows me to add minutes to the recording time why can't I add time to a single recording? For example if I want to record a single show tomorrow I find it on the guide and hit record. Now I want to add a few minutes on the end of the show because I know it always runs over it's advertised time why can't I add the time? It doesn't gives to extra options for a single recording. The only time I can add time to a single recording is if the show is currently on then it allows me to add time but, not before the show is on. So what good does that do? Comcast allowed me to set-up extra options to a single recording.

    Actually you can.  It's a bit clumsy but what you have to do is go to the DVR menu, select scheduled reordings, select the recording you want to extend, scroll through the menu and you will find an option to modify the start / end time.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • How to store as single record data coming from different ods to cube

    Hi All,
            we have the scenario like .
    Same contract values are uploaded from 3 ods to cube.In the cube this information is stored as 3 different records.
    Is there any option having same contract no and same fiscal period values should be stored as single record in cube.
    Thanks in advance.
    Regards,
    Shradda.

    Hi Shradda,
    On Performance Side .....consider below points
    1. Indexes on Cube ( That delete indexes before load and create them after Load ).
    2. Aggregate Design ( Decision on Base Aggregates, roll up Hierarchy , BW Statistics etc ).
    3. Partition of InfoCube ( Basically decision on No. of Partition )
    4. Data Package Size ( Always try to have larger Data Package so that preaggreation will reduce the no. of Data Records ).
    Best is Service.sap.com on BI page u will find material for performance . THat will help you .
    To assign points on the left of screen u will get radio buttons for assigning points for each person who has responded .
    Regards,
    Vijay

  • RFC single record or unbounded?

    Hi folks,
    In one of my mapping Iu2019ve two tables with fewer fields to get. So Iu2019m using the RFC lookup standard conversion function of Message Mapping. The RFMs only retrieve a single record and I thought if they could retrieve unbounded records it could increase the performance of this mapping. But, Iu2019m not figuring how to handle the unbounded records at the message mapping. As we map context with context, the key fields should be passed at onceu2026 in java mapping I see it feasible, but with message mapping nou2026 any idea?
    Retrieving single records is the regular behavior of an RFC lookup? (At the examples Iu2019ve seen here is always retrieving single records.
    Thanks in advance,
    Jorge.

    yeah so i dont see any issues as such. in the UDF where you do the RFC lookup you will have to ensure you send out values to the target node.
    But tell me something, do you want to map the response to multiple target fields?
    In this case i suggest you dont do a lookup. say if your scenario for example is File A -> XI -> FILE B and most of the records for FILE B is retrieved from RFC lookup, then avoid the lookup and then do a FILE -> RFC -> FILE scenario

  • Transformation Routine to convert single record into multiple

    All,
    I need your help with ABAP Syntax.  My requirement is to take a single record and convert it to multiple records into a DSO with a condition to not create a record if a KF value is 0.
    R/3 Data Record:
    Employee | Date | Char1 | KF1 | Char2 | KF2 | Char3 | KF3 | Char4 | KF4
    Conversion Result into DSO:
    Employee | Date | Char1 | KF1
    Employee | Date | Char2 | KF2
    Employee | Date | Char3 | KF3
    Employee | Date | Char4 | KF4 (This record will not be written if no value is in KF4)
    I have read about the result table in update rules, however within BI 7.0 Transformations I am unfamiliar as to where the RESULT_TABLE function applies.  Has this been replaced by the Expert Routine?
    Could any ABAP expert provide sample code as to how I would perform this conversion in a Transformation Routine?
    Thanks,
    David

    Thanks Alex for your response.
    I did find a solution to this as it turns out to be fairly simple, however I executed the routine as an Expert Routine instead of a Start Routine.  I was advised to do the transformation here.
    The basic concept is defined below:
    Loop at source_package assigning -kf2.
              Append result_fields to result_package.
           Endif.
    -- Kf3u2026  and so on
    Endloop.
    Basically the APPEND statement is used to create the additional records.

  • Single record view: xml in clob view formatted

    I'm storing xml data in a clob. When I select 'single record view' I see my xml on a single line. I would like to see it formatted for easy reading. Is there a way to accomplish this?

    Don't think so, works the same way in the grid; you have to press the Edit icon inside the cell to see proper line breaks.
    You can always add this as feature request at the SQL Developer Exchange, so other users can vote to add weight for possible future implementation.
    Regards,
    K.

  • Select query for single record

    hi all,
    i am working for script which is letter.
    i had to extract the fields as shown in the code. from two tables i had to extract single record. and pass this values to script.i developed the code. wen i execute the code its going to dump. can any body help me.
    TABLES : VBAK, KNA1.
    PARAMETERS : p_vbeln LIKE vbak-vbeln.
    Data : name like kna1-name1.
    Data: begin of wa_vbak ,
         vbeln(10),
           netwr(15),
           bstdk(8),
           kunnr(10),
           smenr(8),
           end of wa_vbak.
    Data: begin of wa_final,
           vbeln(10),
           netwr(15),
           bstdk(8),
           kunnr(10),
           smenr(8),
           name1(35),
           end of wa_final.
           Select single vbeln
                         netwr
                         bstdk
                         kunnr
                         smenr from vbak
                         into wa_vbak where vbeln = p_vbeln.
        If sy-subrc = 0.
           Select single name1 from kna1 into name  where kunnr  =  wa_vbak-kunnr.
        If sy-subrc = 0.
          Move wa_vbak-vbeln to wa_final-vbeln.
          Move wa_vbak-netwr to wa_final-netwr.
          Move wa_vbak-bstdk to wa_final-bstdk.
          Move wa_vbak-kunnr to wa_final-kunnr.
          Move wa_vbak-smenr to wa_final-smenr.
          Move name to wa_final-name1.
        endif.
        endif.
        write:/10 wa_final-vbeln, 20 wa_final-netwr.
    thanks
    venkat

    Hai,
    Make sure that field names(itab) are same as database tables.
    And also INTO CORRESPONDING FIELDS OF TABLE .
    The modified code is as below:
    TABLES : VBAK, KNA1.
    PARAMETERS : p_vbeln LIKE vbak-vbeln.
    Data : name like kna1-name1.
    Data: begin of wa_vbak ,
    vbeln(10),
    netwr(15),
    bstdk(8),
    kunnr(10),
    smenr(8),
    end of wa_vbak.
    Data: begin of wa_final,
    vbeln(10),
    netwr(15),
    bstdk(8),
    kunnr(10),
    smenr(8),
    name1(35),
    end of wa_final.
    Data:
      T_wa_vbak like standard table of  wa_vbak.
    Select single vbeln
    netwr
    bstdk
    kunnr
    smenr from vbak
    into <b>CORRESPONDING FIELDS OF TABLE T_</b>wa_vbak where vbeln = p_vbeln.
    If sy-subrc = 0.
    Select single name1 from kna1 into name where kunnr = wa_vbak-kunnr.
    If sy-subrc = 0.
    Move wa_vbak-vbeln to wa_final-vbeln.
    Move wa_vbak-netwr to wa_final-netwr.
    Move wa_vbak-bstdk to wa_final-bstdk.
    Move wa_vbak-kunnr to wa_final-kunnr.
    Move wa_vbak-smenr to wa_final-smenr.
    Move name to wa_final-name1.
    endif.
    endif.
    write:/10 wa_final-vbeln, 20 wa_final-netwr.
    Regards,
    Rama chary.Pammi

  • Single record view window increases !

    Hi !
    I use vesion 1.1.2.25-79.
    Opening the single record view on an record of a table the window is of "normal" size. I enlarged it a little. to see more columns of the record.
    From now on the window is increasing every time I open the "single record view".
    A bug or feature ?
    Regards,
    Heinz

    It certainly seems like a bug to me - the window gets wider each time it is opened (regardless of whether you have resized it first) and it eventually gets wider than the screen. Thankfully it does start from it's previous size, so you can resize it down to keep it usable next time and it does reset when restarting SQL Developer, but it is another annoyance :(

Maybe you are looking for

  • I'm getting this error message each time I try to go to another webpage.. (Error message below)

    Each time I open up Firefox, I'll be able to go to my homepage, but as soon as I try to go to any other page, I get the message above. When I open up Safari, it doesn't happen. I'm able to go to any and all websites... Why does this happen on Firefox

  • Page Scrolling Options

    Hi everyone, We are currently running VC on 2004s SP8. I would like to have my table be able to scroll or page through the many records. The table is being populated with data but the paging toolbar does not show up. Scroll buttons is set to 'Show' (

  • My "x" button has disappeared from my tabs. How do I get it back?

    Until recently, when using multiple tabs, I would have a close button or "x" in every tab. I did not make any changes to settings, but now, my close tab button is gone or at least not visible. Currently, the only way I can close individual tabs it by

  • Where can I buy MacBook Pro parts?

    My hard drive cable was broken... Where can I buy MacBook Pro parts? Better if it is first source

  • Get filtered lookup field in sharepoint 2013

    Hi,  I have LIST1   Title            User Title1           Spservices Title2            Spservices Title3           Spuser here User column is people/group  LIST 2 how can i get Titles from LIST1 where User= Spservices ([Me]) for TitleLIST1 column in