Group Left Order By
Hi,
I have a sql which contains an order by clause (order by field1, field2), the query runs fine in SQL*Plus.
I tried to create a Group Left report in Reports 10g. (The report contains the Group on field1.) When I run the report, it disregards the order by clause. Is there some place else I need to look at?
The report works fine if I I picked tabular, but then field1 repeats itself: i.e.
Human Resources John Smith
Human Resources Jane Doe
If there is a way to suppress the repeating value, then I could use tabular format.
Thanks in advance
VC
Figured it out.
Similar Messages
-
Group Left report: problem in order the columns
Hi,
I have a Group Left report in report6i with group A and Group B. Group A has columns AAA, BBB, CCC, DDD, EEE, FFF and Group B has coulmn YYY, ZZZ.
The problem is report does not take order by clause. It sort the report by first column of Group A, does not reflect my order by clause.
I created laxical variable in order to change order by clause dynamically.
Any suggestion?
Thanks in advance
DipHi,
I have a Group Left report in report6i with group A and Group B. Group A has columns AAA, BBB, CCC, DDD, EEE, FFF and Group B has coulmn YYY, ZZZ.
The problem is report does not take order by clause. It sort the report by first column of Group A, does not reflect my order by clause.
I created laxical variable in order to change order by clause dynamically.
Any suggestion?
Thanks in advance
Dip -
Hi,
I have a sql which contains an order by clause (order by field1, field2), the query runs fine in SQL*Plus.
I tried to create a Group Left report in Reports 10g. When I run the report, it disregards the order by clause.
The report works fine if I picked tabular.
Thanks in advance
TusharLet us take an example of a table with the following structure -
create table test (grade varchar2(3),
detail varchar2(10));
Here GRADE is the column which contains numbers as well as alphabets or
alpha-numerals.
A normal query on the table would result in the following -
select grade, detail from test
GRADE DETAIL
1 DET1
1 DET2
1 DET3
1 DET4
2 DET1
2 DET2
2 DET3
5 DET1
A DET1
A DET2
B DET1
B DET2
B DET3
B DET4
10 DET1
10 DET2
10 DET3
If you want the GRADE to be sorted in a numeric order first and then alphabetically,
you can use the concept explained .
select grade, detail
from test
order by decode( TO_CHAR(NVL(LENGTH(TRANSLATE(grade,'A1234567890','A')),0)),
'0',LPAD(grade,8),
grade)
GRADE DETAIL
1 DET1
1 DET2
1 DET3
1 DET4
2 DET1
2 DET2
2 DET3
5 DET1
10 DET1
10 DET3
10 DET2
A DET1
A DET2
B DET1
B DET2
B DET3
B DET4
If you were to write the above query in Oracle Reports (tabular style),
the output would be the same as above.
But if you create a group left or group above style with GRADE as the
higher group, the same query would give the following result -
GRADE DETAIL
1 DET1
DET2
DET3
DET4
10 DET1
DET3
DET2
2 DET1
DET2
DET3
5 DET1
A DET1
DET2
B DET1
DET2
DET3
DET4
This is because although the server sends back the resulting set in the desired
ordered fashion, the grouping on grade does a further sort (ascending - the
default). But this sort is done alphabetically since this is a varchar2 column.
To avoid this or to achieve the desired output (numbers to appear sorted first
and then alphabets), use the decode in the select list itself.
Now the query for the report becomes -
select decode( TO_CHAR(NVL(LENGTH(TRANSLATE(grade,'A1234567890','A')),0)),
'0',LPAD(grade,8),
grade) grade
, detail
from test
The order by clause in the query is irrelevant since the grouping inside reports
anyway does the sort. The result would look like
GRADE DETAIL
1 DET1
DET2
DET3
DET4
2 DET1
DET2
DET3
5 DET1
10 DET1
DET3
DET2
A DET1
DET2
B DET1
DET2
DET3
DET4 -
How to build a Matrix with Group Left Report
I want to build a Matrix with Group Left Report,not Matrix with Group Above Report,i am still finding the solution, any help is useful.
thanks
<[email protected]>Hi,
The problem in your output is not clear. The report output should appear like:
Order Mode.....Sales_Rep_ID > 10..11..12..
Online.........Order Status
...............A..............x....x...x
...............B..............x....x...x
...............C..............x....x...x
Order Mode.....Sales_Rep_ID > 10..11..12..
Retail.........Order Status
...............A..............x....x...x
...............B..............x....x...x
...............C..............x....x...x
Here "Order Mode" is the group field (it repeats for every group). Could you pl specify what output you are getting?
If the problem is that you don't want the Title (like "Order Mode" in the above example) to print in every group, just place it outside the group repeating frame. It will print only once.
Navneet. -
EA1 - SQL Formatter issues (JOINs and GROUPs and ORDER BY oh my ;)
Great job with improving the SQL Formatter, but it still has some bugs that need to be worked out.
The key words JOIN and it's modifiers INNER, LEFT, RIGHT and FULL OUTER are not recognized as master key words. As such they end up flush against the left margin Also when GROUP BY and/or ORDER BY key words are present in an outer most select statement the other key words are not indented far enough to be right aligned with the end of the word BY and are indented too far to be right aligned with the word GROUP or ORDER. In sub queries, GROUP and ORDER BY are correctly right aligned with their respective SELECT statements.We're picking up and collating the Formatter issues. I'll add these.
Specific bug for these #7013462
Sue -
Hi everyone,
I created a Group left report with 4 grouping columns.Everthing is working fine but i am getting some problem with the order of the 3rd column(varchar).It is doing ascending order(As the Break order Propoerty of that column is ascending).
But i am trying to do is the 3 rd column needs to be displayed by a specific (order by clause)
But in group left report it is not considering the (order by clause of the query).It is doing sort by the grouping columns.Is there any way that i can sort a grouping column(other than asc and dsc).It needs to be displayed in the order of another column.
Thanks
phaniCreate another column (either in the query, or in the data model as formula) that would indicated the rank according to the desired sort order. You don't need to place the column into the layout, but use it to set the break order in the data model.
-
Group Left report does not sort DESCending
Hello seniors...
i have the following query that produces result as desired below at SQL level; i am aiming at rows to be displyed in the DESCending order..
SQL> SELECT Z.ACATG_TYPE, Y.EXPN_CATG, z.ACATG_DESC, y.expn_code, y.expn_name,
2 DECODE(Z.ACATG_TYPE,'I', x.closing) Income,
3 DECODE(Z.ACATG_TYPE,'E', x.closing) Expense
4 FROM(
5 SELECT PSN_PARTY, expn_name, SUM(nvl(NETT,0)) nett, SUM(nvl(DEBIT,0)) debit, SUM(nvl(CREDIT,0
)) credit,
6 SUM((nvl(NETT,0)+nvl(DEBIT,0)-nvl(CREDIT,0))) CLOSING
7 FROM (
8 SELECT PSN_PARTY, 0 nett, SUM(nvl(debit,0)) DEBIT, SUM(nvl(CREDIT,0)) CREDIT
9 FROM(
10 SELECT PSN_TXN_DATE,PSN_PARTY, nvl(DEBIT,0) debit, nvl(CREDIT,0) credit
11 FROM
12 (
94 where PSN_PARTY = expn_code
95 GROUP BY PSN_PARTY, expn_name) x, expense_master y, Accounts_category z
96 where x.psn_party = y.expn_code
97 and y.expn_catg = z.acatg_code
98 and z.acatg_type in ('I','E')
99 ORDER BY Z.ACATG_TYPE DESC, Y.EXPN_CATG,y.expn_code;
ACA EXPN_C ACATG_DESC EXPN_C EXPN_NAME INCOME EXPENSE
I 90 Income AC2000 Sale 1333.000
E 10 Expense AC0003 ELECTRICIRTY BILL 30.000
E 10 Expense AC0005 TELEPHONE BILL 16.000
E 10 Expense AC0007 TEA & SNACKS 17.000
E 10 Expense AC0009 REPAIRS & MAINTENANCE 15.000
E 10 Expense AC0010 MOBILE BILL 45.000
E 10 Expense AC0011 REFUND 220.000
E 10 Expense AC0019 OFFICE EXPENCE 15.000
E 40 Staff Salaries AC0006 STAFF SLALARY 250.000
9 rows selected.But when i made use of the above query in my report with Group Left Option, i dont get it sorted in DESCending order.
With Tabular type report it sorts correctly as above.
The screen schot for better idea of my report is attached for the reference.
[http://i995.photobucket.com/albums/af71/rhnshk/INCEXP.jpg|Report-Preview]
[http://i995.photobucket.com/albums/af71/rhnshk/INCEXP1.jpg|ReportWizard-DataModel]
[http://i995.photobucket.com/albums/af71/rhnshk/INCEXP2.jpg|ReportWizard-Groups]
[http://i995.photobucket.com/albums/af71/rhnshk/INCEXP3.jpg|ReportWizard-Fields]
[http://i995.photobucket.com/albums/af71/rhnshk/INCEXP4.jpg|ReportWizard-Totals]
i want the rows with acatg_type = 'I' to be displayed first.
Sorry for not attaching the complete SQL, but no issues if at all required, i can do that as well.
Since its a long in-line view created SQL. thought the solution might come out showing this much part only.
i am using Report 6i on 10g.
Please help me.Thanks Arif,,
Grouping/Break i need to be done with EXPN_CATG-within-ACATG_TYPE.
if you can view the my report image links, u'll understand much better.
EXPN_CODE is not part of the Group Fields.
Still i tried re-arranging Group fields, but still the same..
Row with ACATG_TYPE = 'I' is not moving up.
Please suggest.. -
GROUP BY & ORDER BY in a Report
How to Implement GROUP BY & ORDER BY in a Report?
Hi,
Order by: It is possible to sort the char value according to the values (asc or desc) of an atribute of this char...is this what you were looking for?
Group by: May be can be achieved by drilldwon sequence, with the grouping char to the left of the char values to be grouped...again, is this what you had in mind? -
What are the key fields used to group double orders in t-code SDD1?
What are the key fields used to group double orders in t-code SDD1?
Cheers,
VTHi,
You can group the duplicate sales documents with the help of the following fields,
Sold-To-Party,Document type,date and sales area details.
Regards,
Gopal. -
Use Handling Units to group production orders?
Hello,
can I use Handling Units to group production orders together? We have a workcenter where all our orders go through and we'd like to group, say, the morning's orders in a single HU on which we could post a single transaction (batch?) instead of posting on each and every order.
Thanks,
JonathanPlease check OSS note 793168.
-
I am trying to do a group left within or below a group above, like so.
Name John Doe
Incident Activity
12345 Apply
Accept
Modify
12346 Apply
Accept
Modify
Name Bill Smith
Incident Activity
12347 Apply
Accept
Modify
12348 Apply
Accept
Modify
I can't figure out how to specify different types of grouping for different groups.
Any suggestions?
nullMake a group above report for the first 2 groups. in the Data model extend the detail's repeating enclosing frame.
Inside this frame draw an additional default layout (a button in the Layout Editor on the left toolbar) and inside this one insert your detail group.
Or... you can create an above group without any break first, then separate a group in the Data Model and add a repeating frame around the detail columns. Specifi as source of this frame the name of the detail group from the Data Model. -
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.
-
XK03 can be restricted by account group in order to prevent general users
Hello Gurus,
Please advise, if XK03 can be restricted by account group in order to prevent general user population from displaying employee data ?
I understand that XK03 has auth object F_LFA1_GRP for account group in which I restricted with 03 and particular account groups but still the test is failing because the test user is able to view employee data.
Please suggest..
Regard's
SalmanHi Alex,
Thank you !
By your last update, do you mean auth group or account group? If you are talking about auth group then this auth object F_LFA1_BEK (XK03) has auth group.
I checked the F_LFA1_GRP is active in SU24. Is there something which i need to look in F_LFA1_BEK for particular auth group after restricting the auth object F_LFA1_GRP with account group ?
Thank you for your valuable suggestions
Regard's
Salman -
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 -
How to design Group Left Report using RTF method ( XML Publisher )
Hi,
I need to design Group Left Report using basic RTF method. I am able to design basic simple report and Group Above Report but I am not getting Group Left Report. Can anyone help me out.
Thx N Regs,
Khan.Group Left report can be done using table consisting of 1 row and 2 columns. Group header goes to the column 1, group details go to the second column. Group details can be also designed using table, in this case you get table within table cell. "for-each.." statement for the upper level group to be placed in the left column before the group header data. "end for-each.." to be placed in the second column after the detail data.
Maybe you are looking for
-
CS2 Pressure Functionality on Surface Pro 3
Hello all, I just got a Surface Pro 3 and have been struggling to get pressure support with the Pro Pen. I've read support topics that suggest downloading the wintab driver and the Wacom driver, although when I do that, I just get the error that ther
-
Some of the music on my iPod has gone from iPod and also from my libra ray on the computer. How can I get it back?
-
How to Make FUNCTION to return multiple column and multiple row output
Hi All, Kindly Share ur Idea;Thanks in Advance; i Have Table Demo. table DEMO: id name 1 a10 1 a11 1 a12 2 b10 2 b11 3 ccc and the function is like: create or replace function (p1 number) return varchar2 as vid number; vname varchar2(20); begin selec
-
How to display multi line headings in procedural alv report
Hi experts, How to display multi line heading in alv( procedural alv report) report. some columns single line and some columns multi line in the same report. ex: solvent consumed solvent recovered fresh | reco
-
IDVD menu - want to use as DVD label...how?
Just made my first DVD with my new external burner!!! Am very excited, as it came out perfectly - it is an iMovie that my son and I made 2 years ago for school, that we transferred straight from computer to VCR at the time. Anyway, my question is...