Help! Matrix Group Report
Hi All,
My tables are
Petty_cash_voucher P :- voucher_date,terminal_id,currency_code,account_code, amount
Terminal_master T :- terminal_id,terminal_station_code
Ledger_codes L :- account_code,account_description,accound_main_head_code
Account_main_heads :-
Account_main_head_code, Main_head_description
im looking for a MATRIX WITH GROUP REPORT should look like this
1st group : CURRENCY
2nd Group : Main_head_description
Row field is : account_description
Column field is : Terminal_town_code
Matrix CELL is : total_amount.
here i should see all my terminal_towns though the transactuons existed or not for that day. letssay there are 22 terminals, but today i have 2 terminals only transactions, but i need to see 22 as columns with NULL values. and for ledgers, main_heads what ever existed only. Ex: i have 100 ledgers with 20 Main heds, but there is 2 only transactions happend, i should see 2 group by main_head with 2 terminsla having values remiaing termils with null values.
i wrote the query like this , but it is not giving all terminal codes , giving only values existed.
SELECT
P.currency_code,
T.terminal_town_code,
P.account_code,
L.account_description,
MH.account_main_head_description,
SUM(P.amount) total_amount
FROM
terminal_master T,
petty_cash_voucher_master P,
ledger_accounts L,
account_main_heads MH
WHERE
T.terminal_id = P.account_to_terminal (+)
AND
L.account_code (+) = P.account_code
AND
MH.account_main_head_code (+) = L.account_main_head_code
AND
P.voucher_date (+) > = '16-jun-05'
AND
P.voucher_date (+) < = '16-jun-05'
GROUP BY
P.currency_code,
T.terminal_town_code,
P.account_code,
L.account_description,
SH.account_main_head_description.
Thanks in advance.
Posting twice is not going to get you an answer quicker - post some insert statements with actual data, the results you are seeing, and the results you expect!
You'll find most people are more than willing to help, but this is less a reports issue, and more a sql issue. So if you want a quick response, you must give as much information as you can!
Similar Messages
-
NEED HELP IN MATRIX WITH GROUP REPORT
Dear All,
I need small help in MATRIX WITH GROUP REPORT In Report Builder Test Report
In my report, having periods as rows and location as columns as shown below,
1) LOC-A
JAN-10 FEB-10
ITEM-GROUP -1 1 2
ITEM-GROUP-2 3 4
ITEM-GROUP 3 5 6
2) LOC- B
MAR-10 APR-10
ITEM-GROUP -1 7 8
ITEM-GROUP-2 9 10
ITEM-GROUP-3 11 12
But comming to my requirement, the periods should be in fix in matrix as shown below
1) JAN-10 FEB-10 MAR-10 APR-10
LOC-A
ITEM-GROUP -1 1 2
ITEM-GROUP-2 3 4
ITEM-GROUP 3 5 6
LOC- B
ITEM-GROUP -1 0 0 7 8
ITEM-GROUP-2 0 0 9 10
ITEM-GROUP-3 0 0 11 12
I am unable to get this kind of output format
Please kindly waiting for reply from our team....
Regards
krishna.PFor the periods, create a seperate dummy query and then use it as column group in the multi query matrix.
-
Borders in Matrix with Group Report Missing in Web view
Please help.
I have a matrix with group report. When it is viewed in Report Builder live preview is fine, but when I preview in web I got two problem
Problem 1 - preview as HTML
No borders? all my cell borders, frame borders gone missing.
Problem 2 - preview as HTML CSS
The borders are there, but some data in the matrix report displayed wrongly.
For example, the data is "01 APR 2000 1800 - 20 APR 2000 2000", what is showing in the web view is actually
"01"
"APR"
2000
1800
i.e., is broken down into few lines.
Can anyone please help. Btw I am using Oracle Report 6i.
Thanks.
JoshuaFor Simple HTML output, you can only get horizontal lines out of Reports. You will lose all vertical lines as well as other graphical objects (eg: polygons, polylines, etc.) This is because these objects are not supported natively within HTML.
However, for HTMLCSS, you should be able to get a lot closer since rectangles are supported. Though again; polygons, polylines, etc. are not supported.
Not sure what is happening to your text, possibly an issue with browser settings or you may need to reduce the font size in Reports to get what you want.
As has already been suggested, for better WYSIWYG output for the web from Reports, PDF is the way to go. -
How to create Matrix with Group report layout in xml
Hi,
i would be glad if anyone could tell me How to create Matrix with Group report layout in xml?
Here i am attaching the required design doc
below is the code
select COST_CMPNTCLS_CODE,
-- crd.RESOURCES,
NOMINAL_COST,
cmm.COST_MTHD_CODE,
-- crd.COST_TYPE_ID,
gps.period_code
-- ORGANIZATION_ID
from CM_RSRC_DTL crd,
gmf_period_statuses gps,
CM_MTHD_MST cmm,
CR_RSRC_MST crm,
CM_CMPT_MST ccm
where gps.period_id = crd.PERIOD_ID
and crd.cost_type_id = cmm.cost_type_id
and crd.RESOURCES = crm.RESOURCES
and crm.COST_CMPNTCLS_ID = ccm.COST_CMPNTCLS_ID
and gps.period_code in (:p_period1, :p_period2, :p_period3)
group by COST_CMPNTCLS_CODE, cmm.COST_MTHD_CODE, gps.period_code,NOMINAL_COST
order by 1,2,3,4.
The o/p of the report shoud be as given below
Period-1 Period-2 Period-3 Period-4
COMPONENT
LABOUR - DIRECT
Actual 1 2 3 4
Actual Rate 10 10 10 10
Standard Rate
Var%
DEPRICIATION-DIRECT
Actual
Actual Rate
Standard Rate
Var%
OVERHEAD - DIRECT
Actual
Actual Rate
Standard Rate
Var%
LABOUR - IN DIRECT
Actual
Actual Rate
Standard Rate
Var%
Thanks in advanceYour friend is obviously not a reliable source of HTML
information.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Mr.Ghost" <[email protected]> wrote in
message
news:f060vi$npp$[email protected]..
> One of my friends advised me to develop my whole site on
the layout mode
> as its
> better than the standard as he says
> but I couldnot make an ordinary table with rows and
columns in th layout
> mode
> is there any one who can tell me how to?
> thanx alot
> -
Need help in group left report
i need help in group left report
i am making group left report in which all group data on top is repeating as many time as detail record is .
for axampel
if
group record:
fielda fieldb field c
fielda fieldb field c
fielda fieldb field c
fielda fieldb field c
detail record :
fieldd fielde feildf
fieldd fielde feild
fieldd fielde feild
fieldd fielde feildf
how i can show group record on top once and on each group record show detail record belong to master record.
plz help me
A.RI think you Should go for Group above report...
and if you want group left only and also want to display master once then
put all master fields above but yeah take care of it's master repeting frame
it should not change...
and if you want i can send you an example...
Enjoy Oracle... -
Expand and Collapse(+/-) option in a Matrix SQL Reporting Services 2008
Hello All,
I am having Expand and Collapse(+/-) option in a Matrix SQL Reporting Services 2008. It's not working when it is havnig a Row Group and Column Group.
Does reporting services has this flexibulity?? It's working fine if it's only have a Row Group an it's not working if it is having Row and a Column Group. Can any one suggest how to work aroung with this.
any help much appriciated.
Thanks & Regards,
Jeevan Dasari.
DasariDrill-down feature is a basic requirement, it is concluded in Reporting service from SSRS2000 to SSRS2008 R2, To
your scenario I think the root cause is relevant to your incorrect steps. Please follow the steps below and then give the feedback:
1. Right-click the child groups in the
Row Groups panel which is at the left-bottom of the BIDS, and then select
Group Properties…
2.
Switch to Visibility tab, and then select
Hide Radio-button, click the checkbox of Display can be toggled by this report item.
3.
Then select the parent group datafield in the drop-down list.
4.
Click OK.
Thanks,
Challen Fu
Challen Fu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Grand Total For Matrix Based Report
Hi All,
I have a matrix based report with Fields like Country ,Amount and MonthYear
So report looks like below the columns get generated dynamically :
Country Oct 2013 Nov 2013 Dec 2013
India 25,000 25,000 25,000
England 22,000 25,000 30,000
Total 57,000 50,000 55,000
So this works perfectly fine . So next step was to get difference between the months like below :
Country Oct 2013 Nov 2013 Dec 2013 Oct-Nov 2013 Nov - Dec 2013
India 25,000 25,000 25,000 0
0
England 22,000 25,000 30,000 -3000
-5000
Total 57,000 50,000 55,000
Simon_Hou Provided me a custom code for dynamically find the difference between months . Now only requirement left is the sum of the dynamically generated month difference column . As the columns are generated based on a custom code it's not allowing me
to do a sum on it.
Desired Output
Country Oct 2013 Nov 2013 Dec 2013 Oct-Nov 2013 Nov - Dec 2013
India 25,000 25,000 25,000 0
0
England 22,000 25,000 30,000 -3000
-5000
Total 57,000 50,000 55,000 -3000
-5000
Can any one please advice me how to do sum for the dynamically generated custom code column .
Code is below it might help some1 else(Simon_Hou)
Private queueLength As Integer = 2
Private queueSum As Double = 0
Private queueFull As Boolean = False
Private idChange As String=""
Dim queue As New System.Collections.Generic.Queue(Of Integer)
Public Function CumulativeQueue(ByVal currentValue As Integer,id As String) As Object
Dim removedValue As Double = 0
If idChange <> id then
ClearQueue()
idChange = id
queueSum = 0
queueFull = False
CumulativeQueue(currentValue,id)
Else
If queue.Count >= queueLength Then
removedValue = queue.Dequeue()
End If
queueSum += currentValue
queueSum -= removedValue
queue.Enqueue(currentValue)
If queue.Count < queueLength Then
Return Nothing
ElseIf queue.Count = queueLength And queueFull = False Then
queueFull = True
Return (queueSum-currentValue-currentValue)
Else
Return (queueSum-currentValue-currentValue)
End If
End If
End Function
public function ClearQueue()
Dim i as Integer
Dim n as Integer = Queue.Count-1
for i=n To 0 Step-1
queue.Dequeue()
next i
End function
Thanks in Advance
PriyaHi Priya,
According to your description, you want to add a total row at bottom of the matrix. This total row should display the both sum of amount every month and the sum of the difference between months. Right?
Since we have tried the custom code in another similar thread you have posted before (Difference
Between the grouped column) and it works properly. In this scenario, we just need to use the sum function and put it as a variable when calling the custom function in custom code, then we will get the total difference between months. This
case has been tested in our local environment (In this sample, we used the same sample data as the last thread you posted before).Here are steps and screenshots for your reference:
1. Add a row out side of group. Put the expressions into corresponding cells.
2. Save and preview. The result looks like below:
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Strange Matrix group by date question
I have the following data:
name
date
value
bob
1/1/2015
5
jane
1/1/2015
7
jim
1/1/2015
9
bob
1/2/2015
2
jane
1/2/2015
5
jim
1/2/2015
5
bob
1/2/2015
4
I am using a matrix with a group by date to produce the following:
1/1/2015
1/2/2015
bob
5
4
jane
7
5
jim
9
5
As you can see it only selected one value for bob on 1/2.
Is is possible to show all of the values while still grouping by date?
I would prefer something like
1/1/2015
1/2/2015
1/2/2015
bob
5
2
4
jane
7
5
jim
9
5Hi ,
I have created sample report based on your question. Steps are listed below:-
Sample query is modified to get one more Column rowid as shown in below SQL query:-
select *,row_number() over(partition by name,date order by date )rowid from
SELECT 'bob' name, '1/1/2015' date ,5 value
UNION
SELECT 'jane' , '1/1/2015' , 7
UNION
SELECT 'jim' , '1/1/2015' , 9
UNION
SELECT 'bob' , '1/2/2015' , 2
UNION
SELECT 'jane' , '1/2/2015' , 5
UNION
SELECT 'jim' , '1/2/2015' , 5
UNION
SELECT 'bob' , '1/2/2015' , 4
)T
Now Create the matrix report rows --> Name
Columns---> Date
Detail---> Value
After creation of matrix, just go to the Group Properties of Column group and add as shown below
After this setting , run the report, it will give result as shown below:-
RDL Code for reference:-
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Tablix Name="matrix1">
<TablixCorner>
<TablixCornerRows>
<TablixCornerRow>
<TablixCornerCell>
<CellContents>
<Textbox Name="textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox3</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
</TablixCornerRow>
</TablixCornerRows>
</TablixCorner>
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.21in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!value.Value)</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox2</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_date">
<GroupExpressions>
<GroupExpression>=Fields!date.Value</GroupExpression>
<GroupExpression>=Fields!rowid.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!date.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.21in</Size>
<CellContents>
<Textbox Name="date">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!date.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>date</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_name">
<GroupExpressions>
<GroupExpression>=Fields!name.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!name.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>1in</Size>
<CellContents>
<Textbox Name="name">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!name.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>name</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<RepeatColumnHeaders>true</RepeatColumnHeaders>
<RepeatRowHeaders>true</RepeatRowHeaders>
<DataSetName>DataSet1</DataSetName>
<Top>0.37in</Top>
<Height>0.42in</Height>
<Width>2in</Width>
<Style />
</Tablix>
<Textbox Name="textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Strange Matrix Group by Date</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>14pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>SteelBlue</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.37in</Height>
<Width>5in</Width>
<ZIndex>1</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>1.04in</Height>
<Style />
</Body>
<Width>5in</Width>
<Page>
<LeftMargin>1in</LeftMargin>
<RightMargin>1in</RightMargin>
<TopMargin>1in</TopMargin>
<BottomMargin>1in</BottomMargin>
<Style />
</Page>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="DataSource1">
<DataSourceReference>DataSource1</DataSourceReference>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>b2ebe046-5f1b-45c9-82e7-5baa7ed2460a</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<DataSourceName>DataSource1</DataSourceName>
<CommandText> select *,row_number() over(partition by name,date order by date )rowid from
SELECT 'bob' name, '1/1/2015' date ,5 value
UNION
SELECT 'jane' , '1/1/2015' , 7
UNION
SELECT 'jim' , '1/1/2015' , 9
UNION
SELECT 'bob' , '1/2/2015' , 2
UNION
SELECT 'jane' , '1/2/2015' , 5
UNION
SELECT 'jim' , '1/2/2015' , 5
UNION
SELECT 'bob' , '1/2/2015' , 4
)T</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="name">
<DataField>name</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="date">
<DataField>date</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="value">
<DataField>value</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="rowid">
<DataField>rowid</DataField>
<rd:TypeName>System.Int64</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<Language>en-US</Language>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>dfd8f7e8-fcc1-4636-991e-d86824825c30</rd:ReportID>
</Report>
Thanks
Prasad
Mark this as Answer if it helps you to proceed on further. -
Generate matrix summary report in SQLplus
I have following coloumns in a table
PERSON (id)
EDU (educated,non-educated)
CITY citycode
COUNTRY countrycode
I have to generate matrix summary report in SQLplus.
I have to print countrycode in vertical coloumn(LEFT MOST),
I have to print citycode in horizontal row(TOP MOST),
I have to print count(educated),count(non-educated),total(educated+non educated) in each city
in matrix cells.
Every city code will have three coloumns below it (three counts).
I need help in this problem.
Thanks in advance.
Regards.The following is one method. You will need to modify it and expand it for the appropriate city codes and number of cities or create it dynamically. You will need to substitute the actual city codes for CITY1, CITY2, CITY3, etc. You will also need to substitute your table name for your_table. This example assumes that the edu column is populated with N for non-educated or Y for educated; If not, then you will need to modify that, too. You could also use the CASE statement or write it in PL/SQL, or use the Reports module of Developer 2000, or various other alternatives. This is just one suggestion.
SELECT country,
SUM (DECODE (city, 'CITY1', educated)) AS city1_educated,
SUM (DECODE (city, 'CITY1', non_educated)) AS city1_non_educated,
SUM (DECODE (city, 'CITY1', total)) AS city1_total,
SUM (DECODE (city, 'CITY2', educated)) AS city2_educated,
SUM (DECODE (city, 'CITY2', non_educated)) AS city2_non_educated,
SUM (DECODE (city, 'CITY2', total)) AS city2_total,
SUM (DECODE (city, 'CITY3', educated)) AS city3_educated,
SUM (DECODE (city, 'CITY3', non_educated)) AS city3_non_educated,
SUM (DECODE (city, 'CITY3', total)) AS city3_total
FROM (SELECT country,
city,
SUM (DECODE (edu, 'Y', 1, 0)) AS educated,
SUM (DECODE (edu, 'N', 1, 0)) AS non_educated,
COUNT (*) AS total
FROM your_table
GROUP BY country, city)
GROUP BY country -
I have following coloumns in a table
PERSON (id)
EDU (educated,non-educated)
CITY citycode
COUNTRY countrycode
I have to generate matrix summary report in SQLplus.
I have to print countrycode in vertical coloumn(LEFT MOST),
I have to print citycode in horizontal row(TOP MOST),
I have to print count(educated),count(non-educated),total(educated+non educated) in each city
in matrix cells.
Every city code will have three coloumns below it (three counts).
I need help in this problem.
Thanks in advance.
Regards.go into the report wizard and enter your query. when it asks for the row, put country, for column, put city. for the matrix cell choose EDU-->COUNT and whatever other totals you might need. that should be it. of course you could do it all manually if you wanted...
hope this helps.
I have following coloumns in a table
PERSON (id)
EDU (educated,non-educated)
CITY citycode
COUNTRY countrycode
I have to generate matrix summary report in SQLplus.
I have to print countrycode in vertical coloumn(LEFT MOST),
I have to print citycode in horizontal row(TOP MOST),
I have to print count(educated),count(non-educated),total(educated+non educated) in each city
in matrix cells.
Every city code will have three coloumns below it (three counts).
I need help in this problem.
Thanks in advance.
Regards. -
Hi,
I'd be interested in ideas for producing a matrix-style report (similar to that possible with Oracle Discoverer or Pivot Tables in spreadsheets). Example below. I've tried dynamic SQL (report based on function returning a SQL query) but this quickly gets very complex.
Are API's available (similar to the form item api's) for laying out HTMLDB sytle report headings and rows directly ?
Matrix Example
Imagine you have sales data by product and date e.g.
Product Date Sales
A 2003 100
A 2004 75
B 2003 50
I would like to display a matrix report similar to
Sales 2003 2004 ...
A 100 75
B 50 ...
...htmldb currently installs with a package called wwv_flow_rewrite_query. it's not technically supported, but it's really solid code ...and i think it does pretty much what you're hoping to do (pivot sql query). if you look in your $OHS_HOME/marvel directory you should see a file there called wwv_flow_rewrite_query.sql. fortunately that package isn't wrapped. better yet, it's loaded down with documentation. i'd take a look there to see about your report. if you have questions on the concepts (not the package), the author can be found discussing the topic at...
http://asktom.oracle.com/pls/ask/f?p=4950:8:::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:766825833740,
...but basically, you'd us the package to rewrite your query, returning wwv_flow_rewrite_query.as_pivot to the htmldb reporting engine in your Function Returning SQL Query region.
...hope this helps,
raj -
Problem in matrix style report
i have generate a matrix style report which has 5 X 4 = 20 cells . now in the report all cell values should not be filled according to the data in the tables but every cell in the report is filled . and more is that the filled values in the cell which are supposed to be blank is repeated from other cells . what is this problem and how to correct it ? i have an idea that this might be some varibale issue but cant figure it out .plz somebody help me out from this
Hi,
This problem of REP-1813 because,the data fetched into a matrix cell exceeds the capacity of the cell--
e.g., the cell may contain a variable field, and the data may be longer than expected.
Therefore, to solve this issue u may want to either enlarge your matrix cells until they are able to contain the data fetched into them, or redefine your data.
regards
~sudha -
How can shrink matrix group very urgent
hello programmers
how r u all? i have a little problem. i want to shrink my matrix frame when i donot want to print all columns of matrix group in report. suppose i haev three matrix groups and i want matrix group 2 all columns to be hide at runtime and matrix three group will automatically come at the position of matrix 2 group. please if ant body have any idea about it please email me. this is very urgent problem which i am facing.
thanks for any reply
kamran ahmedIt's not very clear what you're looking for. However, one of the following may work for you:
a) Restrict the data at query time through use of parameters and bind variables.
b) Use format triggers to dynamically hide values at runtime (by returning false).
If neither of these solutions works then please provide more details of the problem you're facing.
Thanks,
Danny -
Hello people I need some help creating a report on 9i. So far:
SELECT TRUNC(sampled,'MM'), c.name country, o.name operator, SUM(SMS)
FROM TEST s, operators_info o, countries_info c
WHERE sampled >= '01/01/2010' AND sampled < '01/01/2011'
AND s.dest_id = o.id
AND o.country_id = c.id
GROUP BY TRUNC(sampled,'MM'), c.name, o.name
ORDER BY 1, 2, 3;
I am getting:
01/01/2010 UK OPERATOR1 100
01/01/2010 UK OPERATOR2 150
01/01/2010 USA OPERATOR3 500
01/01/2010 USA 0PERATOR4 650
01/02/2010 UK OPERATOR1 50
01/02/2010 UK OPERATOR2 170
01/02/2010 USA OPERATOR3 550
01/02/2010 USA 0PERATOR4 670
01/12/2010 UK OPERATOR1 0
01/12/2010 UK OPERATOR2 270
01/12/2010 UK OPERATOR3 150
01/12/2010 USA OPERATOR3 570
01/12/2010 USA 0PERATOR4 800
How can I create a more efficient report like:
........................01/01/2010...01/02/10...01/12/2010
UK OPERATOR1...100.............50.............0
UK OPERATOR2...150.............170...........270
UK OPERATOR3......................................150
USA OPERATOR3.500..............550............570
USA 0PERATOR4.650..............670.............800
Thank you very much in advanceHi,
That's called a Pivot , and this thread shows you how to do it:
Help for a query to add columns
Pivoting the output requires more work, so it probably won't be any more efficient that what you're doing now.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
Explain how you get those results from that data.
Always say what version of oracle you're using. -
hi friends i need help on classical reports,
sold-party,
material
sales and distrubitutation channel ,division,
incoming orders,order number,invoice ,credit,
i need sub totals and final total of invoice and each customer should display in new page .Hi
Use the Tables KNA1,VBAk,VBAP,VBRK and VBRP and design the report
see the sample report using KNA1,VBAK and VBAP.
REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE
HEADING.
*TABLES DECLARATION
TABLES : KNA1, VBAK, VBAP.
*SELECT OPTIONS
SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.
*INITIALIZATION
INITIALIZATION.
CUST_NO-LOW = '01'.
CUST_NO-HIGH = '5000'.
CUST_NO-SIGN = 'I'.
CUST_NO-OPTION = 'BT'.
APPEND CUST_NO.
*SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN ON CUST_NO.
LOOP AT SCREEN.
IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.
MESSAGE E001(ZTJ1).
ENDIF.
ENDLOOP.
*BASIC LIST SELECTION
START-OF-SELECTION.
SELECT KUNNR NAME1 ORT01 LAND1 INTO
(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)
FROM KNA1
WHERE KUNNR IN CUST_NO.
WRITE:/1 SY-VLINE,
KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
KNA1-NAME1 UNDER 'NAME',
61 SY-VLINE,
KNA1-ORT01 UNDER 'CITY',
86 SY-VLINE,
KNA1-LAND1 UNDER 'COUNTRY',
103 SY-VLINE.
HIDE: KNA1-KUNNR.
ENDSELECT.
ULINE.
*SECONDARY LIST ACCESS
AT user-command.
IF SY-UCOMM = 'IONE'.
PERFORM SALES_ORD.
ENDIF.
IF SY-UCOMM = 'ITWO'.
PERFORM ITEM_DET.
ENDIF.
*TOP OF PAGE
TOP-OF-PAGE.
FORMAT COLOR 1.
WRITE : 'CUSTOMER DETAILS'.
FORMAT COLOR 1 OFF.
ULINE.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'NAME',
61 SY-VLINE,
63 'CITY',
86 SY-VLINE,
88 'COUNTRY',
103 SY-VLINE.
ULINE.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR SECONDARY LISTS
TOP-OF-PAGE DURING LINE-SELECTION.
*TOP OF PAGE FOR 1ST SECONDARY LIST
IF SY-UCOMM = 'IONE'.
ULINE.
FORMAT COLOR 1.
WRITE : 'SALES ORDER DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'CUSTOMER NO.',
16 SY-VLINE,
18 'SALES ORDER NO.',
40 SY-VLINE,
42 'DATE',
60 SY-VLINE,
62 'CREATOR',
85 SY-VLINE,
87 'DOC DATE',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*TOP OF PAGE FOR 2ND SECONDARY LIST
IF SY-UCOMM = 'ITWO'.
ULINE.
FORMAT COLOR 1.
WRITE : 'ITEM DETAILS'.
ULINE.
FORMAT COLOR 1 OFF.
FORMAT COLOR 3.
WRITE : 1 SY-VLINE,
3 'SALES ORDER NO.',
40 SY-VLINE,
42 'SALES ITEM NO.',
60 SY-VLINE,
62 'ORDER QUANTITY',
103 SY-VLINE.
ULINE.
ENDIF.
FORMAT COLOR 3 OFF.
*END OF PAGE
END-OF-PAGE.
ULINE.
WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',
SY-PAGNO.
SKIP.
*& Form SALES_ORD
*& FIRST SECONDARY LIST FORM
FORM SALES_ORD .
SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO
(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)
FROM VBAK
WHERE KUNNR = KNA1-KUNNR.
WRITE:/1 SY-VLINE,
VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,
16 SY-VLINE,
VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,
40 SY-VLINE,
VBAK-ERDAT UNDER 'DATE',
60 SY-VLINE,
VBAK-ERNAM UNDER 'CREATOR',
85 SY-VLINE,
VBAK-AUDAT UNDER 'DOC DATE',
103 SY-VLINE.
HIDE : VBAK-VBELN.
ENDSELECT.
ULINE.
ENDFORM. " SALES_ORD
*& Form ITEM_DET
*& SECOND SECONDARY LIST FORM
FORM ITEM_DET .
SELECT VBELN POSNR KWMENG INTO
(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)
FROM VBAP
WHERE VBELN = VBAK-VBELN.
WRITE : /1 SY-VLINE,
VBAP-VBELN UNDER 'SALES ORDER NO.',
40 SY-VLINE,
VBAP-POSNR UNDER 'SALES ITEM NO.',
60 SY-VLINE,
VBAP-KWMENG UNDER 'ORDER QUANTITY',
103 SY-VLINE.
ENDSELECT.
ULINE.
ENDFORM. " ITEM_DET
REPORT demo_list_at_pf.
START-OF-SELECTION.
WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
AT pf5.
PERFORM out.
AT pf6.
PERFORM out.
AT pf7.
PERFORM out.
AT pf8.
PERFORM out.
FORM out.
WRITE: 'Secondary List by PF-Key Selection',
/ 'SY-LSIND =', sy-lsind,
/ 'SY-UCOMM =', sy-ucomm.
ENDFORM.
After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:
Secondary List by PF-Key Selection
SY-LSIND = 14
SY-UCOMM = PF06
Example for AT USER-COMMAND.
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE: 'Basic List',
/ 'SY-LSIND:', sy-lsind.
TOP-OF-PAGE.
WRITE 'Top-of-Page'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'TEST'.
WRITE 'Self-defined GUI for Function Codes'.
ULINE.
ENDCASE.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
PERFORM out.
sy-lsind = sy-lsind - 1.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'FC1'.
PERFORM out.
WRITE / 'Button FUN 1 was pressed'.
WHEN 'FC2'.
PERFORM out.
WRITE / 'Button FUN 2 was pressed'.
WHEN 'FC3'.
PERFORM out.
WRITE / 'Button FUN 3 was pressed'.
WHEN 'FC4'.
PERFORM out.
WRITE / 'Button FUN 4 was pressed'.
WHEN 'FC5'.
PERFORM out.
WRITE / 'Button FUN 5 was pressed'.
ENDCASE.
sy-lsind = sy-lsind - 1.
FORM out.
WRITE: 'Secondary List',
/ 'SY-LSIND:', sy-lsind,
/ 'SY-PFKEY:', sy-pfkey.
ENDFORM.
When you run the program, the system displays the following basic list with a the page header defined in the program:
You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status.
Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton.
For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1.
Reward points for useful Answers
Regards
Anji
Maybe you are looking for
-
Number of records being pulled from OLAP/ SQL in BPC 5.1
Hello BPC gurus, We are experience performance issues with EVDRE.basically the report errors out and the error log states " Decompressing request failed". We are in BPC 5.1 We were trying to understand how many number of r
-
Hello I am having problems with the programmatical adjustment of a numerical input. I am using attribute nodes to set the precision and data range, but it has no effect on the input element. I recently updated from 6.0 to 7.1 and never had that probl
-
Need to query workflow for Shopping Carts for a report
Hello, I am not familar enough with SAP's workflow to know if there are tables or function modules that I can use. I am requested to develop a report to allow selection of a user's id and find all shopping carts where that person is in the workflow.
-
What 802.11N or Pre-N network cards are you successfully using with AEN?
In particular, I'm using a Belkin Pre-N router & PCcard with a Windows XP notebook. Have any of you tried that card with the AE(N)? Have you been successful with any other mfr's PCcard with the AE(N)? Thanks.
-
10.5.7 update Wiki, blog, and Calendar stopped working
I'm running 10.5.7 server and like a noob, I updated without giving others a chance to figure out what problems might arise from this monster. My server is a live machine and unfortunately I sorta need this working ASAP. Now that I've updated, none o