DVWP XSLT count number of column having Yes/No values for each row

I have a Data View Web Part .Now I have a column that contains either 'Yes' or 'No'
and i want to count the number of 'Yes' for the rows and column  .
below image will help to understand better what i am tying to achieve.  

Here is XSLT code , you may find this usefull
Row View Template :
<xsl:template name="dvt_1.rowview">
      <xsl:param name="Rows"/>
      <xsl:variable name="CountYesForAll" select="number((. = contains(@Richard,'Yes')))
       +number((. = contains(@AndrewP,'Yes')))
       +number((. = contains(@Damien,'Yes')))
       +number((. = contains(@AndrewC,'Yes')))
       +number((. = contains(@Tiffany,'Yes')))
       +number((. = contains(@David,'Yes')))
       +number((. = contains(@Tony,'Yes')))
       +number((. = contains(@Saj,'Yes')))
       +number((. = contains(@Miguel,'Yes')))
       +number((. = contains(@Viv,'Yes')))
       +number((. = contains(@Paula,'Yes')))
       +number((. = contains(@Helen,'Yes')))
       +number((. = contains(@Matthew,'Yes')))"/>
      <xsl:variable name="RichardsCount" select="count($Rows[(@Richard)='Yes'])"></xsl:variable>
      <xsl:variable name="AndrewPsCount" select="count($Rows[(@AndrewP)='Yes'])"></xsl:variable>
      <xsl:variable name="DamiensCount" select="count($Rows[(@Damien)='Yes'])"></xsl:variable>
      <xsl:variable name="AndrewCsCount" select="count($Rows[(@AndrewC)='Yes'])"></xsl:variable>
      <xsl:variable name="TiffanysCount" select="count($Rows[(@Tiffany)='Yes'])"></xsl:variable>
      <xsl:variable name="DavidsCount" select="count($Rows[(@David)='Yes'])"></xsl:variable>
      <xsl:variable name="TonysCount" select="count($Rows[(@Tony)='Yes'])"></xsl:variable>
      <xsl:variable name="SajsCount" select="count($Rows[(@Saj)='Yes'])"></xsl:variable>
      <xsl:variable name="MiguelsCount" select="count($Rows[(@Miguel)='Yes'])"></xsl:variable>
      <xsl:variable name="VivsCount" select="count($Rows[(@Viv)='Yes'])"></xsl:variable>
      <xsl:variable name="PaulasCount" select="count($Rows[(@Paula)='Yes'])"></xsl:variable>
      <xsl:variable name="HelensCount" select="count($Rows[(@Helen)='Yes'])"></xsl:variable>
      <xsl:variable name="MatthewsCount" select="count($Rows[(@Matthew)='Yes'])"></xsl:variable>
  <tr>
   <xsl:if test="position() mod 2 = 1">
    <xsl:attribute name="class">ms-alternating</xsl:attribute>
   </xsl:if>
   <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    <td class="ms-vb" width="1%" nowrap="nowrap">
     <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
    </td>
   </xsl:if>
   <td class="ms-vb">
    <xsl:value-of select="@Title"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Richard) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Richard"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@AndrewP) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@AndrewP"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Damien) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Damien"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@AndrewC) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@AndrewC"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Tiffany) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Tiffany"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@David) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@David"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Tony) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Tony"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Saj) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Saj"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Miguel) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Miguel"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Viv) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Viv"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Paula) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Paula"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Helen) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Helen"/>
   </td>
   <td class="ms-vb">
    <xsl:attribute name="style">
     <xsl:if test="normalize-space(@Matthew) = 'NA'">background-color: #000000;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="@Matthew"/>
   </td>
   <td>
   <xsl:value-of select="$CountYesForAll"/>
   </td>
   <td>
    <xsl:if test="normalize-space(@Title) = 'Richard'">
     <xsl:value-of select="$CountYesForAll + $RichardsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Andrew P'">
     <xsl:value-of select="$CountYesForAll + $AndrewPsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Damien'">
     <xsl:value-of select="$CountYesForAll + $DamiensCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Andrew C'">
     <xsl:value-of select="$CountYesForAll + $AndrewCsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Tiffany'">
     <xsl:value-of select="$CountYesForAll + $TiffanysCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'David'">
     <xsl:value-of select="$CountYesForAll + $DavidsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Tony'">
     <xsl:value-of select="$CountYesForAll + $TonysCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Saj'">
     <xsl:value-of select="$CountYesForAll + $SajsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Miguel'">
     <xsl:value-of select="$CountYesForAll + $MiguelsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Viv'">
     <xsl:value-of select="$CountYesForAll + $VivsCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Paula'">
     <xsl:value-of select="$CountYesForAll + $PaulasCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Helen'">
     <xsl:value-of select="$CountYesForAll + $HelensCount"/>
    </xsl:if>
    <xsl:if test="normalize-space(@Title) = 'Matthew'">
     <xsl:value-of select="$CountYesForAll + $MatthewsCount"/>
    </xsl:if>
   </td>
  </tr>
 </xsl:template>
Footer template to show sub total :
<xsl:template name="dvt_1.footer">
  <xsl:param name="Rows" />
  <div class="bupareport">    
    <table border="0" width="100%" cellpadding="2" cellspacing="0">
   <tr>
    <td width="8%">Sub Total :</td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Richard)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@AndrewP)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Damien)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@AndrewC)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Tiffany)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@David)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Tony)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Saj)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Miguel)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Viv)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Paula)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Helen)='Yes'])" /></td>
    <td width="6%"> <xsl:value-of select="count($Rows[(@Matthew)='Yes'])" /></td>
    <td width="6%"> </td>
    <td width="8%"> <xsl:value-of select="@AndrewP"> </xsl:value-of></td>
   </tr>
  </table>
  </div>
 </xsl:template>

Similar Messages

  • To count number of records in an internal table for a condition

    Hello All,
            I want to count number of records in an internal table for a condition.
    For e.g. -- I have one internal table IT which having fields F1, F2, F3, F4, F5.
                     Now, I want number of records in itnternal table IT where F1 = 'ABC'.
    Is it possible to do..?? If yes, then how.??
    Thanks in advance...!!
    Regards,
    Poonam.

    Hi,
    If you mean an internal table, there are a few ways to do this.
    1 One would be to loop over the table with a WHERE clause and increment a counter.
    data: lv_counter type i.
    clear lv_counter.
    loop at itab where fld1 = 'ABC'.
    lv_counter = lv_counter + 1.
    endloop.
    lv_counter now has the number of rows per the condiction.
    2  Well, you may want to try this as well, and compare to the LOOP way. Not sure what kind of overhead you may get doing this way. Here ITAB is our main internal table, and ITAB_TMP is a copy of it. Again I think there may be some overhead in doing the copy. Next, delete out all records which are the reverse of your condition. Then whatever is left is the rows that you want to count. Then simply do a LINES operator on the internal table, passing the number of lines to LV_COUNT.
    data: itab type table of ttab.
    data: itab_tmp type table of ttab.
    itab_tmp[] = itab[].
    delete table itab_tmp where fld1  'ABC'.
    lv_count = lines( itab_tmp ).
    Thanks & Regards,
    ShreeMohan

  • Get the Count for each row

    I'm trying to get the count for each row to total count for each month
    Something like this
    Hardware     |      Jan
    Monitors       |       5
    Processors   |      137
    Printers        |      57
    etc........
    How can I write a query for this. I can get the Hardware column but don't know how to get the next column.

    If you can provide more data like sample input DML statements it would have been wonderful..
    Assuming is , you need a pivot. Here is an article on basic Pivot..
    http://sqlsaga.com/sql-server/how-to-use-pivot-to-transform-rows-into-columns-in-sql-server/
    something like this may be..
    DECLARE @Input TABLE
    Hardware VARCHAR(20),
    [Date] VARCHAR(20)
    INSERT INTO @Input VALUES('Monitor', '01/01/2014'), ('CPU', '01/01/2014'), ('Monitor', '01/03/2014')
    , ('ABC', '01/01/2014'),('Monitor', '02/01/2014')
    ;WITH CTE AS
    SELECT Hardware, LEFT(DATENAME(M, [Date]),3) AS [MonthName] FROM @Input
    SELECT *
    FROM
    SELECT Hardware, [MonthName], COUNT(Hardware) AS Count FROM CTE GROUP BY Hardware, [MonthName]) a
    PIVOT (MAX([Count]) FOR [MonthName] IN ([Jan], [Feb])) pvt
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Upload a file where no. of columns for each row is not fixed...

    Hi All,,
    I have to upload a file......
    number of columns for each rows are not fixed ....
    e.g.
    Posting Date     Company Code     Currency     Header Text     Cost Center     Internal Order     Ref 1     Ref 2     Line Text     Account no.     Amount     Account no.     Amount     Account no.     Amount     Account no.     Amount     Account no.     Amount     Account no.     Amount     Account no.     Amount
    31-05-09     1000     EUR     PAYROLL 05/2009     1234     123456     123456     seaman     RU     999999     9,999.99                                                            
    31-08-09     1000     EUR     PAYROLL 05/2009     678     98765     98765     officer     GB     600015     4,560.00      600035     2,125.50      600020     1,325.40      600025     245.75      600030     300.00      280010     1,000.00      281091     6,000.00
    its in tab delimited txt file.....
    how to upload this type of file..
    Plz suggest....
    thnx
    rahul

    Hi,
    Define your internal table like this.
         TYPES: BEGIN OF upload_type,
           upload(330),
           END OF upload_type.
    DATA: itab_upload TYPE STANDARD TABLE OF upload_type,
           wa_upload TYPE upload_type.
    Data: file type string.
    file = 'C:/test.txt'.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = file
                filetype                = 'ASC'
               HAS_FIELD_SEPARATOR = 'X'
           TABLES
                data_tab                = itab_upload
           EXCEPTIONS
                file_open_error         = 1
                file_read_error         = 2
                no_batch                = 3
                gui_refuse_filetransfer = 4
                invalid_type            = 5
                no_authority            = 6
                unknown_error           = 7
                bad_data_format         = 8
                header_not_allowed      = 9
                separator_not_allowed   = 10
                header_too_long         = 11
                unknown_dp_error        = 12
                access_denied           = 13
                dp_out_of_memory        = 14
                disk_full               = 15
                dp_timeout              = 16
                OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Use the sring operations to identify your coloumns.
    Regards,
    Satish

  • :new., lob columns and after insert ... for each row trigger

    I'm having this little problem with
    my update/insert triggers and lob columns.
    I have this little trigger:
    CREATE OR REPLACE TRIGGER BLOB_DATA_INSERT
    AFTER INSERT ON BLOB_DATA
    FOR EACH ROW
    BEGIN
    INSERT INTO BLOB_DATA_CHANGE VALUES(CHANGE_SEQ.NEXTVAL, 'I', :NEW.ID,:NEW.DATA);
    END;
    Which works except when the DATA column
    is a BLOB or CLOB (There is no data in :NEW.DATA. I even tried some of the DBMS_LOB package procedures)
    The one thing that is different for the lob columns is that the application updating
    the data is using a bind statement with returning, like:
    INSERT INTO BLOB_DATA
    VALUES(:ID,EMPTY_BLOB())
    RETURNING DATA INTO :DATA;
    COMMIT;
    Thanks for any help

    I'm having this little problem with
    my update/insert triggers and lob columns.
    I have this little trigger:
    CREATE OR REPLACE TRIGGER BLOB_DATA_INSERT
    AFTER INSERT ON BLOB_DATA
    FOR EACH ROW
    BEGIN
    INSERT INTO BLOB_DATA_CHANGE VALUES(CHANGE_SEQ.NEXTVAL, 'I', :NEW.ID,:NEW.DATA);
    END;
    Which works except when the DATA column
    is a BLOB or CLOB (There is no data in :NEW.DATA. I even tried some of the DBMS_LOB package procedures)
    The one thing that is different for the lob columns is that the application updating
    the data is using a bind statement with returning, like:
    INSERT INTO BLOB_DATA
    VALUES(:ID,EMPTY_BLOB())
    RETURNING DATA INTO :DATA;
    COMMIT;
    Thanks for any help

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • PriceSlider content item always having a fixed value for 'sliderMax' and 'sliderMax'

    Hi,
    I am using ATG-10.2
    I am trying to create the navigation with invoke assembler call (to contentCollection '/content/Shared/Guided Navigation') Everything goes well, except the price slider.
    sliderMin and sliderMax values are always having fixed values, even though there are products with higher prices than this range.
    Ex: This is how my content item looks like
    {enabled=true, @type=PriceSlider, name=Price, filterCrumb=com.endeca.infront.cartridge.model.RangeFilterBreadcrumb@d45e275, sliderMax=1500, sliderMin=0, priceProperty=sku.activePrice}
    But in this search result, there are product which have prices even beyond 10,000
    I hope that the properties I am accessing are correct (contentItem.sliderMin and contentItem.sliderMax).
    Does anyone has seen this before??
    Any solution to overcome this issue. ??
    NOTE: See the attached images here.
    https://qa.endecacommunity.com/questions/2429/priceslider-content-item-always-having-a-fixed-value-for-slidermax-and-sli…

    If you want to get better help post a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html].
    Most of the code you posted is not relevant to your question/problem.
    Also you shouldn't name a JTextArea object jDescrLabel ?
    That's confusing for someone else reading your code.
    Why not use jDescrTextArea ?

  • Are there any apps for having seperate volume controls for each app if multiple apps are playing at the same time?

    Are there any apps for having seperate volume controls for each app if multiple apps are playing at the same time?

    I don't think you can do that the volume is universal, but maybe turn down the volumes in the app settings?

  • How to count number of columns in cross-tab report

    I have created a cross-tab report and have managed to get the data out as below:
                 Jan     Feb     Mar....(display of months will auto expand) Avg/Mo  Total
    UserA     4          3        4                                                                         11
    UserB     6          1        1                                                                          8
    UserC     5          5        5                                                                         15
    Total       15        9        10                                                                        33 
    I want to insert a calculated column (Avg/Mo) into the cross-tab report based on the formula: Total/Number of Months. I used this calculation formula  for Avg.Mo column:
    (GridValueAt(CurrentRowIndex, CurrentColumnIndex+1, CurrentSummaryIndex)/GetNumColumns)
    However, I get the wrong average since GetNumColumns count the total number of columns including the column of Avg/Mo and Total.
    How do i get the number of columns, excluding the Avg/Mo calculated column and Total column?
    PS: I can't use hardcode since the number of months/columns will auto expand the months progress...
    Edited by: jutamind on May 26, 2010 9:27 AM

    ok managed to solve this by slightly changing the formula:
    GridValueAt(CurrentRowIndex, CurrentColumnIndex+1, CurrentSummaryIndex)/(GetNumColumns-2)

  • Count number of columns in query passed as PLSQL parameter

    Hi All,
    I am using a PLSQL package to generate excel file in a Database directory, to generate file i am passing sql query and number of columns manually in a parameter.
    Now i want to automate it and do not want to pass "Number of Columns" as parameter.
    HOW CAN I CALCULATE NUMBER OF COLUMNS IN PASSED QUERY.
    Note: query can contain functions ( to get description or any other data)
    Many Thanks in advance

    http://saubbane.blogspot.com/2011/01/how-to-find-column-count-of-query.html
    Along with Re: Dynamic Fetch on dynamic Sql and just below this post, Blushadow's original run_query (from which I nicked!).

  • SSIS: Count number of columns

    Hi,
    I am processing flat files and I want to make sure that my files will contain the number of columns I expect, because a user might some day input a file with a new column format. If the file does not contain the correct number of columns, process must stop.
    I am planning to input the expected of columns in a User Variable.
    But how do I test for the number of columns in the file, and do I stop the execution?
    Be precise please (do I work in the control flow? in the Data flow?).
    Thanks in advance.
    Paul

    Dear Pauldube
    I think Arthurz is right
     (1) First
     take  one package level variable for storing length of Header row of each and every file
    Eg.         
    Variable Name = FileRowLen
    Variable Type = Integer
    (2) Take one script task and Add FileRowLen
     variable to readwritevariables then edit script
    Add below code :
    Dim FileRowStack as string()
    FileRowStack = System.IO.File.ReadAllLines(FileSource)
    ‘–File source is string variable contain filepath that you want to import
    Dts.variables(“FileRowLen”).value = FileRowStack(0).length
    (3) Now open precedence constraint editor then
    Eveluation operation :  Expression
    Expression  :  @FileRowLen =
     -- Header length of file which would you like to process
    Multiple constraints : Logical or….
    Press OK
    Connector will looks
     like ----------------
    Ramesh Rathod

  • Multi-column Index vs One index for each column

    Hello everyone,
    i have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table.
    The table has 34 columns, no primary key, no unique keys.
    The "where..." clause of the reports usually use 8 columns but some reports uses 8 + some other columns.
    can any one help me on what kind of indexes do i have to create?
    1. one index for each column used in "where clause"
    2. one index for 8 columns and some other indexes for other used columns
    3. one index for all columns
    or something else etc...
    br flag

    i have one table about 20 000 000 rows, some developers have to generate reports on it and i want to create indexes on this table.
    The table has 34 columns, no primary key, no unique keys.
    The "where..." clause of the reports usually use 8 columns but some reports uses 8 + some other columns.
    can any one help me on what kind of indexes do i have to create?
    1. one index for each column used in "where clause"
    2. one index for 8 columns and some other indexes for other used columns
    3. one index for all columns
    or something else etc...What's the version of your data base? what kind of database you have, DWH or OTLP? The answer might depend on the type of database as far as bitmap indexes might suit or might not depending if you are runing DWH or OLTP kind of database
    Let me suppose that you are runing OLTP database and you have a where clause with 8 columns.
    1) are all those where clause equalities (where col1 = and col2 =) or there are inequalities?
    2) could you evaluate the most repetitive columns?
    3) could you know the column that could have the best clustering factor (the column which most follow a certain order in the table)
    Based on that I would suggest to create one b-tree index having 8 columns (even though that it seems for me to high) this index should follow the following points:
    1) put the most repetitive column at the leading edge (and compress the index if necessary)
    2) put the columns that are used in equalitity predicate first
    3) put the column having the best clustering factor first
    The most precise index you have the best access you could gain.
    Of course that you have to know that an index access is not always good and a FULL table scan is not always bad.
    Best regards
    Mohamed Houri
    www.hourim.wordpress.com

  • ITunes 11.0.4. can't locate thousands of files (they are still on the harddisk though) - is there a way to simply relocate them (without having to do it for each individual song which would take forever)?

    After updating to iTunes 11.0.4.,
    iTunes 11.0.4. can't locate thousands of files (they are still on the harddisk though).
    is there a way to simply relocate them (without having to do it manually for each individual song which would take forever)?

    Are these "thousands of files" in an iTunes library that simply cannot be found?
    If so, assuming you know exactly where they are, hold the "Option" key while opening iTunes from your dock.  You will then be given a "Choose Library" option.  Choose it and point to your library.

  • Select count(*) for each row of a table

    Hello All,
    Following query gives a statistics for each user (how many items he owns, home many tickets authored, how many objects he is subscribed to etc...)
    select auser.userid,
    (select count(*) from item where owner like '%' || auser.id || '%') ITEM_OWNER_CNT,
    (select count(*) from tkt where originator = auser.id) TKT_ORIGINATE_CNT,
    (select count(*) from tkt where assigned_to = auser.id) TKT_QA_CNT,
    (select count(*) from tkt where create_user = auser.id) TKT_AUTHOR_CNT,
    (select count(*) from subscriptions where subscriber_id = auser.id) SUBSCRIPTION_CNT
    from
    user auser
    I was not happy with the performance of this query, so I tried the same using group by. The performance was even worse.
    Is there any other option for me to try? Please advice.
    Thanks,
    Sathish

    Hi, Sathish,
    As SBH said, a lot depends on your data. Please post some sample data (CREATE TABLE adn INSERT statemetns) for all tables, and the results you want from that data. Describe and give examples of any relationships that are not one-to-one..
    You probably want to do joings, like SBH suggested, rather than scalar sub-queries.
    The connection between the auser and item tables
    (select count(*) from item where owner like '%' || auser.id || '%') ITEM_OWNER_CNT,is very suspicious. Perhaps the item table is poorly designed, and the query would be faster if that table were changed. Is changing the design of the item table an option?
    You should be able to get all the information from the tkt table in one pass. It looks like you need to unpivot the data, so instead of one row per ticket (with 3 different people connected to it), there are 3 rows per ticket, each with only 1 person referenced. This is not necessarily a bad table design. Unpivoting, even more than most other things, depends on your database version, so you'll have to tell what version of Oracle you're using.

  • Get the length of column for each row in 2d array

    let say if i declared a 2d array
    int [][]set = new int[5][5];
    if i had finished storing datas in the 2d array like the following
    Columns
    row 0[10][10][10][10][10]
    row 1[20][][][][]
    row 2[15][25][30][][]
    row 3[17][12][][][]
    row 4[10][][][][]
    how do we know the the length of each row of the datas?
    for example row 0 had 5 column data , row 1 got 1 col data, row 3 got 3 columns of data..
    is it possible?
    as what i know int set[1].length() = 5 and is not 1... am i right?

    as what i know int set[1].length() = 5 and is not
    1... am i right?No, there is no parenthesis for the array property length
    Lets suppose you create this 2-D array;-
    int [][]array = {{1,2,3,4},
    {5,6,7,8},
    {10,11,12,13},
    {15,16,17,18} };
    EG:-
    This is array[0][0]= 1;
    This is array[1][0]= 5;
    This is array[2][2]= 12;
    This is array[3][1]= 16;
    int first = array[0].length; // will initialise 'first' to a value of 4

Maybe you are looking for

  • Is there a way (app) to divide a Thunderbolt monitor into sections?

    I recently switched from dual 23" monitors to a 15" MacBook Pro with a Thunderbolt Display. The large display makes some tasks cumbersome because the application palettes fall on opposite sides of the monitor with a huge workspace in between. I may s

  • How to include a page conditionally ?

    Hi all ! I have a web page made of different sections. Every section is included in a separate page.      <f:view>           <h:form>                             <%@ include file="filters.jsp" %>                  <%@ include file="dataTableAdmin.jsp"

  • Ible to install software version 2 on an iPod with version 1 software

    Can I install software version 2 on an iPod running software version1?

  • Modeling recursive Business Object in Oracle SOA Suite 11g

    I'm trying to model a complex Business Object (named Prenda) that contains an attribute of the same type of the object (Prenda) using JDeveloper 11g. This is my xsd <?xml version="1.0" encoding="UTF-8"?> <?bpmo version="11.1.1" build="6.84" fullName=

  • Unable to enter a negative amount for payment

    I am trying to enter a negative amount for payments under order items, but I keep getting this error message: "The minimum accepted payment amount for 'Financing' is '0'. Please enter an amount greater than '0' to continue.(SBL-SFS-00167)". The payme