Help!! Can't do SORT in GROUP ABOVE style

Hi, I tried to build a report by using GROUP BY styple, then I try to SORT the output data by using ORDER BY in my query, it didn't work, does anybody know how to do this? is that anything to do with GROUP BY report style?
the SQL statement is like:
Select...
From...
Where...
Order by....
I really appreciate any one can help me on this. Thanks.
Joe

Hi,
That's something I also had to do.
Ad here's how this works.
Suppose you have:
Select ...
from ...
where ...
order by name;
Yet in your data model, in your group the fields appear, let's say, in the following order:
date
name
So, Reports will sort within the group first by date.
The answer is that your fields should appear in the data model in the order you wish to have them sorted. Thus, in the example, you should have:
name
date
Frankly, I don't really like the way it works. Yet, it's just that simple.
Hope this will help,
BD.

Similar Messages

  • Need urgent help on mailing lable report in group above style

    Hi
    I need to prepare a report on reports 6i in mailing lable style based on group above style (multiple levels) e.g. yellow page directory. can anybody help me.
    rgds

    Hi,
    That's something I also had to do.
    Ad here's how this works.
    Suppose you have:
    Select ...
    from ...
    where ...
    order by name;
    Yet in your data model, in your group the fields appear, let's say, in the following order:
    date
    name
    So, Reports will sort within the group first by date.
    The answer is that your fields should appear in the data model in the order you wish to have them sorted. Thus, in the example, you should have:
    name
    date
    Frankly, I don't really like the way it works. Yet, it's just that simple.
    Hope this will help,
    BD.

  • Converting a Group Left to a Group Above Report

    I have created a dozen group left reports which I thought would only take up one page of data. I have found that some of them will actually require more pages but the report will only produce 1 page.
    As an example I created the same report but used the group above style and this time by default it creates multiple pages. So how can I change my other reports into the group above style - note I cannot use the wizard as I have made many layout changes which woujld be lost.

    It's not because of Group Left vs Group Above that report display only the first page. Make sure the Print Object On property of the repeation frames set to First Page Only, not All Pages.

  • Problem in creating group above AND group left in one report!

    Hi all,
    I need a report that is a combination of group above and group
    left.
    Suppose I have 3 table (Emp, Sales, Product):
    Emp Table has 2 column
    - Emp_PK
    - Emp_Name
    Sales Table has 4 column
    -Sales_PK
    -Sales_Date
    -Emp_FK
    -Produck_FK
    -Quantity
    Product Table has 3 column
    -Product_PK
    -Product_Name
    -Product_Price
    I want to make Employee Sales Report For The Month that will
    look like this:
    Emp Number___: Emp_PK
    Emp Name_____: Emp_Name
    Sales Date______Product_Name____Quantity \(2 sales
    ________________Product_Name____Quantity /the date)
    Sales_Date______Product_Name____Quantity
    As you can see this consist of group above (The Employee) and
    group left (The Sales and Product).
    I create this by using 2 queries and link them (the Emp_PK from
    1st query and Emp_FK from 2nd query) on the report builder using
    data link.
    The first query is:
    Select Emp_PK, Emp_Name from Emp
    The second query is
    Select Emp_FK, Sales_Date, Product_Name, Quantity
    From Sales, Product
    Where Product_PK=PRODUCT_FK
    I then create the layout for second query and choose group left
    for Sales_Date using wizard and I create additional layout to
    for the employee.
    The problem is that when I run this report, it will print ALL
    the employee record first (including employee who has NOT sale
    anything) and then on the last page it will print the record of
    Last employee on the Emp table and ALL sales record (including
    those that is done by other employee).
    This report will run correctly if I choose an exact employee
    (For example by adding Where Emp_PK=1111 in the first query) to
    report all of the sales done by this person (employee with emp
    number of 1111). However I need the report to run and print
    ONLY those employee who has Sales Records!
    I thought that by linking the 2 queries in Data Model, it will
    have the same effect as linking using the WHERE clause in query.
    If suppose I create a query like this:
    SELECT Emp_PK, Emp_Name, Sales_Date, Product_Name, Quantity
    FROM Emp, Sales, Product
    WHERE Emp_PK=Emp_FK AND Product_PK=Product_FK
    The report will run OK but I can only choose EITHER group above
    or group left for this ONE query methods in report Wizard.
    Sorry if it is a long question but I hope you can see what I am
    trying to do.
    Thanks in advance for any tip.

    hello,
    of course you can create group left and group above blocks in a
    single report.
    you might want to use the INSERT REPORT BLOCK instead of the
    report wizard, as the report wizard only allows you to use one
    report layout per report, where the report block wizard (invoked
    by INSERT REPORT BLOCK) allows you to choose on a per-block
    basis.
    of course you can create the blocks completely from scarth by
    hand, if you want to.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Group above report - help please

    Good Morning,
    I'm trying to create a group above report that resembles the following:
    LETTER TYPE: 00001
    BATCH TOTAL NOREPLY
    1234 3 1
    2345 2 0
    TOTAL VOL. FOR LETTER 00001 5
    I've tried using:
    select ltrtype, batch, count(reply)
    from ltr
    where reply = 'N'
    group by ltrtype, batch
    which does give me the correct figures under the NOREPLY Heading, but I can't get the correct figures for the TOTAL heading (NOTE: The figures in the TOTAL column should be a total of both the reply = 'Y' and reply = 'N' for the ltrtype and batch - the figures in the NOREPLY column should be a total of only the reply = 'N' for the ltrtype and batch.) I hope this explanation is clear
    I've also tried eliminating the where clause, but then I get the correct figures under the TOTAL heading, but I can't get the correct figures for the NOREPLY heading.
    I've also tried using two queries and a data link, but I couldn't get that to work either.
    Any help would be greatly appreciated.
    Thanks.

    Go to report wizard and check the groups and fields tabs. Otherwise map the repeating frames accordingly.

  • How can I have header only once in group above rep

    Hi
    I have developed a group above report and i see that the main header is repeated for every row (that is group by row). How can I have that only once per page or report and not repeat for every record?

    The "main header" must be inside the repeating frame. Put the repeating frame in its own non-repeating frame, put the header in its own frame inside this frame at the top.
    It sounds like you are using the report wizard... if so, don't.

  • Break Column in Group Above Report - Causing Error in Data Groupings

    Since I'm required to designate at least one Break Column in my Group Above report, I created a dummy column in my SELECT statement. I did this so that I could designate the required minimum of at least one break column, but I designated one that won't have any impact on how the report is ordered, because it will be the same value (NULL) for every record. So, my SELECT statement starts out looking something like this:
    SELECT
    NULL break_column,
    column_1 column1_name,
    column_2 column2_name,
    column_3 column3_name,
    column_4 column4_name,
    column_5 column5_name
    I needed for the break column to have no impact on the ordering of the report because I need for the ORDER BY clause to completely control how the report is sorted, w/o any interference by a hard-coded break column. I need this because my intention is to make the ORDER BY clause dynamic, and a hard-coded break column with actual data would supercede the ORDER BY clause, thereby making it static.
    Everything is working correctly with regard to how the report is sorting the records designated as group columns; however, the detail columns are getting all messed up as far as what main record they're grouped under.
    By this I mean that when I designate only one break column, some details may display under the wrong group, where they're not supposed to. For example, each page consists of demographic info. about a specific record on a table, and the details listed under it should be the individual comments that have been made on that record. The issue I'm seeing is that for some records, it's showing comments from not only the record for that group, but it continues to list out comments made for other requests as well, when those comments should be displayed under their own respective records.
    Why is this happening when I designate only one break column, and how can I keep it from doing this?

    Did you get a solution for this?
    I have the same problem.
    Any help would be appreciated.
    Thanks,
    Madhu

  • Supress repeated labels in group Above reports o matrix group above reports

    Hi,
    I have a problem, because I´m brand new in reports.
    I've defined same reports.
    When I defined a Group Above Report or a Matrix with Group Above Report the labels appear repeated in the same page:
    Year 2006
    Level 1 Range 1-3 months 3-6 months 6-12 months
    Age
    < 16 1
    16-17 1 3
    18-24 12 6 2
    25 4 5 2Total Level 1: 17 14 5
    Level 2 Range 1-3 months 3-6 months 6-12 months
    Age
    < 16 1
    16-17 2 1
    18-24 8 12 2
    25 5 4 3Total Level 1: 15 17 6
    Is it possible not to repeat the labels "Range 1-3 months 3-6 months 6-12 months",? I want them to appear once per page.
    How can I do it?
    Please may anyone help me?
    thanks
    Beatriz

    Why should that be a bug? You have a custom requirement and have to find a way to fulfill it. But, what is your actual sorting order? Do you have only this three departments? If so, you could add an addtional column in your query like
    DECODE(DEPT,  20, 1, 10, 2, 30, 3, 4) SORTINGput that column in the same group as dept and sort after that new column.

  • Using member sorting and grouping with two reports sharing rows

    Hi!
    I have a problem with one report and I need some help or advise here.
    I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
    PRODUCT               MATERIAL          AMOUNT
    TOTAL PROD_A-X                                   100
    PROD_A_A             MAT1                          22
    PROD_A_B             MAT1                          50
    PROD_A_A             MAT2                          28 
    TOTAL PROD_B-X                                   120
    PROD_B_A             MAT1                          30
    PROD_B_A             MAT2                          50
    PROD_B_B             MAT2                          40
    This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
    Thank you very much

    Hi!
    I have a problem with one report and I need some help or advise here.
    I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
    PRODUCT               MATERIAL          AMOUNT
    TOTAL PROD_A-X                                   100
    PROD_A_A             MAT1                          22
    PROD_A_B             MAT1                          50
    PROD_A_A             MAT2                          28 
    TOTAL PROD_B-X                                   120
    PROD_B_A             MAT1                          30
    PROD_B_A             MAT2                          50
    PROD_B_B             MAT2                          40
    This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
    Thank you very much

  • Sorting and Grouping in Projects View

    In Projects view, when either of two of the three grouping options is selected, there are two sorts in effect: the groups themselves are sorted, and the contents of each group are sorted. These sorts are handled differently, depending on the grouping selected and the sort order selected.
    (It appears that there is a bit of the old Apple voodoo in here. The results are arbitrary , but they seem to have been carefully chosen to meet most users expectations. That is to say -- and this is an Apple programming trait -- the arbitrariness is faithful to the expected users' needs, not to logic.)
    There are four sorts available, and three groupings
    Sorts:
    . Name
    . Date -- Oldest First
    . Date -- Newest First
    . Library
    Groupings:
    . Ungrouped
    . Group by year
    . Group by folder
    So that's twelve possible ways to display Projects in Projects view.
    Let's look at a few of them. I'm going to refer to the groups as "Year groups" or "Folder groups" and to the contents of the groups as "Projects". So there is sorting of the groups, and sorting of the contents of the groups (same as "within the group"). These I'll refer to as "Groups sorting" and "Projects sorting".
    Sort: Date -- Newest First
    Grouping: Group by Year
    Result: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
    Sort: Date -- Oldest First
    Grouping: Group by Year
    Results are as expected; a reversal of the "Newest First" sort, but with the same groups: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
    Sort: Name
    Grouping: Group by Year
    Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are sorted alphabetically, descending.
    Sort: Library
    Grouping: Group by year
    Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector. (Note that this last is literal: a Project named "Aardvark Close-ups" if it's in a Folder named "Zoography" will be listed after all the projects in "Yellow Paintings" and all the Projects in "X-rays, thoracic" if those Projects are in alphabetical order by Folder name in the Library. You can see all the Projects in your Library listed on the Library tab of the Inspector by "{Option}+clicking" the disclosure triangle next to "PROJECTS & ALBUMS" twice.)
    Sort: Date - Newest First
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, newest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder.
    Sort: Date - Oldest First
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, oldest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
    Sort: Name
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted alphabetically by name, descending. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
    Sort: Library
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector (see note above). Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are listed in the order they appear in the Library).
    Ernie [asked:|http://discussions.apple.com/thread.jspa?threadID=2816124&tstart=0]
    +I see those icons but note that those projects in folders will be in different sections arranged alpha, and then date within. Am I correct on that?+
    The answer is, it depends.
    If "Group by year" is selected, the Groups-sorting will always be by date, regardless of the sort order specified. The Groups-sorting order will follow whatever is specified for the Projects sort order (or default to "oldest first").
    If "Group by folder" is selected, the Groups-sorting will always be alphabetical, descending, regardless of the sort order specified. (So if you use Projects view, take care in naming your Folders. Use prefixes if needed to force a desired alpha sort.)
    If "Ungrouped" is selected, there are no Groups and perforce no Groups-sorting.
    That's all I have to say on this topic (today).
    Message was edited by: Kirby Krieger

    In Projects view, when either of two of the three grouping options is selected, there are two sorts in effect: the groups themselves are sorted, and the contents of each group are sorted. These sorts are handled differently, depending on the grouping selected and the sort order selected.
    (It appears that there is a bit of the old Apple voodoo in here. The results are arbitrary , but they seem to have been carefully chosen to meet most users expectations. That is to say -- and this is an Apple programming trait -- the arbitrariness is faithful to the expected users' needs, not to logic.)
    There are four sorts available, and three groupings
    Sorts:
    . Name
    . Date -- Oldest First
    . Date -- Newest First
    . Library
    Groupings:
    . Ungrouped
    . Group by year
    . Group by folder
    So that's twelve possible ways to display Projects in Projects view.
    Let's look at a few of them. I'm going to refer to the groups as "Year groups" or "Folder groups" and to the contents of the groups as "Projects". So there is sorting of the groups, and sorting of the contents of the groups (same as "within the group"). These I'll refer to as "Groups sorting" and "Projects sorting".
    Sort: Date -- Newest First
    Grouping: Group by Year
    Result: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
    Sort: Date -- Oldest First
    Grouping: Group by Year
    Results are as expected; a reversal of the "Newest First" sort, but with the same groups: Year groups are sorted in the same order as Projects. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together.
    Sort: Name
    Grouping: Group by Year
    Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are sorted alphabetically, descending.
    Sort: Library
    Grouping: Group by year
    Result: Year groups are sorted by year, oldest first. Projects which span multiple years are put in multi-year groups. Projects with the same spans are grouped together. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector. (Note that this last is literal: a Project named "Aardvark Close-ups" if it's in a Folder named "Zoography" will be listed after all the projects in "Yellow Paintings" and all the Projects in "X-rays, thoracic" if those Projects are in alphabetical order by Folder name in the Library. You can see all the Projects in your Library listed on the Library tab of the Inspector by "{Option}+clicking" the disclosure triangle next to "PROJECTS & ALBUMS" twice.)
    Sort: Date - Newest First
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, newest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder.
    Sort: Date - Oldest First
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted by date, oldest first. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
    Sort: Name
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are sorted alphabetically by name, descending. Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are sorted alpha-name, descending).
    Sort: Library
    Grouping: Group by folder
    Result: Folder groups are sorted alphabetically by name, descending. Projects are listed in the order they occur in the Library structure shown on the Library tab of the Inspector (see note above). Clicking a Folder's name in the Project viewer drills down to show the sub-Folders and Projects in the clicked Folder (where, again, Folder groups are sorted alpha-name, descending, and Projects are listed in the order they appear in the Library).
    Ernie [asked:|http://discussions.apple.com/thread.jspa?threadID=2816124&tstart=0]
    +I see those icons but note that those projects in folders will be in different sections arranged alpha, and then date within. Am I correct on that?+
    The answer is, it depends.
    If "Group by year" is selected, the Groups-sorting will always be by date, regardless of the sort order specified. The Groups-sorting order will follow whatever is specified for the Projects sort order (or default to "oldest first").
    If "Group by folder" is selected, the Groups-sorting will always be alphabetical, descending, regardless of the sort order specified. (So if you use Projects view, take care in naming your Folders. Use prefixes if needed to force a desired alpha sort.)
    If "Ungrouped" is selected, there are no Groups and perforce no Groups-sorting.
    That's all I have to say on this topic (today).
    Message was edited by: Kirby Krieger

  • Just downloaded the newest version of software and I can't even sort by song or album??

    Am I missing something?? I can no longer sort by song alpha or group albums. It's extremely difficult to search if I don't know the exact song title. Help!!!

    I'm not sure I understand exactly what you want. Which view, exactly, are you trying to use? Almost certainly, you can do what you want...
    In iTunes 11, I have the sidebar showing ('cos I prefer it), and :
    although I have ringed Composers, this view of my Library is sorted by Song title.
    And "group albums" by ...
    title?
    or artist?
    If you can be more specific about your requirements, then perhaps we can give you better help.

  • Display Total in Group Above Report

    Hello,
    I have a group above report with month, product_id, product_name as group above fields I have product_entry_date, description, total_qty, actual_qty etc as display fields in my report.
    I would like to have a total and grand total for total_qty and actual_qty for product_id and product_name. Issue I am having is when I add a summary column for total_ qty and actual_qty, total is getting displayed for each month.
    How can I display total and grand for total_qty and actual_qty?
    Any help is highly appreciable.
    Thanks

    ponic wrote:
    Hello,
    I have a group above report with month, product_id, product_name as group above fields I have product_entry_date, description, total_qty, actual_qty etc as display fields in my report.
    I would like to have a total and grand total for total_qty and actual_qty for product_id and product_name. Issue I am having is when I add a summary column for total_ qty and actual_qty, total is getting displayed for each month.
    How can I display total and grand for total_qty and actual_qty?
    Any help is highly appreciable.
    ThanksIf you want to display total qty for each month and you already done it. as you says..
    total is getting displayed for each month.If not ,
    Take a summary column at month group >> at properties .. Summary Function : Sum , Reset at month group.
    and for grand total
    take a summary column outside the query. >> at properties .. Summary Function : Sum , Reset at report.
    Hope it works.
    hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • How to design group above report manualy

    I want to design group above report manually. How can i define main repeating frame and then internal repeating frame like report builder.

    Hi,
    one possibel way is:
    //-- loop through all master values
    &lt;?for-each:DEPT_ROW?&gt;
    //-- store the master key in a variable
    &lt;?xdoxslt:set_variable($_XDOCTX,'v_DEPTNO',DEPTNO)?&gt;
    //-- Output of master data
    &lt;?DEPTNO?&gt;
    &lt;?DNAME?&gt;
    //-- Loop through second dataset looking vor all data suitable to the current master key
    &lt;?for-each://EMP_ROW[xdoxslt:get_variable($_XDOCTX, 'v_DEPTNO')=DEPTNO]?&gt;
    &lt;?ENAME?&gt;
    &lt;?JOB?&gt;
    &lt;?end for-each?&gt;
    &lt;?end for-each?&gt;
    Hope that helps
    Rainer

  • Multi level Group Above Report

    I have a multi level Group Above report like this.
    School name : xxxx
    Course1
    Student1
    Student2
    Course2
    Student1
    School name : yyyy
    etc...
    No students are enrolled in some of the courses. I used the Outer Query in SQL to include those courses. Everything looks okay, except the header for the students are still appearing. how do I supress the student heading if no drecords are present?
    Can somebody help me.
    Thank you
    David Smith

    hello,
    you will have to create a counter, that tells you the numbers of students (summary-column, function : count, reset on : course) and create a format-trigger on the heading that hides it when the number of students is 0.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Group Above Report ?

    Hi All,
    I am using reports 6i.
    I designed a master/detail report with style group above.
    Its working fine. But I need every master record has to start from a new page.
    But now First master record with its details ends at page no 8 and second master record starts at
    page no 8 itself.
    how to make the report output as new master record starts from a new page.
    Help will be appreciated.
    Regards
    Sankar MN

    Hello,
    You can use the "Repeating Frame" property : Maximum Records Per Page
    Set this property to 1 for the Master Repeating Frame
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_maximum_records_per_page.htm
    Regards

Maybe you are looking for

  • XDK 9.2 install help please

    Can anyone point me in the right direction ? I am trying to investigate the XDK 9.2 (shipped with Oracle9i Release 2) - no App server involved with a view to converting some data into XML format I am Java/XML illiterate I have Oracle Server 9.2 insta

  • Transfer music from 3gs to 4s?

    Hi, I have backed up my 3gs and used the restore back function to copy this to my 4s. Contacts and texts have copied across, but not my music or apps?

  • Workflow with PO Creation

    Hi ! I have a problem, I'm creating an addins which create PO. I want to launch workflow when I create purchase ordre, but, nothing happens at PO creation. Is there something to do ? Or is it automatic ?

  • Unix System Calls using Java

    Hi! Can anyone tell me how to do Unix System Calls in my Java program? If possible please give me the java code for it taking one unix system call as an example. Thanks in advance Raj

  • Just bought an iphone 5 and trying to get into the app store without success

    I just bought an iPhone5 and am brand new to it......trying to explore to find out what apps are available.  when i tap the apps icon i get a white screen and it just sits there. What am i doing wrong?