Question about inputting data to a pivot table

Hi,
I have 2 questions about using the ADF pivot table component (I would like it for data input).
1. Is it possible to paste into multiple cells (i.e. using cut in Excel for example, and then pasting the cells into the pivot table) ?
2. What is the recommended approach for the case where there is no data values (no rows on the database table)? For example, if I have regions, products, measures and time periods and then want to be able to select some regions and some products to enter new sales figures - and then create the rows on the database with save button, is there a recommended way to do this?
(Jdeveloper version: 11.1.2.0.0)

Anybody able to help with this?

Similar Messages

  • Question about tranferring data from iPhone 3gs to iPhone 4

    I just had a couple quick questions about transferring data from my old phone from my new iPhone 4. The reason i am wondering is because i am worried about whether i will encounter any problems when doing so.
    First off i have already sold my phone today, i reset all data and settings from the phone and gave it to my buddy so its gone. I did a full sync and backup yesterday so all the necessary files should be on my computer(windows 7). Now, im basically wondering if i will run into any problems if i restore my iphone 4 from a backup. My 3gs was running 3.1.2 on att. Now i know IDEALLY i would have updated it to iOS 4 before backing it up and used the newest version of itunes, but i did not. Does anyone think this will be a problem for me?
    Now with that out of the way, my biggest fear is losing my old data(text messages and notes mainly because i am a pack rat for those type of things) so id like to be SURE that none of my old backups will be deleted in any scenario. The reason i dont just restore it right now is because i want my new phone to be as clutter free as possible. I am going to be putting on here only the apps that i used often and would basically like to transfer over the BARE minimum; texts, notes, and highly used apps... So i guess my main question is can you transfer over only certain things like texts and notes after setting up the phone as a new phone. And if i were to set up the phone as a new phone what would happen to my old backups? Would i be able to selectively restore?
    Im afraid that it might not be a possibility to transfer only certain things even though it should be.. i should be able to select a text messages folder and put it on my new phone and be done with it... But anyway i dont want to rant. Can anyone explain to me how this all will work?
    ULTIMATE GOAL: Transfer only texts, notes, certain apps(and their data) and NOTHING ELSE.
    MOST IMPORTANT THING: Not losing texts and notes. I can deal with putting all the old **** on my new phone and cluttering/slowing it down if i NEED to.
    Thank you in advance, sorry for the long post.

    If the most important thing for you is keeping old text messages, notes, and voicemail, then you'll need to sync the phone from your existing backup. I know of no other way to access those items.
    Once you have synced to the new phone, check that you have those items that were important. Then you can reconnect your phone to iTunes, and change the sync settings to remove the apps or other items you no longer want to keep on the phone.
    iPhone backups are stored by iTunes; you can see them by opening your iTunes preferences, clicking on "Devices" and then looking in the window. You can delete old backups from here. I don't know how you can open/read the backups though.
    I don't expect you'd have any problems syncing from your old phone's backup, but it's definitely an either/or situation. Since you got rid of the old phone already, it's too late to email yourself your notes, or copy the text messages. Your previous backup is your only solution.

  • Question about displaying data

    Based on the search criteria I need to show some info. with check box on each item, but it might retrun upto fifty items (between 1 to 50 items). Should I create checkbox/output text dynamically or how do I handle this scenario? In the jspx how do I loop it and display? Thank you.

    hi user13094256
    See my reply in your other forum thread with the same question
    at Question about displaying data
    regards
    Jan Vervecken

  • How to update ADF VO object to refresh the data in ADF Pivot table

    I need to know how to update the View object so that the date in pivot table is refreshed/updated/filtered.
    here are the steps I performed to create ADF pivot table application using VO at design time.
    1) created a collection in a Data Control (ViewObject in an ApplicationModule) that provides the values I wanted to use for row and column labels as well the cell values (Used the SQL query)
    2) Dragged this collection to the page in which wanted to create the pivot table
    3) In the pivot table data binding editor specified the characteristics of the rows (which attribute(s) should be displayed in header), the columns (likewise) and the cells.
    Now, I have a requirement to update/filter the data in pivot table on click of check box and my question is how to I update the View object so that the date in pivot table is refreshed/updated/filtered.
    I have got this solution from one of the contact in which a WHERE clause on an underlying VO is updated based upon input from a Slider control. In essence, the value of the control is sent to a backing bean, and then the backing bean uses this input to call the "filterVO" method on the corresponding AppModule:
    but, I'm getting "operationBinding" object as NULL in following code. Please let me know what's wrong.
    here is the code
    Our slider component will look like
    <af:selectBooleanCheckbox label="Unit" value="#{PivotTableBean.dataValue}"
    autoSubmit="true" />
    The setDataValue() method in the backing bean will get a handle to AM and will execute the "filterVO" method in that, which takes the NumberRange as the input parameter.
    public void setDataValue(boolean value) {
    DataValue = value;
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("filterVO");
    Object result = operationBinding.execute();
    The filterVO method in the AMImpl.java will get the true or false and set the where Clause for the VO query to show values.
    public void filterVO(boolean value) {
    if (value != null) {
    ViewObjectImpl ibVO = getVO1();
    ibVO.setWhereClause("PRODUCT_TOTAL_REVENUE(+) where rownum < 10");
    ibVO.executeQuery();
    }

    Did you define a filterVO action in your pagedef.xml file?
    You might want to read on how to access service method from a JSF Web Application in the ADF Developer Guide for 10.1.3 chapter 8.5

  • DATESYTD (or any Time Intelligent Function) Working Off Other Data Besides Date in the Pivot Table

    I am working on a project where I need to count the number of events from the start of the year to the end for each year in the data with each event counting the current event and any previous events sequentially.  My results should look like the following:
    MarketNameDate
    MarketCount
    2012-09-11|Kansas City
    1
    2012-09-18|Denver
    2
    2012-09-25|Chicago
    3
    2012-10-02|Seattle
    4
    2012-10-09|Phoenix
    5
    2012-10-16|Tampa
    6
    2012-10-23|Norfolk
    7
    2012-10-30|Alexandria
    8
    2012-11-06|San Jose
    9
    2012-11-27|Dallas
    10
    2012-12-04|Fort Lauderdale
    11
    2013-01-15|Los Angeles
    1
    2013-01-22|Orange County
    2
    My formula is as follows :=calculate(distinctcount(Event_Table[MarketNameDate]),datesytd(dates_dimensions[date_value]),all(dates_dimensions)).  This formula works correctly when I am using the Date_Dim table to drive the analysis in the Row Label or
    Column Label in my Pivot Table.  My events table is connected directly to Date_Dim table and I would like to use the [MarketNameDate] field instead. 
    I need to get a rolling count of the number of markets through the year, but roll up on [MarketNameDate] instead of anything out of Date_Dim.  Is this possible or do the Time Intelligence functions require you to only use Date_Dim columns as Row Label
    or Column Label in my Pivot Table.
    I would also be happy to have an alternative way of solving the problem if there is a way to do it.
    Here is an approximation of the data I am using.
    Seminar_Events
    Event_Type
    Market
    MarketNameDate
    MarketMinDate
    Preview
    Kansas City
    2012-09-11|Kansas City
    9/11/2012 0:00
    Workshop
    Kansas City
    2012-09-11|Kansas City
    9/11/2012 0:00
    Preview
    Denver
    2012-09-18|Denver
    9/18/2012 0:00
    Workshop
    Denver
    2012-09-18|Denver
    9/18/2012 0:00
    Preview
    Chicago
    2012-09-25|Chicago
    9/25/2012 0:00
    Workshop
    Chicago
    2012-09-25|Chicago
    9/25/2012 0:00
    Preview
    Seattle
    2012-10-02|Seattle
    10/2/2012 0:00
    Workshop
    Seattle
    2012-10-02|Seattle
    10/2/2012 0:00
    Preview
    Phoenix
    2012-10-09|Phoenix
    10/9/2012 0:00
    Workshop
    Phoenix
    2012-10-09|Phoenix
    10/9/2012 0:00
    Preview
    Tampa
    2012-10-16|Tampa
    10/16/2012 0:00
    Workshop
    Tampa
    2012-10-16|Tampa
    10/16/2012 0:00
    Preview
    Norfolk
    2012-10-23|Norfolk
    10/23/2012 0:00
    Workshop
    Norfolk
    2012-10-23|Norfolk
    10/23/2012 0:00
    Preview
    Alexandria
    2012-10-30|Alexandria
    10/30/2012 0:00
    Workshop
    Alexandria
    2012-10-30|Alexandria
    10/30/2012 0:00
    Preview
    San Jose
    2012-11-06|San Jose
    11/6/2012 0:00
    Workshop
    San Jose
    2012-11-06|San Jose
    11/6/2012 0:00
    Preview
    Dallas
    2012-11-27|Dallas
    11/27/2012 0:00
    Workshop
    Dallas
    2012-11-27|Dallas
    11/27/2012 0:00
    Preview
    Fort Lauderdale
    2012-12-04|Fort Lauderdale
    12/4/2012 0:00
    Workshop
    Fort Lauderdale
    2012-12-04|Fort Lauderdale
    12/4/2012 0:00
    Preview
    Los Angeles
    2013-01-15|Los Angeles
    1/15/2013 0:00
    Workshop
    Los Angeles
    2013-01-15|Los Angeles
    1/15/2013 0:00
    Preview
    Orange County
    2013-01-22|Orange County
    1/22/2013 0:00
    Date_Dimensions
    date_value
    1/1/2012 0:00
    1/2/2012 0:00
    1/3/2012 0:00
    1/4/2012 0:00
    1/5/2012 0:00
    ETC
    There is a relationship created between Date_Dimensions[Date_Value] and Seminar_Events[MarketDateName]
    Any help would be very much appreciated.
    Kind Regards,
    John

    If you want a running count on MarketNameDate, you need to create a numeric ranking of that column in a new calculated column in your Events table.
    Something like:
    Rank = RANKX(ALL(Events), [MarketNameDate], ,1)
    You should also add a year calculated column in that table:
    Year = YEAR([MarketMinDate])
    Once those are in place, this measure should work for you:
    MarketCount:=
    CALCULATE(
    DISTINCTCOUNT(
    Events[MarketNameDate]
    FILTER(
    ALL(Events),
    Events[Rank] <= MAX(Events[Rank])
    && Events[Year] = MAX(Events[Year])
    Mike, can you check out this thread?
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/a2e22d61-7c32-43f2-900e-d9d6325fa26d/needed-more-answerers?forum=sqlkjpowerpivotforexcel
    Thanks!
    Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Can I 'explain' data in a pivot table?

    Hi All.
    I have a request that has baffled me.
    I need a way to use 'text' to describe the results of a report. If I were doing a simple report,
    this would be a non-issue. Here are my hurdles:
    I have a report that uses a Union via Set Operations (so I'm combining two result sets).
    The results are then shown in a pivot table.
    Within the pivot table, variances were created using 'New Calculated Item' under measures.
    I want to be able to display in a narrative, or some other magical technique, the results of theses calculated items.
    Data Example:
    <pre>
    Date1 Date2 Variance Variance%
    Total Sales 10 20 10 50.00
    Sales have increased 50% compared with last quarter. (<- desired result)
    Today, I can show @1, @2 etc, but it only shows the columns under 'Date 1'.
    Any help is greatly appreciated!!
    Cindy

    First, if you design a report correctly (e.g., accurate and descriptive headers, etc.), you greatly reduce the need for an "explanation of data." It should be intuitive. If it is confusing to understand, the design of the report should be looked at. (Is this report illustrating what the user needs to see? Should I use a graph instead of a table or vice-versa? Am I reporting on the right metrics?)
    That being said, it may be helpful at times to have a narrative to give an overall view of what the report displays. For this, you have the Narrative View to explain whatever might make the report more useful to the end-user. For example, you may have them note certain conditions and what that would mean, etc. (Conditional formatting would be great for this, unless you are considering cross-column conditioning in which case conditional formatting doesn't work.*)
    But if you are looking for row-by-row explanations where you use the data in the row as part of the "explanation" (as inferred by your inclusion of @1 and @2, etc. in your question), then I think you may be trying to please your end-users a bit too much. Perhaps I have misunderstood you, so I shall end here and wait for your response.
    *Until 11g, that is. There are also workarounds...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to input data in a database table without knowing in advance table and column configurations

    Hi,
    I have a problem using LabVIEW for input data (manually) in a SQL database. I have about 40 tables in the database, each of them is related to a specific engine component. I need to create a user interface (maybe visualizing the table with a table control) where the users can insert data in the database table fields. Could someone give me some suggestion on how to do it?
    Using the  DB tools insert data.vi I need to know in advance the column configuration of the table, but in my database each table has its own structure! So do I have to create 40 different masks, one for every different table?
    Thanks in advance.
    Michela

    I have not actually used the LV SQL Toolkit, but I will try and offer high level ideas :-)
    when you have retrieved the construction data for a table, you should be able to use array and cluster indexing to aquire the names of the fieds, enough to create a labelled table on the LV Front panel.
    After completing a new entry you can INSERT the entry into the database using the same data.
    Is the SQL toolkit an additional purchase, or included in newer versions as standard? If you post a sample of the cluster/array that you retrieve, I could give you a sample VI to give you some pointers in creating the User Interface table 
    - Cheers, Ed

  • NEED HELP - - Inputting data files into a table, Selecting from previous to put in new table, Saving new table

    I am trying to import data characters from a tab delimited file into a table in labview.  After I import the strings, I want to be able to select individual strings from the table and put into another table.  I want the item that I am selecting to appear in a text box labeled 'selected step'.  After I put all of the selected data in the new table, I want to be able to save that table in another tab delimited file (spreadsheet).  This is what I have so far.  Any help given will be GREATLY appreciated. 
    Attachments:
    Selector.zip ‏30 KB

    Hi,
         Here are modifications to your vi to do what you are describing. It helps, when trying to work through issues like these on this forum to not start a new thread with each iteration of your question. Those of us that are trying to help can follow it better if you just "Reply" to your previous thread with the new, related question. If the question is for a totally new issue then a new thread is best, but when you are working through the details of essentially the same problem it really helps us follow it if you stay in one thread, and that usually means faster answers.
    We also like it if, when an answer helps, you give us a rating (the more stars the better) as it is about all we get out of it!
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion
    Attachments:
    SelectorV2.zip ‏30 KB

  • Sql developer: question about exporting data

    Hi,
    we're recently working with sql-developer. i've got a question about how we can export query results to txt/csv files for use in other applications.
    First a problem: if we start a query that looks like this:
    select * from
    select * from A where start_date = &date
    ) a,
    select * from B where start_date = &date
    ) b
    where a.name = b.name
    Sql-developer asks twice to input a value for the variable 'date', although it's the same variable and it's supposed to have the same value.
    We solve this by making a script:
    first we define the variable, then we put the query.
    When we start the script, the query runs ok and sql developer asks to input the value for the variable once.
    But now the result of the query is shown in the script output. The script output seems to be limited in number of lines and difficult to export.
    So my question is: what's the best way to export query results to txt/csv files, avoiding the problem mentioned above?
    i hope there is a solution where we can use a single query or script.
    Thanks in advance!

    Using bind variables like ":date" should solve the problem of being asked twice for the same thing.
    Executing the query normally (F9), gives you the export options you require through the context menu inside the Results grid.
    Regards,
    K.

  • Percentage of Total Count of Category in Raw Data Column in Pivot Table

    I have normalized my data in Excel and I have a column: "question 1" and then a column for "gender" which has values as "female" and "male". I have created a pivot table for these two variables, "Gender" and
    "Question 1". My values for Females and Males from the Gender data are presented within my pivot table. I want to present these numbers as percentages of Total "Females" and "Males" that are in the "Gender" column in
    my master dataset. Pivot tables will only allow me to do %'s of data already in the pivot table
    I am attempting to use Calculated Fields within Pivot Tables to resolve this. I do not want to create a separate column in my master data set, but rather, complete all calculations within the pivot table

    Thank you very much, 
    The steps you provided use the total "gender" within the pivot table as the "grand total". 
    If I have a binomial variable, "gender" with "male" as one of the variables, I need the grand total be the total male in the raw data. 
    Example: if there are 100 total males in the raw data for the column "gender"
    and I construct a pivot table with a dependent variable which is a survey question and "gender"  and 30 males "agreed" with the survey question and 20 females "agreed" with the survey question, your instructions for % of grand total would show 60% for
    males who agree [males + females who replied to the survey question],
    when, what I need is the total males in the raw data, 100, used as the total so that the percentage of males who answered "agreed" to the survey question is 30% of all males. 
    Thank you very much

  • Question on how to create a pivot table

    Hi,
    I am trying to create a dynamic pivot table (the number of column and row layers change for each request) and I cannot use a data base structure to back it up.
    I thought of doing it through a managed bean but in order to do it I need to know how to create the PivotTableModel.
    The pivot table model requires a data source object and I do not know how to create it to support multiple row and column layers.
    Is there a default data source object that I can extend, or better yet is there a written example on how to create a pivot table model using a managed bean.
    Thanks,
    Or

    Hi,
    duplicate of ADF -11g : Question on how to create a pivot table

  • A simple question about DAQ data sampling

    Hi all:
    Now I meet a very basic question about DAQ sampling.  I am using NI PCI-6040E DAQ card, SCXI-1001 chasis, SCXI-1102, SCXI1300 terminal block, and SCXI1160 relay module.
    I am not sure , is it possible if I want to test a voltage (1 volt) on a resistor. Now I am connecting the Ch0+ to resistor+ (24 volt), and connecting Ch0- to resistor-(23 volt). So the voltage between resistor+ and resistor- should be 1volt.  Actually, It is working at the first, but after I want to test 9 channels based on this connection. The Measurement & Automation can't read data from the DAQ card. (when I test it by multimeter, I can get the voltage data on the Ch0+ and Ch0- of SCXI1300 terminal block).
    That's strange, does anybody know what' s wrong about it?/
    Thanks a lot

    Hi hanwei,
    According to the specifications of the PCI 6040E (page 3), the input signal and common mode voltage should never exceed 11V from ground.  I believe this is the reason you are able to measure the potential of a battery but not the 24V signal (even though the differential value is only 1V). 
    Best Regards
    Hani R.
    Applications Engineer
    National Instruments

  • MSSQL Query/View Single Line Output For Combined Multiple Data Elements - Possible Pivot Table?

    HELLO...
    I hope you experts out there can help me.  Consider the following (2) Tables in MSSQL:
    1. TENDERED --> Primary Key = DATE / DOC_NO / PAYMENT_SEQ_NO
    DATE
    DOC_NO
    PMNT_SEQ_NO
    PAYCODE_TYPE
    AMOUNT
    2. TENDERED_CR_CARD -->Primary Key = DATE / DOC_NO / PAYMENT_SEQ_NO
    DATE
    DOC_NO
    PMNT_SEQ_NO
    CR_CARD_NO_MASKED
    CR_CARD_NAME
    CR_CARD_EXP_DATE
    These two tables are certainly related, based on their Primary Key values.
    Now, consider the following data in those two tables:
    DATE            
    DOC_NO      PMNT_SEQ_NO              
    PAYCODE_TYPE               
    AMOUNT
    03/10/2014         100001 
    1             
    CASH            
    100.00
    03/10/2014         100001 
    2             
    CASH                             
    -9.75
    03/10/2014         100002 
    1             
    CASH                             
    50.00
    03/10/2014         100002 
    2             
    VISA                             
    100.00
    03/10/2014         100002 
    3             
    VISA             
                   250.00
    03/10/2014         100003 
    1             
                            MC
    125.00
    03/10/2014         100003 
    2             
    AMEX           
    75.00
    DATE          
    DOC_NO PMNT_SEQ_NO  CR_CARD_MASKED     
    NAME            
    CR_CARD_EXP
    03/10/2014  100002   2                       4225******801289  
    MARY JONES   2016/08/31
    03/10/2014  100002   3                       4121******637442  
    JOHN DOE      2015/04/30
    03/10/2014  100003   1                       5428******971134  
    MIKE BAKER   2018/09/30
    03/10/2014  100003   2                       3732*****344756    
    LINDA LIU      2017/07/31
    OK...so what we NEED...is a Combined, SINGLE RECORD Audit Report type query. 
    The resulting query should show, based on the Data from above, the SINGLE LINE represented in the Attached Spreadsheet. 
    NOTE...what's important to point out here..is that ONLY the 'CASH' Tender gets "summed"...EACH INDIVIDUAL Credit Card record MUST have its own Field...as represented in the corresponding Columns of the Spreadsheet (i.e. PMT_TYP_1, AMT_1, PMT_TYP_2,
    AMT_2, and so forth).
    PLEASE HELP!  Any suggestions/advice would be most appreciated! 
    Thank You!...Mark

    I would not do this in SQL if I could possibly avoid it.  Instead do it in the front end.
    If you must do it in SQL, this is a dynamic pivot on multiple columns.  Naomi Nosonovsky has a blog at
    http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/dynamic-pivot-on-multiple-columns/ on how to do that.  Look especially at her second example using the claims table.  Of course, you must do some manipulation even before you do the multi-column
    pivot, since you must first combine all the cash entries.
    So one way to do it would be to build a temp table with all the entries you have except the cash entries combined into one payment sequence number.  To do that you may need specifications that are not clear to me from what you have given us.  For
    example, if PMT SEQ 1 is VISA,  PMT SEQ 2 is CASH, PMT SEQ 3 is VISA, PMT SEQ 4 is CASH, and PMT SEQ 5 is VISA, you want to combine the two cash payments.  So they become PMT SEQ 2?  If so, what happens to PMT SEQ 4 - is it left N/A or does
    PMT SEQ 5 become PMT SEQ 4?
    But once you have this temp table with the cash payments combined in the algorithm you need, then you can use Naomi's method to do the multi-column pivot.  Note that Naomi uses the code
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_Name = 'Claims'
    to get the column names from the permanent table Claims.  To get the column names from a temp table use code like the following.  To find the column names in a temp table named #MyTempTable, do
    From tempdb.sys.columns
    Where object_id = OBJECT_ID('#MyTempTable')
    But as I say, if feasible, I would do this in the front end, not in SQL.  T-SQL is a very good language for storing and retrieving data, not so good at formatting it. 
    Tom

  • TSQL query to calculate Count / Sum grouping by date on a Pivot Table

    Hi All
    I need help to group the pivot table output to group by dates and sum/count the values. I have a table like shown below.
    Date
    Student 
    Subject
    Hunt
    Marks
    18/02/2014
    Sam 
    Maths
    1
    20
    18/02/2014
    Sam 
    Maths
    1
    10
    18/02/2014
    Sam 
    Maths
    2
    30
    18/02/2014
    Luke
    Science
    1
    50
    17/02/2014
    Sam 
    Maths
    2
    50
    17/02/2014
    Luke
    Science
    2
    60
    16/02/2014
    Luke
    Science
    2
    20
    16/02/2014
    Luke
    Science
    3
    20
    I want to Group by dates and move the Hunt to columns calculating their counts and sum their marks too. Like given below.
    I wrote a pivot query like below but If i group it with dates and calculate the total marks it throws aggregate errors.
    Create Table Student_Log ([Date] datetime ,Student varchar (20), Subject varchar (20) ,Hunt int ,Marks int )
    Go
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Sam ','Maths','1','20')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Sam ','Maths','1','10')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Sam ','Maths','2','30')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Luke','Science','1','50')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-17 15:00:00.000','Sam ','Maths','2','50')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-17 15:00:00.000','Luke','Science','2','60')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-16 15:00:00.000','Luke','Science','2','20')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-16 15:00:00.000','Luke','Science','3','20')
    Go
    select * from Student_Log
    select [DATE] , [Student], [Subject] ,[1],[2],[3],[4],Total =([1]+[2]+[3]+[4])
    from
    ( select [Date], [Student], [Subject],[Hunt],[Marks] from Student_Log
    )x
    pivot
    count ( [Hunt]) for [Hunt]
    in ([1],[2],[3],[4])
    )p
    order by [Date] desc
    I have done this far only. More than this I need to enhance it with the Percentage of Hunts for each Student.
    ie like below table.
    On 18th Sam in Maths he had 2 rows on 1st hunt  and 1 row on 2nd hunt. So On the Pivot table is it possible to represent it on percentage using the Total Attempts column.
    Thanks a lot in advance.
    Its runnung in SQL 2000 Server.

    Create Table Student_Log ([Date] datetime ,Student varchar (20), Subject varchar (20) ,Hunt int ,Marks int )
    Go
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Sam ','Maths','1','20')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Sam ','Maths','1','10')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Sam ','Maths','2','30')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-18 15:00:00.000','Luke','Science','1','50')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-17 15:00:00.000','Sam ','Maths','2','50')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-17 15:00:00.000','Luke','Science','2','60')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-16 15:00:00.000','Luke','Science','2','20')
    INSERT INTO Student_Log ([Date],Student, [Subject],Hunt,Marks) VALUES('2014-02-16 15:00:00.000','Luke','Science','3','20')
    Go
    select * from Student_Log
    ;with mycte as
    Select [Date], [Student], [Subject] ,
    Count(CASE WHEN [Hunt]=1 Then Hunt End) as Hunt1,
    Count(CASE WHEN [Hunt]=2 Then Hunt End) as Hunt2,
    Count(CASE WHEN [Hunt]=3 Then Hunt End) as Hunt3,
    Count(CASE WHEN [Hunt]=4 Then Hunt End) as Hunt4,
    Count(CASE WHEN [Hunt]=1 Then Hunt End)
    +Count(CASE WHEN [Hunt]=2 Then Hunt End)
    +Count(CASE WHEN [Hunt]=3 Then Hunt End)+
    +Count(CASE WHEN [Hunt]=4 Then Hunt End) as Total,
    ISNULL(SUM(CASE WHEN [Hunt]=1 Then Marks End),0) as Mark1,
    ISNULL(SUM(CASE WHEN [Hunt]=2 Then Marks End),0) as Mark2,
    ISNULL(SUM(CASE WHEN [Hunt]=3 Then Marks End),0) as Mark3,
    ISNULL(SUM(CASE WHEN [Hunt]=4 Then Marks End),0) as Mark4
    from Student_Log
    Group By [Date], [Student], [Subject]
    Select [Date], [Student], [Subject]
    , Cast(Hunt1*1./Total*100 as int) as [1]
    , Cast(Hunt2*1./Total*100 as int) as [2]
    ,Cast(Hunt3*1./Total*100 as int) as [3]
    ,Cast(Hunt4*1./Total*100 as int) as [4]
    ,Total,Marks=( Mark1+Mark2+Mark3+Mark4)
    from mycte
    order by [Date] DESC, Student desc
    drop table Student_Log

  • ADF -11g : Question on how to create a pivot table

    Hi,
    I am trying to create a dynamic pivot table (the number of column and row layers change for each request) and I cannot use a data base structure to back it up.
    I thought of doing it through a managed bean but in order to do it I need to know how to create the PivotTableModel.
    The pivot table model requires a data source object and I do not know how to create it to support multiple row and column layers.
    Is there a default data source object that I can extend, or better yet is there a written example on how to create a pivot table model using a managed bean.
    Thanks,
    Or
    Edited by: user638363 on Dec 18, 2008 7:02 AM

    Hi,
    beyond the documentation, the pivot table is described in
    http://technology.amis.nl/blog/2593/adf-faces-11g-reloading-the-matrix-using-the-pivot-table-component
    http://technology.amis.nl/blog/3786/creating-a-salary-heat-map-with-the-adf-11g-faces-pivottable-component
    http://technology.amis.nl/blog/3673/adf-11g-richfaces-a-closer-look-at-the-pivot-table-data-visualization-component
    I am not aware of any sample that directly meets your requirement
    Frank

Maybe you are looking for

  • Agents in workflow

    Hi, I'd like to know somehing about the agents in workflow. As far as I know there are 3 types of agents: 1. Responsible Agents 2. Possible Agents 3. Actual Agents. I want to know why there are 3 types of Agents and how they are dependent on each oth

  • OEM prompts for username and password

    Hi, We have on 11g database and if we try to click on performance tab it prompts for user/password. How to avoid this? My user account is active at database level. Not sure why it prompts again. This is not happening for all databases.

  • Windows detected HDD problems on my Satellite L30

    Hi I have a Satellite L30-113 for about 2 months now, when I switch in on today this message came up the following hard disk are reporting failure. disk name toshiba MK6037GSX ATA device volume C/: and asking me to back up the hard drive switch it on

  • How to override "All My Files" and restrict search to a single external hard drive?

    I've got 3 large external hard-drives--WD, Seagate, iOmega--connected to my iMac to contain a sprawling music collection.  I'm working on deduping, etc., but each attempt to search a single hard drive results in my search being shunted to "All My Fil

  • Update 10.5. to Snow Leopard V 10.6 - Safari problem

    I have updated from 10.5 to Snow Leopard V. 10.6, now I can't open SAFARI.  It advises that "this version {5.0.6} can't be opened with this version??  I would have thought that when I loaded the upgrade to Snow Leopard that Safari would have updated