Displaying rows as columns and coumns as rows?
Can we do this?
Thanks.
Can we do this?Yes.
Google it and you will find HOW to do it.
Similar Messages
-
The screen which comes up no longer displays a playlist column and when I hit the plus sign and choose new playlist the screen doesn't display the narrow right side column for a new playlist. Does this have something to do with the new iTunes version I installed?
iOS: Unable to update or restore
-
How to display 3 month columns and YTD column
Hello,
I need a help. My report layout requires to display the data in 3 dynamic month columns and one Fiscal year Year-to-date column for a period of time. For example, ending month is FEB:
Items : DEC : JAN : FEB : FY YTD
A : $10 : $11 : $12 : $100
B : $1 : $2 : $3 : $10
(Note: FY YTD is the total sum from OCT to FEB (5 months), not 3 months to be displayed)
I tried to create a query and use Matrix with group, but the report always display five (5) month columns
from OCT to FEB instead of displaying three (3) month columns. If the query is limited to display
three months as desired, then the total sum will be 3 displayed months only (instead of 5 months).
How to create a query or how to display three months and FY YTD or do anything else with Oracle Builder9i?
Thanks,You could use the DECODE function and variables
i.e. have a four column report
in your query use somthing like
, decode(period,:P_PERIOD1,1,0)* amount as period1
, decode(period,:P_PERIOD2,1,0)* amount as period2
, decode(period,:P_PERIOD3,1,0)* amount as period3
, amount as ytd
In your before report trigger poulate the variables with your required values -
How to display a empty (non-existing) column and info in LAST row
Hello!
I´m trying to create the code that diplays all authors (author.name), empty COLUMN, NR_OF_BOOK_PER_AUTHOR.
I want the LAST ROW to display: (column1) the word 'Sum:', (column2) nr of authors, (column3) total sum of all books
Headache: How do I display the EMPTY column and how do I get the LAST ROW to display column1) 'Sum:', (column2) nr of authors, (column3) total sum of all books
It should look like this:
AUTHOR EMPTY NR_OF_BOOKS_PER_AUTHOR
I can list all authors and NR_OF_BOOKS_PER_AUTHOR using this code:
SELECT A.NAME, COUNT(B.ROWID)
FROM AUTHOR A, BOOK B
WHERE B.AUTHOR_ID = A.ID
GROUP BY A.NAME
ORDER BY COUNT(B.ROWID)
I can count the numbers of authors (should be displayed in last row column2) using:
SELECT COUNT(name)
FROM author
and I can list the total amount of books (should be displayed in last row column3) using:
SELECT COUNT(title)
FROM book
But I come up short with how to display the EMPTY column and the last row containing (column1) the word 'Sum:', (column2) nr of authors, (column3) total sum of all books
Any suggestions?
Best regards,
DanielI want the LAST ROW to display: (column1) the word 'Sum:', (column2) nr of authors, (column3) total sum of all booksHave a look at GROUP BY with CUBE or ROLLUP.
Cheers, APC -
How to display only selected columns in the table on the tableview
Hi All,
I am displaying in the below tableview the data from the SFLIGHTS tables in the tableview using flow logic. It displays all the columns in the database table. How can I set in the code to display only selected columns and not all columns.
Also, in these columns displayed I want to make the key columns of SFLIGHT as non editable and the rest of the columns in SFLIGHT editiable. Can you please kindly share the code to implement this.
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page>
<htmlb:form>
<htmlb:tableView id = "tv1"
visibleRowCount = "10"
selectionMode = "lineEdit"
table = "<%= flights %>"
filter = "SERVER"
sort = "server"
iterator = "<%= iterator %>" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
Thanks
KarenHi,
Please try this code.
<!-- To display Table control on BSP page with table internal table it_hist --!>
<htmlb:tableView id = "TV_HIST"
headerText = "Previous History"
headerVisible = "TRUE"
footerVisible = "TRUE"
design = "ALTERNATING"
selectionMode = "LINEEDIT"
visibleRowCount = "5"
fillUpEmptyRows = "TRUE"
table = "<%= it_hist %>"
width = "500" >
<!-- to show selected columns give required field name --!>
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName = "FIELD1"
title = "COLUMN1"
horizontalAlignment = "CENTER"
width = "65" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "FIELD2"
title = "COLUMN2"
horizontalAlignment = "CENTER"
width = "65" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "FIELD3"
title = "COLUMN3"
horizontalAlignment = "CENTER"
width = "65" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "FIELD4"
title = "COLUMN4"
horizontalAlignment = "CENTER"
width = "65" >
</htmlb:tableViewColumn>
<!-- to make column editable set edit property to TRUE --!>
<htmlb:tableViewColumn columnName = "FIELD4"
title = "COLUMN4"
edit = "TRUE"
horizontalAlignment = "CENTER"
width = "65" >
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView> -
ALV display column and row wise
hi experts,
Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
e.g.display format.
PO Type Shipping Date Invoice Num PCS # Po No. Cust Name Terms Open Balance
Current
Total Current
1 - 15
Total 1 - 15
16-30
Total 16-30
31 - 60
Total 31 - 60
61 - 90
Total 61 - 90
> 90
Total > 90
TOTALhi Lakshman,
i want report for customer open invoices that is aging report,
so depens on due days as per ranges shown in my question like 1--15 days,
15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
please send me any proper solution.
Thanks and Regards,
Yogesh -
Can anybody help....SQL to display row as column and column as rows
Can anybody help in writing a SQL to display row as column and column as rows?
Thankscheck this link:
Re: Creating Views - from rows to a new column? -
Display only one row for distinct columns and with multiple rows their valu
Hi,
I have a table having some similar rows for some columns and multiple different rows for some other columns
i.e
o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
9825000111 01-jan-06 'a' 980515464 01-feb-06 c
9825000111 01-jan-06 'a' 991543154 02-feb-06 d
9825000111 01-jan-06 'a' 154845545 10-mar-06 a
What i want is to display only one row for above distinct row along with multiple non distinct colums
ie
o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
9825000111 01-jan-06 'a' 980515464 01-feb-06 c
991543154 02-feb-06 d
154845545 10-mar-06 a
regards,
KumarRe: SQL Help
-
In the final display list how can i change rows to columns and vice versa
in the final display list how can i change rows to columns and vice versa
It's Urgent
Thanks
BasuHai,
Check this following Threads,
converting rows to columns in internal tables
Re: logic- report to move columns to row in a list
Regards,
Padmam. -
SWAP COLUMNS AND ROW IN AN INTERNAL TABLE to display in ALV
Hi ,
I want to swap all the rows in an internal table with the column of the internal table to display it horizontally in ALV grid.
e.g
1 2 3 (field names)
A P X
B Q Y
C R Z
should look like :
D A B C
E P Q R
F X Y Z
Where D , E, F in first column is already apended in new table.
Or else is there a way to rotate the ALV grid so that it can display rows as columns & columns as rows.
regardshi,
i have an internal table which is like
f1 f2 f3 f4 (column header)
A 1 2 3
B 4 5 6
C 7 8 9
the values in o/p table should be
A B C ( column header)
1 4 7
2 5 8
3 6 9
Please help!! -
How to display the rows in to columns and columns into rows?
DES:- I know by using pivot and unpivot you can convert rows into columns and columns into rows but i don't know how to write the syntax?
Hi,
Besides the places Martin mentioned above, there are many examples in the forum FAQ:
https://community.oracle.com/message/9362005#9362005
For an example of both PIVOT and UNPIVOT in the same query, see
http://forums.oracle.com/forums/thread.jspa?threadID=920854&tstart=0 -
Problem with "PL/SQL Dynamic Content" and displaying rows
hi,
im new to APEX, and pl/sql [but not web dev or sql].
ive found the bit in APEX that lets you add data from your DB using the 'CREATE' > 'PL/SQL Dynamic Content'.
maybe there's a better option for people who dont know pl/sql? i dont know?
however, i think i can getting working with a little bit of help but im stumbling around in the dark a bit here.
ok so this is the pl/sql ive come up with to show three example values on page 23 of my aplplication:
BEGIN
SELECT ID, NAME, OWNER
FROM COM_MAILSHOTS
INTO :P23_ID, :P23_NAME, :P23_OWNER;
END;
im getting the error:
1 error has occurred
ORA-06550: line 5, column 21: PL/SQL: ORA-00933: SQL command not properly ended ORA-06550: line 4, column 1: PL/SQL: SQL Statement ignored
thanks for reading!Metabaron wrote:
hi,
im new to APEX, and pl/sql [but not web dev or sql].
ive found the bit in APEX that lets you add data from your DB using the 'CREATE' > 'PL/SQL Dynamic Content'.
maybe there's a better option for people who dont know pl/sql? i dont know?
The easiest (and best) way to "display rows" is using a report. Dynamic PL/SQL regions are more complex and are required much less frequently.
The Oracle® Database 2 Day + Application Express Developer's Guide tutorial explains how to create reports and other basic APEX techniques. -
Need help in displaying Rows to Columns
Hi,
I am facing problem in displaying Rows to Columns
I am using pivot function:
select *
from
(select vendor_name
from tablea)
pivot
(count(vendor_name)
for vendor_name in ('a,b,'c'));
its working fine showing vendor_name and count
but when i want to display the output as:(How to include the Salalry column in the query?)
Name:{a b c}
Sal Total:(400,600,800}
Any help will be needful for meNot sure what you mean:
select *
from (select deptno,sal from emp)
pivot(sum(sal) for deptno in (10,20,30))
10 20 30
8750 10875 9400
SQL> SY. -
Multiple columns and rows in MessageService
I am attempting to create a message (via MessageService) which has multiple lines of data, and each line has multiple data columns.
Background: My program reads data from a web store, and creates Sales Orders in SBO. A single run might process multiple orders. When all orders have been entered, the program should send a (single) message to a list of recipients. The message will have one line of data for each sales order produced. Each line will contain two fields: the linked SBO sales order number, and the unlinked web order number.
When the message is initially created, I'm defining the multiple columns and initializing the data lines:
pMessageDataColumns = oMessage.MessageDataColumns
pMessageDataColumn = pMessageDataColumns.Add()
pMessageDataColumn.ColumnName = "SalesOrder"
pMessageDataColumn.Link = BoYesNoEnum.tYES
pMessageDataColumn = pMessageDataColumns.Add()
pMessageDataColumn.ColumnName = "WebOrder"
pMessageDataColumn.Link = BoYesNoEnum.tNO
oLines = pMessageDataColumn.MessageDataLines()
Later, as each Sales Order is processed, I'm attempting to inject the two data values into the message data:
oLine = oLines.Add()
oLine.Value = Str(pOrd.DocNum)
oLine.Object = 17
oLine.ObjectKey = Str(pOrd.DocEntry)
oLine = oLines.Add()
oLine.Value = pOrd.WebOrder
The above code would be invoked for each Sales Order processed. However, it generates an "Internal error (-5002) occurred" when the message is ultimately sent.
The SDK documentation states:
The MessageDataLine is a child data structure related to the MessageDataColumn. It contains the value of a specified cell in the Data table, which is defined by its column number (vtIndex of Item of MessageDataColumns) and row number (vtIndex of Item of MessageDataLines).
I guess I don't understand the relationship between adding a "line" in my data display versus adding data into a "column". It appears that the "oLines.Add()" is used to bump across the columns of the data. If so, how do I advance to the next entire row of data in the message?
Thanks, DaveClass Item
Public ItemCode As String
Public Dscription As String
End Class
Dim ItemCodes as new list( of item)
Dim one as new item
one.ItemCode = "ItemCode"
one. Dscription ="Name of Item"
itemcodes.add (one)
Try
Dim oCmpSvc As SAPbobsCOM.CompanyService = _ocmp.GetCompanyService()
Dim oMsgSvc As SAPbobsCOM.MessagesService = oCmpSvc.GetBusinessService(ServiceTypes.MessagesService)
Dim oMsg As SAPbobsCOM.Message = oMsgSvc.GetDataInterface(MessagesServiceDataInterfaces.msdiMessage)
oMsg.Subject = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
oMsg.Text = Msg
Dim oMsgDataColumn As SAPbobsCOM.MessageDataColumn
If ItemCodes.Count > 0 Then
oMsgDataColumn = oMsg.MessageDataColumns.Add()
oMsgDataColumn.ColumnName = "Product / Item Code"
oMsgDataColumn.Link = BoYesNoEnum.tYES
For Each oneitem As Item In ItemCodes
Dim oMsgDataLine As SAPbobsCOM.MessageDataLine = oMsgDataColumn.MessageDataLines.Add()
oMsgDataLine.Object = "4"
oMsgDataLine.ObjectKey = oneitem.ItemCode
oMsgDataLine.Value = oneitem.Dscription
Next
oMsgDataColumn = oMsg.MessageDataColumns.Add()
oMsgDataColumn.ColumnName = "Description"
oMsgDataColumn.Link = BoYesNoEnum.tNO
For Each oneitem As Item In ItemCodes
Dim oMsgDataLine As SAPbobsCOM.MessageDataLine = oMsgDataColumn.MessageDataLines.Add()
oMsgDataLine.Value = oneitem.Dscription
Next
End If
Dim oMsgRecipient As SAPbobsCOM.Recipient = oMsg.RecipientCollection.Add()
oMsgRecipient.UserCode = "manager"
oMsgRecipient.SendInternal = BoYesNoEnum.tYES
oMsgRecipient.SendEmail = BoYesNoEnum.tNO
oMsgSvc.SendMessage(oMsg)
MsgBox("SAP B1 internal Message sent...")
Catch ex As Exception
MsgBox("Unable to send SAP B1 internal message. Error:" + ex.Message)
End Try
End Sub -
Problem in displaying row vale as column name
Hello Experts,
Please help me,its very urgent....
i want to dispaly a column value as a column name.
i have two column into selete statement and i want to dispaly one column value as a column name and other column value as a single row.
My query is :
SELECT MAX(DECODE (NAME,'virtualDeviceId',VALUE))vdid ,
MAX(DECODE (NAME,'virtualDeviceType',VALUE)) vdevtype,
MAX(DECODE (NAME,'domainName',VALUE)) vdevtype1,
MAX(DECODE (NAME,'sCTPPortSip',VALUE)) vdevtype2,
MAX(DECODE (NAME,'signallingIpAddress',VALUE)) vdevtype,
MAX(DECODE (NAME,'signallingNetworkMask',VALUE)) vdevtype,
MAX(DECODE (NAME,'uDPPort',VALUE)) vdevtype,
MAX(DECODE (NAME,'uDPPortEnum',VALUE)) vdevtype,
MAX(DECODE (NAME,'sCTPPort',VALUE)) vdevtype,
MAX(DECODE (NAME,'sCTPPortM3UA',VALUE)) vdevtype FROM(
SELECT extractvalue(VALUE(l),'/S109:trafficParameters/S109:name'
, 'xmlns="http://itprogrammes.intra.bt.com/pdb/capabilities/ManageDaaliResource/2005/11/16" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:S97="http://ccm.intra.bt.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services" xmlns:S109="http://ccm.intra.bt.com/2005/11/16/LIB/Info/MTOSI"') NAME,
extractvalue(VALUE(l),'/S109:trafficParameters/S109:value'
, 'xmlns="http://itprogrammes.intra.bt.com/pdb/capabilities/ManageDaaliResource/2005/11/16" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:S97="http://ccm.intra.bt.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services" xmlns:S109="http://ccm.intra.bt.com/2005/11/16/LIB/Info/MTOSI"') VALUE
FROM INTERFACE_MESSAGE_DESTINATION imd ,TABLE(xmlsequence(EXTRACT(XMLTYPE(imd.remote_request),'/activateConnection_Payload/jobBody/subnetworkConnection/S109:aEndTerminationPoint/S109:managedElement/S109:physicalTerminationPoint/S109:connectionTerminationPoint/S109:trafficDescriptor/*'
, 'xmlns="http://itprogrammes.intra.bt.com/pdb/capabilities/ManageDaaliResource/2005/11/16" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:S97="http://ccm.intra.bt.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services" xmlns:S109="http://ccm.intra.bt.com/2005/11/16/LIB/Info/MTOSI"'))) l
WHERE message_id ='NIAS/0000041608') GROUP BY VALUE ;
output is :
Col1 Col2 col3 col4 col5 col
1.'1001105' '1001105'
2. 'MGC'
3.'value' 'value' 'value'
output display : MGC in Col2 and in row 2, 'values' are in col4 and col5 and in row 3.
I want all values in a single row.
Please help me
Surender RanaIt is ugly to force multiple rows into a single row. But it can be done and can be done dynamically as the following approach shows.
SQL> create or replace type TStrings as table of varchar2(4000);
2 /
Type created.
SQL>
SQL> create or replace function ForceColumns( cur SYS_REFCURSOR ) return TStrings is
2 setCols TStrings;
3 setResults TSTrings;
4 begin
5 setResults := new TStrings();
6 loop
7 fetch cur into setCols;
8 exit when cur%NOTFOUND;
9
10 if setCols.Count > 0 then
11 setResults.Extend( setCols.Count );
12 for i in 1..setCols.Count
13 loop
14 setResults( setResults.Count-i+1 ) := setCols(i);
15 end loop;
16 end if;
17 end loop;
18
19 return(setResults);
20 end;
21 /
Function created.
SQL>
SQL> select
2 ForceColumns(
3 CURSOR(
4 select TStrings(object_id,object_name,object_type) from user_objects where rownum <= 5
5 )
6 ) as RESULT_SET
7 from dual
8 /
RESULT_SET
TSTRINGS('TABLE', 'A', '70998',
'PROCEDURE', 'ABC', '54360',
'TABLE', 'ANIMALS', '84829',
'TABLE', 'B', '69604',
'PROCEDURE', 'BUILDNAMEMAP', '70155')
SQL>Note that as the row can contain any number of columns, it needs to be dynamic. This approach uses a collection type called TStrings to achieve this.
Maybe you are looking for
-
Why Syntax error in this query?
Hi I have this simple query, but in run time I have a "sytax error in INSERT INTO". Why? Statement st = con.createStatement(); st.executeUpdate("INSERT INTO TMail (From, Oggetto) VALUES ('" + from + "', '" + mex.getSubject() + "')");
-
How to revert back from storage(buffer_pool keep) clause
Hi, We have fired "alter TABLE APPLSYS.FND_CONCURRENT_PROGRAMS storage (buffer_pool keep);" But, now we dont want the specified table to be cached in keep pool. So, how to do the same ? Could anybody please suggest ?
-
BitmapData only works inside flash 8 IDE
I need to take a snapshot of the currently playing .flv video: var snap = new BitmapData(70, 52); var mat:Matrix = new Matrix(); mat.scale(70/640, 52/480); // scale to thumbnail size snap.draw(mc, mat); mc contains the video that is currently playing
-
Hi all, I have implemented ACL authorization (Restricted only), and have just created a new ACL scheme in my app is the name of "Registration" same copy of EDIT scheme, I have set following users with these roles: USERS with roles ============= 1. Ad
-
Can anyone help with this problem because I'm really stumped! I'm using Lightroom 5.7 on a Windows 7 laptop & not had any problems up until now but images in Develop mode show large red areas as though they are over exposed (see screen shot). The sam