Pivot table help?

Is there a way to add just a single cell to a table containing relevant information, but not something that needs a whole column?

DECLARE @Class TABLE
  ID int, 
  Lines int, 
  Percentage int
INSERT INTO @Class
values
 (1, 2, 100)
,(2, 1, 100)
,(3, 2, 50)
,(3, 4, 50)
,(4, 5, 40)
,(4, 4, 10)
,(4, 3, 50)
SELECT * FROM @Class
select
id,
isnull(max(case when lines=1 then percentage end),0) as Line1,
isnull(max(case when lines=2 then percentage end),0) as Line2,
isnull(max(case when lines=2 then percentage end),0) as Line2,
isnull(max(case when lines=3 then percentage end),0) as Line3,
isnull(max(case when lines=4 then percentage end),0) as Line4,
isnull(max(case when lines=5 then percentage end),0) as Line5
from @Class
group by id
--Prashanth
  

Similar Messages

  • Pivot table HELP in OBIEE Answers!!!

    Hello,
    I am having some problems in a “pivot table”, “Sections” and “Calculated Items” I have a section called 'e) External Income' and I would like the value reverted from a negative to a positive. In excel or any other form of calculation you can do this by * -1 (negative 1). However this statement does not work as a Calculated Item. This is the statement I am using = 'e) External Income'*-1 and I get the following error message “The semantics of the formula entered are not valid”.
    I have also tried = 'e) External Income'-('e) External Income'+'e) External Income') this will give you it as a minus also but I have no error message this time, but the values stay the same.
    Can this be done any help would be very appreciative.
    Thank you
    John

    I cannot change the folmula in the critera tab because this will chnage my values on the other 'Bins' I have created. Ref your other question i have a list of account codes and i have grouped ones together to create 4 "Bins". If i change the formula for one of the Bins it will chnage it for all of them but I only need it on the 'e) External Income'

  • Request in Pivot Table - HELP

    Hi,
    I have created a request in Pivot Table. Rows section Include Product Domain column and Columns Section Includes Month ;
    measures section contains columns gross, profit, loss and YTD %. I want YTD% column to appear after Dec month and it is should come only once.
    In my request it is getting repeated for every month.
    It should look like following way,
    -------------------------------|-------Jan-----|------Feb------|-------Mar------|-------Apr------|--------YTD %
    =========|======|========|========|=========|=========|-------------------
    -------------------|-Gross
    Prod Dom 1-----|-Profit
    -------------------|-Loss

    you can include month to measures and other column row level and apply aggregation
    Edited by: Chack on 20 May, 2010 12:06 PM

  • Help in Pivot Table (or another ways)

    I need to do following view in the report,can anyone tell me how can I do that??
    This is original report:
    DATE          AMOUNT1 AMOUNT2 AMOUNT3
    01/02/2009 5 6 7
    02/02/2009 2 3 4
    I want to change this view into this:
    01/02/2009 02/02/2009
    AMOUNT1 5 6
    AMOUNT2 6 3
    AMOUNT3 7 4
    How can I do this? Please help me..

    Have a look here:
    http://obiee101.blogspot.com/2008/05/obiee-pivot-table-measure-label.html
    regards
    John
    http://obiee101.blogspot.com

  • Help with pivot tables in excel

    Hello,
    I need some help with a very specific issue I am getting in excel.
    So, I have this pivot table that gets data from an external source (a huge database) and everything is working fine.
    The problem comes with some lines in our database that are written in asian letters (the thai alphabet). Every thai entry that we import appears like ????????.
    I can look into the DB (via MySQL Workbench) and everything is alright in there. I can also just copy some of the content into excel and the letters shows up normally.
    Is there something I can do to fix it?
    Thank you very much
    Daniel Ayres

    I can see it is working fine for roman/latin characteres, and it is not working for thai or japanese characteres. Since I dont have data written using the russian or the arabic alphabet, there is no way I can tell you if it would or not work..

  • Required Help in Pivot Table

    Dear
    i am working on BI Publisher Desktop Version and trying to generate a RTF Template in which pivot table has to be used
    Below is the format of my XML File.
    -<G_C1>
    <R>1</R> row 1
    <C>1</C> column 1
    <C1>1300001 ASL 112531 2</C1>
    <C2>1 10 1.5</C2>
    <C3>120000105 12.5</C3>
    <C4>120000105 </C4>
    <C5>OPeration</C5>
    </G_C1>
    -<G_C1>
    <R>1</R> row 1
    <C>2</C> column 2
    <C1>1300001 ASL 112531 2</C1>
    <C2>2 10 1.5</C2>
    <C3>120000106 12.5</C3>
    <C4>120000106 </C4>
    <C5>OPeration</C5>
    </G_C1>
    -<G_C1>
    <R>1</R> row 1
    <C>3</C> column 3
    <C1>1300001 ASL 112531 2</C1>
    <C2>3 10 1.5</C2>
    <C3>120000107 12.5</C3>
    <C4>120000107 </C4>
    <C5>OPeration</C5>
    </G_C1>
    ......... and sow on till row 16 and column 8
    i am facing two issues,
    first i have to show 5 columns in cross product, but pivot table option shows option for 4 columns only
    secondly characters are not shown when i preview the template its shows 'NnN' in all columns
    Kindly help me in generating the template.
    I have to define the template in XML Publisher of Oracle E-Business Suite R12
    Regards,
    Muhammad Usman

    check these samples
    http://winrichman.blogspot.com/2008/08/pivot-table-cross-table-with-fixed.html
    and
    https://blogs.oracle.com/xmlpublisher/entry/new_skool_crosstabbing
    i will let you if i know i get anything.

  • Need help on Pivot Table

    Hi all,
    We are having 6 measures. My requirement is that all the 6 measures needs to placed in rows one after other(each measure in one row) And in column level Fiscal year should be displayed to the corresponding 6 measures. Is this possible in pivot table...
    Kindly help..urgent
    Thanx in advance...
    Regards,
    Naresh

    Place measure lables in the rows and year column in column and all the measures in measures

  • Help me regarding pivot table group by

    Hi ,
    i am developing an bi publisher rtf template using ms word .
    i had an issue with pivot table.
    i have a table something like this
    table_code     Indicator1     year     value
    1                    a                2008     20
    1                    a                2009     40
    1                    b                2008     10
    2                    a                2008     20
    2                    a                2008     20
    2                    a                2008     20
    in table view i am doing this .. i am grouping my table by table_code
    <>TABLE_CODE
    INDICATOR1 YEAR VALUE
    INDICATOR1 YEAR VALUE
    By doing so , i am getting all the tables in my database
    like
    1
    indicator      year      value
    a                 2008     20
    a                 2008     10
    a                 2009     20
    2
    indicator      year      value
    a                 2008     20
    a                 2009     20
    b                 2008     20
    . so on
    Now i want pivot table view like
    1
    Indicator    2008   2009    2010
    a                20     30         40
    b                10     40         40
    2
    Indicator    2008   2009    2010
    a               20     30         40
    b               10     40         40
    how can this be achieved??
    how to create a group by in pivot table? where to write the group by clause?
    struck here from 1 week. any help will be appreciated .
    Thank You,
    Sunny.

    i have to use table_code also in the view??
    C H ACCTABLE_CODE
    INDICATOR1
    G YEARE
    G RSTABLE_CODE
    G INDICATOR1
    G 999.00E E
    and where to write the code.outside the table or  on which tag?? and what to write.
    please help me.
    Thanks

  • Pivot table problem. Please help me create this report

    Hi friends..I'm new to OBIEE. We can create the grand total column in pivot table. I need grand total as well as Grand average. How can I create a new column in pivot table that is same as grand total but calculates average.
    My table structure is like this.
    Facility......Date........totaldays
    A..........01/01/08......210
    B..........01/01/08......215
    C..........01/01/08......917
    A..........02/01/08......211
    B..........02/01/08......211
    C..........02/01/08......911
    A..........03/01/08......210
    B..........03/01/08......215
    C..........03/01/08......917
    I need the report like this..
    Facility.....01/01/08......02/01/08....03/01/08...Total....AVG
    A...............210.............211............210.....631......210.3
    B...............215.............211............215.....641.....213.6
    C...............917.............911............917.....2745....915
    For this report..I created pivot table but I'm not able to calculate the average..
    Can you please help..I'm new to OBIEE...
    Thanks in advance

    Please change your username....
    Here is what you need to do...
    1) In the Pivot Table View, click on the Measures column and select New Calculated Item.
    2) In the pop-up window complete as follows:
    Name: type "Total Average"
    Function: Select "Average" from the drop-down window.
    Click on the values in the right pane that you wish OBI to calculate the average for.
    3) Click "OK."
    You now have another column that is the average of the values in each row.

  • Help in Pivot Table

    Hi
    How to show grand total two times in pivot table?is it possible
    Thanks in Advance

    Have a look here:
    http://obiee101.blogspot.com/2008/05/obiee-pivot-table-measure-label.html
    regards
    John
    http://obiee101.blogspot.com

  • Help wiht multi pivot table

    Hi
    I have searched pivotand not sure if what I see will work for me. here is what I have
    table
    ssn,benefit_id,plan_id, option_id
    123456789,MEDICAL,BCBS,80/20
    123456789,MEDICAL,ATENA,1020
    I need a pivot table where i can put the ssn and then all benefit_id,plan_id, option_id combinations in the table into a pivot table sorfor above I have
    123456789,MEDICAL,BCBS,80/20,MEDICAL,AETNA,1020,etc
    I have this working
    SELECT ssn,
    LTRIM(MAX(SYS_CONNECT_BY_PATH(benefit_id,','))
    KEEP (DENSE_RANK LAST ORDER BY curr),',') AS benefits
    FROM (SELECT ssn,
    benefit_id,
    ROW_NUMBER() OVER (PARTITION BY ssn ORDER BY benefit_id) AS curr,
    ROW_NUMBER() OVER (PARTITION BY ssn ORDER BY benefit_id) -1 AS prev
    FROM emp_ben_elects)
    GROUP BY ssn
    CONNECT BY prev = PRIOR curr AND ssn = PRIOR ssn
    START WITH curr = 1;
    IN 9.i
    How do I add the plan_id and option_id?
    Any Ideas?

    Hi,
    If you use Rob's approach, change the second argument of SYS_CONNECT_BY_PATH to something that will not appear in the first argument.
    That is, don't say:
    SYS_CONNECT_BY_PATH ( benefit_id || ',' || plan_id || ',' || option_id
                        , ','     -- WRONG: Causes ORA-30004
                        )Instead, do something like:
    SYS_CONNECT_BY_PATH ( benefit_id || ',' || plan_id || ',' || option_id
                        , ';'     -- Assumes semicolon never appears in columns above
                        )If you really want to have the same character that separates fields (',' above) used to separate records, too (instead of ';', above) use REPLACE on the string returned by SYS_CONNECT_BY_PATH:
    REPLACE ( SYS_CONNECT_BY_PATH ( benefit_id || ',' || plan_id || ',' || option_id
                                  , ';'     -- Assumes semicolon never appears in columns above
            )I wouldn't use CONNECT BY at all. I suggest the user-defined STRAGG function, which you can copy from astom
    After installing STRAGG, your entire query will just be
    SELECT    ssn
    ,         STRAGG  benefit_id || ',' || plan_id || ',' || option_id)
    FROM      emp_ben_elects
    GROUP BY  ssn;Unlike your original query, the records will not necessarily appear in any particular order.
    If you want that, STRAGG can be used as an analytc function.

  • IF statement in Calculated Field for Share point, doesnt calculate sum in my Excel Pivot table.

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

  • Can any one tell how to create pivot table

    Hi ,
    Am trying to create a pivot tabel in the MDM Import Manager. Iam able to see the preview of the pivot table which i want to create. But when i try to click "OK" button, an error message getting displayed like...
    "The new table cannot be created because the data source is not updatable.You may need the data source to an updatable format such as Microsoft Access before proceeding".
    Due to the above error am not able to create pivot table, plz let me know if any one know how to solve this problem
    Thanks & regards
    Praveen k

    Hi Praveen ,
       The solution to your problem is -
    The data source must be updateable in order for MDM to
    create the new pivot or reverse pivot table. However, you can still
    perform the steps leading up to table creation – including the preview –
    even on a data source that is not updateable, so that you can explore
    pivoting or reverse pivoting as a transformation option. If you then
    decide you want to actually create the new table, convert the data
    source into a format that is updateable (such as Microsoft Access) and
    perform the pivot or reverse pivot on the new data source.
    To create a pivot table, you must identify the source fields that
    participate in the pivot, which ones contain metadata and which ones
    contain data, which ones must be combined, the one-to-one
    correspondence between metadata and data fields and/or field
    combinations, and the key field or fields.
    To create a pivot table:
    1. In the drop-down list of source tables, make sure the table you want to
    pivot is the current source table.
    2. In the Source Hierarchy tree, select all the field nodes corresponding to
    both the metadata fields and the data fields by which you want to pivot.
    3. Right-click on one of the nodes and choose Create Pivot Table from the
    context menu, or choose Source > Create Pivot Table from the main
    menu
    4. MDM opens the Create Pivot Table dialog
    5. In the Key Fields dual-list drop-down control, move one or more fields
    from the Available Fields list to the Selected Fields list to identify the
    key fields on which to perform the pivot
    6. In the dual-list control of fields, drag-and-drop the data fields from the
    Field Values Become Field Names list to the Field Values Become
    Field Values list
    7. If necessary, select two or more fields in either list that must be
    combined into a field combination, and click on the Combine button, or
    right-click on one of the fields and choose Combine from the context
    menu
    8. If necessary, drag-and-drop fields or field combinations within each list
    to create the one-to-one correspondence between metadata fields and
    data fields.
    9. Click on the Preview button to display a preview of the first ten records
    of the pivot table
    10. When you have verified that the pivot operation you have defined will
    have the desired effect, click OK to close the Create Pivot Table dialog.
    11. The MDM Import Manager creates a new table named “table <Pivot>”
    in the data source (where “table” is the name of the original source
    table).
    12. In the drop-down list of source tables, select the newly created pivot
    table on which to perform subsequent import processing.
    Hope that helps ...
    Regards
    Deepak Singh

  • 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...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Not able to see data in Pivot table

    Hi,
    I have a issue with pivot table i have a column which displays values 0 and 1 and another column called month when i am placing this month column as a section and values column as a measure i am not seeing any values means i can see the month as header but instead showing 0 or 1 its showing blank columns. previously i created similar kind of table it worked but at that time values column data type is number this time its char. can anybody help me out how i can see the data in the pivot table. i already tried converting this column to number but still i am not able to see data in that values column.
    Thanks

    Hi copter,
    Place the month column in rows and value column in measure section and check if results are coming.If still it doesnt come i suppose you dint apply aggregation rules to value column.In pivot view click values column and aggregate by /select min or max or either server complex and check your results.
    (I suppose your aggregation rules is default)....Correct this one and you can place it in sections as per your requirement.
    Cheers,
    KK

Maybe you are looking for

  • Upgrade to iTunes 8 and Music Vanished!

    I cursory search didn't find anyone else with this problem. However, I don't think I can be the only one... I upgraded to iTunes 8 on my MacBook without issue. I upgraded to iTunes 8 on my iMac and most of my library vanished. Gone. Arrrrgh. I carefu

  • Error while creating Refurbishment Order

    Dear Frnds, I am trying to create a refurbishment order, while creating its throwing an error message "Valuation type SP_REP does not allow in-house production". I have done the following steps. 1. Created order in IW31 with order type PM04. 2. Menti

  • Error while refreshing the XI runtime cache

    Hello All,    Here is what happened. After PI7.0 install with client 001, I did the BPM scenario and it worked. After the performing the client copy the BPM stopped working with the new client. I did the client copy per note 940309. The file is getti

  • 3D layer disappears in After Effects CS6

    When I turn a layer into a 3D layer it disappears.  If i turn draft 3D on it will reappear, or if I preComp it will reappear. continuous rasterize is not on so its not that.  Active camera is set in preview window, so its not front view thing. this i

  • Import a garageband for iOS song always shows a 0% below projects.

    It is just after I uploaded songs from my iOS garageband (newest version and iOS), I can see my projects on the "import a garageband for iOS song" window (also the latest version), but there were 0%s under the projects. I clicked the project icons bu