11g: automatic group by unused column

Hi,
I've got this problem:
I have report with just one measure. This measure should be aggregated over a selectable dimension.
Therefor I build a dashboard prompt, which saves the selected dimension in a presentation variable.
(btw: a column selector would be the easier way, but there are more than one report which should react on this dashboard prompt)
Then I used a "case when" in the report to differ between the selection:
case when [presentation-variable] = 'Dim1' then Dim1.col1
when [presentation-variable] = 'Dim2' then Dim2.col1
end
Now I would expect such a physical SQL:
select
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end,
sum(...)
from
group by
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end;
But OBIEE creates such one:
select
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end,
sum(...)
from
group by
Dim1.col1,
Dim2.col1,
case when [presentation-variable] = 'Dim1' then Dim1.col1 when [presentation-variable] = 'Dim2' then Dim2.col1 end;
So of course the wrong the measure is aggregated wrong, because it is grouped by a column, which i do not want to use.
Could it be the Problem, that this 2 columns are logical level key of a dimension hierarchy?
Anybody got a idea, how I could suppress this group by?

Hi,
Just 4 hours ago, someone else had a very similar question:
Group by fails on ORA-00979
Personally, I consider that a bug in Oracle 10. When you do a GROUP BY on a view, you can't expect the SQL engine to look at the view definition, and determine if one of the columns can be derived from another.
In practice, it's easy enough to add c1u to the GROUP BY clause, or to use MAX (c1u) instead of c1u, to make your query work.

Similar Messages

  • Why do Terminal Window Groups Get 2 Columns Wider Every Launch?

    I set up 3 terminal windows of different sizes, place them where I want, and save as a "Window Group." Then I set this Window Group to be used when launching Terminal.
    Lion has introduced a bug whereby every time you launch the Terminal app, each window in the Window Group gets wider by 2 columns. It is 100% reproducible and incredibly annoying.
    For example, follow these repro steps:
    Launch Terminal. Your first window in the group is 140 columns wide, just as you saved it.
    Quit Terminal.
    Launch Terminal. Your first window in the group is 142 columns wide. The other windows are similarly wider by 2 columns.
    Quit Terminal.
    Launch Terminal. Your first window in the group is 144 columns wide. Again, the other windows are also wider by 2 columns.
    ... and so on...
    If you select "Window > Open Window Group" and choose the same group, it will open them at the intended sizes. However, this doesn't solve the problem.
    Is there a work around to prevent this?
    Thanks,
    Tim

    a fix from apple will probably take some time (apple is not fast about bugs they consider minor).  in the meantime, you can use something like the following as a workaround.  copy the following into a plain-text editor and save it as <whatever>.applescript (somewhere out of the way - it doesn't matter where you save it so long as there are no permissions issues).
    tell application "System Events"
              set terminalPlist to property list file "~/Library/Preferences/com.apple.Terminal.plist"
              tell terminalPlist
                        set defaultWindow to value of property list item "Default Window Settings"
                        tell property list item "Window Settings"
                                  tell property list item defaultWindow
                                            if value of property list item "columnCount" ≠ 80 then
                                                      set value of property list item "columnCount" to 80
                                            end if
                                  end tell
                        end tell
              end tell
    end tell
    You could also save this as a compiled script (.scpt) using script editor; doesn't really matter.
    Then, copy the following into a plain-text editor and save it as user.terminal.widthFixer.plist (the name doesn't really matter, so long as it ends in .plist), in the folder ~/Library/LaunchAgents.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>user.terminal.widthFixer</string>
              <key>ProgramArguments</key>
              <array>
                        <string>osascript</string>
                        <string>/Users/<yourname>/path/to/script.scpt</string>
              </array>
              <key>WatchPaths</key>
              <array>
                        <string>/Users/<yourname>/Library/Preferences/com.apple.Terminal.plist</string>
              </array>
    </dict>
    </plist>
    <yourname> should be your short user name, obviously, and the path in the ProgramArguments array should point to the script.  Log out and log back in, and this script should (in the simplest case) automatically reset the window width.
    caveats:
    I can't test this (the external disk with my Lion installation died), so I can't guarantee it will work out of the box
    depending on whether the increment occurs at startup or shutdown, you may need to set columnCout to 78 instead of 80 to get the right final size
    make sure you use a plain-text editor (TextWrangler, TextEdit in plain text mode, or any programmer's editor).  using a formatted text editor will mess things up.
    if you have a complex setup you may need to reset Window Settings other than the default one. All this means is changing tell property list item defaultWindow to tell property list item "window settings name".  adjustments should not be difficult, but post back with details if you need specific instructions.

  • Creating a radio button group in a column of a table in Web Dynpro

    Hi,
    I want to put a radio button group in a column of a table in Webdynpro. I added a column to a web dynpro view and then inserted a tableCellEditor for that column.. But I cannot define it as Radio Button group. I want the user to be able to select 3 statuses using this group.
    Does anyone have a solution for this??
    Thanks in advance...
    Nakul

    Hi,
    You wont be able create three RB in one cell.
    Create as many column as the no of options is.Here it is 3.
    Create 4 attributes inside the node , option 1,option 2,option 3 and selectedoption.
    Map each RB s keytoSelect to option 1,2,3. Map all the RBs selectedKey atribute to selectedoption.
    Now selection for each row will be stored in the selected option.
    Regards
    Bharathwaj

  • Set unused column

    Sir
    i am new to database.I am doing an oracle course on 051.My oracle faculty is saying
    Set unused column option will hide the column for-ever.user can't retrieve it again.
    what i believe if a statement is hiding a column there must be some option to regain it.
    Is there any option of to make an unused column to reusable again?

    Hi,
    i am new to database.
    Is there any option of to make an unused column to reusable again?Since you're new:
    Try to find your answers in the Oracle documentation as well, as it explains clearly how 'Oracle things' work, with examples and you can do quick searches on keywords of your interest.
    Example: http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#sthref2329
    You should bookmark: http://tahiti.oracle.com and start reading the concepts and fundamentals when you've got some spare time.
    assuming you're on 10g

  • Dropping Unused column

    Hi All,
    I am working on version 11.2.0.3.0 ( windows server 2008 ).
    While dropping unused column i am getting below error
    SQL> create table er (ab varchar2(50), aa varchar2(50)) compress;
    SQL> alter table er set unused column ab;
    Table altered.
    SQL>
    SQL>
    SQL>
    SQL>
    SQL> alter table er drop unused columns;
    alter table er drop unused columns
    ERROR at line 1:
    ORA-39726: unsupported add/drop column operation on compressed tables

    i can't do such things for these number of tablesThat is the funniest thing I've heard in a while. If you can "alter table xxx drop unused columns," why can't you do what is suggested.
    And no, it's not a bug.
    And no, there is not "another way around"

  • Drop unused column in compressed table

    Good day for all.
    I have partitioned compressed table under 10.2.0.4 database. I need to remove column, and did it according metalink note 429898.1, but then i execute command alter table .... drop unused columns, i got error ORA-39726 (unsupported add/drop column operation for compreseed table), so it mean that proposed workaround don't works now.
    Does anyone have new workaround for this problem?

    alter table MY_TABLE set unused(MY_FNG_COLUMN);
    -- success
    alter table MY_TABLE drop unused columns;
    -- error

  • Grouping by 2 columns. Please see

    Hi,
    I am using Reports 9I.
    I need to use two group by's :
    Table:
    TRANS_ID   ACC_ID DEL        CCY        AMT TRADE_DAT LENDER
    LEL0002045 SLEND  RECEIVE    GBP       1200 02-AUG-05 LENDERA
    LEL0002053 SLEND  DELIVER    GBP       1000 02-AUG-05 LENDERA
    LEL0002100 SLEND  DELIVER    USD        500 02-AUG-05 LENDERB
    LEL0002000 SLEND  DELIVER    KRN       1000 03-AUG-05 LENDERC
    LEL0002002 SLEND  DELIVER    KRN       1000 03-AUG-05 LENDERA
    LEL0002001 SLEND  DELIVER    GBP       1000 03-AUG-05 LENDERA
    REPORT
    LEL0002045 SLEND  RECEIVE    GBP       1200 02-AUG-05 LENDERA
    LEL0002053 SLEND  DELIVER    GBP       1000 02-AUG-05 LENDERA
    LEL0002001 SLEND  DELIVER    GBP       1000 03-AUG-05 LENDERA
    LEL0002002 SLEND  DELIVER    KRN       1000 03-AUG-05 LENDERA
                      RECEIVE    GBP       1200
                      DELIVER    GBP       2000
                      DELIVER    KRN       1000The break is on DEL and then on the CCY (ie currency).
    I am using the flwg SQL Query in my report:
    SELECT trans_id,
            acc_id,
            decode(DEL,'RECEIVE', AMT,0) as REC_AMT,
            decode(DEL,'DELIVER', AMT,0) as DEL_AMT,
            ccy,
            amt,
            trade_date,
            lender
    FROM    TableAand using SUMMARY cols to sum the AMT for column DEL
    But now,i need to sum also on column CCY.How do I sum AMT first on col DEL
    and then on col CCY?
    Is my SQL query proper? Any suggestions to modify this ?

    You provided following format:
    ccy    transid    accId  rec      Amt
    lenderA
    GBP    LEL001     SLEND  RECEIVE  1000
    GBP    LEL002     SLEND  RECEIVE  1200
    GBP    LEL003     SLEND  DELIVER  1000
    USD    LEL004     SLEND  RECEIVE  1000
                      RECEIVE GBP     3000
                      DELIVER USD     1000
    BUT, I THINK YOU WANTED IN THIS FORMAT
    GBP    LEL001     SLEND  RECEIVE  1000
    GBP    LEL002     SLEND  RECEIVE  1200
    GBP    LEL003     SLEND  DELIVER  1000
    USD    LEL004     SLEND  RECEIVE  1000
    RECEIVE GBP 2200
    DELIVER GPB 1000
    RECEIVE USD 1000
    If i am right, then you need two groups, one on LENDER and other rest of the column, lets say it 'DETAIL'.
    Create 4 formula columns in detail group
    First Formula Column:
    if :del = 'RECEIVE' and ccy = 'GPB'  then
       return(:amt);
    else
       return(0);
    end if;
    Second Formula Column:
    if :del = 'RECEIVE' and ccy = 'USD'  then
       return(:amt);
    else
       return(0);
    end if;
    Third Formula Column:
    if :del = 'DELIVER' and ccy = 'GPB'  then
       return(:amt);
    else
       return(0);
    end if;
    Fourth Formula Column:
    if :del = 'DELIVER' and ccy = 'USD'  then
       return(:amt);
    else
       return(0);
    end if;
    Create four summary column in LENDER group based on these formula columns and reset at LENDER.
    Put these summary column in repeating frame of LENDER.
    This will work if you are only dealing with 'USD' and GBP'

  • Group By one column

    I have one table as below
    CREATE TABLE [dbo].[emp](
        [EmpId] INT,
        [EmpName] VARCHAR(20),
        [SAL] INT,
        [DeptId] INT
    ) ON [PRIMARY]
    I want to select all column with group by one column
    SELECT EmpId, EmpName, SAL, DeptId FROM Emp GROUP BY DeptId
    Is it possible ?
    Is there any other way to achieve this?
    Deepak Talele Ph: 91-9158413830 Email: [email protected], [email protected]

    Hi,
    If you want to select all the columns then what is the need of group by?
    Group By normally used when you have math function in your query like, SUM() , COUNT(), MIN(), MAX() etc
    Could you please provide us with sample output that you are trying to achieve.
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • How to recover the unused column

    According to the spec, 'set unused' does not actually remove the target columns and the column data remains in the table's rows. but if a column was marked as unused, there are no any access to the column. then why the clause is released?is it better than drop column?if the unused columns exist still,why there are no clause to restore it?

    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2913496610745#2914947431112

  • Selectively Format Groups with Multiple Columns

    I have a bit of an obscure task I've been trying to hammer out to no avail.  I've searched quite a bit but can't seem to find anyone else who has attempted this.  I have two group by statements, one is a category and the other is a rank.  What I'm trying to do is organize the report so that there are category rows and below each category row is a set of columns for each rank with their associated values as such:
    category1
    rank1     rank2     rank3     rank4
    value1   value1    value1   value1
    value2   value2    value2   value2
    category2
    rank1     rank2     rank3
    value1   value1    value1
    value2   value2    value2
    I've tried using details>Section Expert>>Layout>Format Groups with multiple column.  Unfortunately, this applies to both groups putting the categories into columns instead of rows, making a mess.  Does anyone know of a way to selectively put groups into columns and ensure alignment?  In the above example the user would be able to compare rank values from multiple categories since they all line up.  Any help with this would be very much appreciated.

    Hi,
    Have you tried using a crosstab? Give this a shot:
    1) Group the report on Category
    2) Create a new group header section. Group Header b
    3) Place a crosstab in this section
    4) The columns would be the Rank field, I'm not sure about what you would like to show in the rows
    5) The summarized field would be the Value field ofcourse
    Let me know how this goes.
    -Abhilash

  • Groups and Multi Column Reports

    I'm using CR for .Net 2003.  I've been running into a problem with the grouping feature, where groups are spanning multiple columns and are not being kept together, but only when spanning b/w columns.  However, the groups aren't being broken between pages.  Anyone else running into this?  Here's my setup:
    Page Header
    Group Header
    Details
    Group Footer
    Page Footer
    The "Group Header", "Details" and "Group Footer" are all set to Keep Together in the Selection Expert.  The layout of the "Details" section has "Format Groups with multiple Columns" checked.  (I only have two columns)  And my group options has the option "Keep Group Together" selected. 
    I was under the impression that if I have "Keep Group Together" it would keep the group together regardless of an end of page, or an end of column...but, maybe I have something misconfigured.
    advTHANKSance for any help!

    Confirm version of Crystal Reports and version of .NET.
    Also, have you applied any Service Packs to your version of CR?
    Ludek

  • I have a one-column table in pages.  Each cell has text and a number separated by a colon.  Can I automatically make it two column with everything to the right of the colon in the second column?

    I have a one-column table in pages.  Each cell has text and a number separated by a colon.  Can I automatically make it two column with everything to the right of the colon in the second column?

    Here's another way that is pretty quick to do.
    Formula in Column B is:
    =LEFT(A, FIND(":", A))
    Formula in Column C is:
    =RIGHT(A, LEN(A)-FIND(":", A))
    You can eliminate the colon from the result in column B by writing:
    =LEFT(A, FIND(":", A)-1)
    Once you do the conversion, you should freeze the result by Selecting columns B and C and then Command-C, Edit > Paste Values.
    Regards,
    Jerry

  • TS1627 Please Help. I received 4 emails from 1 person with the same message heading. The emails were automatically grouped by Mail. I replied to the latest mail in the conversation. Once sent the other messages in the conversation disappeared. I NEED THEM

    Please Help. I received 4 emails from 1 person with the same message heading. The emails were automatically grouped Apple Mail. I replied to the latest mail in the conversation. Once sent the other messages in the conversation disappeared. I NEED THEM BACK! They all had very important attachments. I have tried looking for them in deleted items, even though I didn't throw any of them away, still cant find them. Never had this problem before. I'm pretty sure its a setting somewhere. Also tried expanding all conversations, no luck. Searching for the mails under the sent email address, no luck.
    I'm sure they are not deleted but have somehow been hidden by Mail. Very frustrating.
    Thanks in advance for any help.
    Kash.

    I have found found out what has happened. I had requested a statement dating back to April 2012 from a supplier. They replied back with the latest statementof 2013 only but used the same subject heading as the previous monthly statements. Apple Mail automatically grouped these and I thought that they were sent altogether. As soon as I replied to the last email all other the previous emails ungrouped from the conversation leaving me lost as to where they had gone. They were all still sitting in my inbox but no longer part of the trcked conversation. I searched under the subject heading and all individual mails were all still there. (feeling stupid - )

  • Looking for good tool to report on unused Mailboxes, unused Distribution Groups, and unused Public Folders

    I have evaluated the following products.
    Quest (Dell) MessageStats
    Enow
    StealthAudit
    StealthAudit looked to be the best as they also group like mailboxes with like permissions for Office 365 migrations, but this was by far the most expensive.
    We are looking to clean up our environment to eventually migrate to Office 365.  Any advice on a product that would report on unused Mailboxes, unused Distribution Groups, and unused Public Folders that would be great.
    d

    Hi,
    In your case, you can use the following cmdlet to determine unused mailboxes. If a mailbox has never logged on, the Lastlogontime is empty.
    Get-Mailbox|Get-MailboxStatistics |fl DisplayName,Lastlogontime
    Use the cmdlet below to get publicfolder's last access time.
    Get-PublicFolderStatistics |fl name,LastAccessTime
    Get all distribution lists used over last 30 days.
    Get-MessageTrackingLog -EventId Expand -ResultSize Unlimited |Sort-Object RelatedRecipientAddress | Group-Object RelatedRecipientAddress |Sort-Object Name | Select-Object @{label=”PrimarySmtpAddress”;expression={$_.Name}}, Count
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • DROP UNUSED COLUMN

    Dear Guru’s
    I have a situation where I need to drop specific columns which are set to unused!
    Say, I have 3 unused columns in a table – and now I want to drop only one unused column from that.
    SQL> alter table scott.emptest set unused (ENAME);
    Table altered.
    SQL> alter table scott.emptest set unused (COMM);
    Table altered.
    Once I set some columns un-used, now I want to drop only one un-used Column “ENAME”
    SQL> alter table scott.emptest drop column ENAME;
    alter table scott.emptest drop column ENAME
    ERROR at line 1:
    ORA-00904: "ENAME": invalid identifier
    which in turn throws this error!
    Help appreciated!
    Thanks in advanced
    Ravi Prakash

    SCOTT@demo102> create table tbl_25 as select * from emp
    SCOTT@demo102> /
    Table created.
    SCOTT@demo102> desc tbl_25
    Name                                      Null?    Type
    EMPNO                                              NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    SCOTT@demo102> alter table tbl_25 set unused (deptno)
    SCOTT@demo102> /
    Table altered.
    SCOTT@demo102> alter table tbl_25 set unused (comm);
    Table altered.
    SCOTT@demo102> desc tbl_25
    Name                                      Null?    Type
    EMPNO                                              NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    SCOTT@demo102> select * from all_unused_col_tabs where table_name ='TBL_25';
    OWNER                          TABLE_NAME                          COUNT
    SCOTT                          TBL_25                                  2
    SCOTT@demo102> alter table tbl_25 drop unused column;
    Table altered.
    SCOTT@demo102> select * from all_unused_col_tabs where table_name ='TBL_25';
    no rows selected
    SCOTT@demo102> Nicolas.
    Add queries on all_unused_col_tabs.
    Message was edited by:
    N. Gasparotto

Maybe you are looking for

  • Crossing Out Old Calendar Events in iCal

    Hey Guys! I'm a big time list guy, and love crossing things off once they're done. I would love to find a way to cross off (in full month view) previous days on iCal. I don't want to delete events, because I often go back and look at previous dates f

  • Business Area not coming in FS10N layout.

    Dear SAP Friends, I am working in a client where "Document Splitting" was activated on the basis of "Business Area" from the 1st August,2008. In this client their is four business areas. When I am getting the balance sheet as per Business Area in F.0

  • How to resolve problems in policy file of signed Applet

    Hi to All, I want to connect the web site through my Signed Applet which is working as a Proxy server. but i m facing certain problems in my policy file: this is my policy file :- grant { permission java.security.AllPermission "", ""; permission java

  • Multiple WLC LobbyAdmins

    Hello, My understanding is that I can authorise multiple Lobby Admins on a WLC 4404 using RADIUS. I was wondering is if is possible to create Lobby Admin groups so that a specific Lobby Admin can only grant guest wireless access to specific Mobility

  • How do I retrieve the my iCloud data off of my old, unusable iPhone without sacrificing the data off of my current iPhone?

    Firstly, I have 2 iCloud accounts, which creates constant confusion (considering I have a third "apple" acct. as well).  I have not found any solutions (even the genius bar has been unhelpful) for this, but my current major issue is with storage spac