In Numbers, I want to make 3 rows 50 columns into 3 columns 50 rows.
In just a simple Numbers 09 spreadsheet, no charts, I'm trying to convert the rows and columns to columns and rows to more easily work with the information without scrolling across the page. I would be able to see the information on one page and more easily print a one page documents. I can't seem to figure it out; and the Help option has not been helpful unless you are working with a chart. I don't want a chart, I want to work with the spreadsheet and cells.
Any ideas! I'm sure it is operator error, but it's something I'm not familiar with. I'm new to Apple and definitely new to numbers.
Thanks,
Sandra
You may go to my iDisk (address below)
download :
For_iWork:iWork '09:for_Numbers09:Transpose.zip
Expand the archive
You will get two scripts.
One which transpose the values
One which transpose keeping formulas if the original table is a living one.
Yvan KOENIG (VALLAURIS, France) samedi 8 octobre 2011 09:29:28
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
Similar Messages
-
How to convert single column into single row
I need to convert single column into single row having n no.of.values in a column. without using case or decode. I need a query to display as below.
emp_id
100
101
102
102
103
200
I need output like 100,101,102,103,104.........200.I assume you want to convert 200 rows with one column into one row with 200 columns. If so, this is called pivot. If you know number of rows (max possible number of rows) and you are on 11G you can use PIVOT operator (on lower versions GROUP BY + CASE). Otherwise, if row number isn't known, you can use dynamic SQL or assemble select on clent side. Below is example emp_id = 1,2,..5 (to give you idea) and you are on 11G:
with emp as (
select level emp_id
from dual
connect by level <= 5
select *
from emp
pivot(
max(emp_id) for emp_id in (1 emp_id1,2 emp_id2,3 emp_id3,4 emp_id4,5 emp_id5)
EMP_ID1 EMP_ID2 EMP_ID3 EMP_ID4 EMP_ID5
1 2 3 4 5
SQL>
SY. -
Need to Convert Comma separated data in a column into individual rows from
Hi,
I need to Convert Comma separated data in a column into individual rows from a table.
Eg: JOB1 SMITH,ALLEN,WARD,JONES
OUTPUT required ;-
JOB1 SMITH
JOB1 ALLEN
JOB1 WARD
JOB1 JONES
Got a solution using Oracle provided regexp_substr function, which comes handy for this scenario.
But I need to use a database independent solution
Thanks in advance for your valuable inputs.
GeorgeGo for ETL solution. There are couple of ways to implement.
If helps mark -
Every two charater of a column into a row
Hello everyone,
I am trying to convert every two characters of a column into a row.
Something like...
with t as
SELECT
'00112233445566778899' TN
FROM dual
--union all
--select 'xxyyzzaabbccddeeffgg' from
--dual
SELECT SUBSTR
( tn
, decode(n,0,0,(((n*2)+1)-2))
, 2
) AS token ,n
FROM ( select * from t
, ( SELECT LEVEL n
FROM (SELECT length(tn)/2 max_elements FROM t)
CONNECT BY LEVEL <= max_elements +30
WHERE n <= LENGTH(tn) /2
TO N
00 1
11 2
22 3
33 4
44 5
55 6
66 7
77 8
88 9
99 10The above query fails when I try to do it for multiple rows(It goes in an infinite loop).
Is there a way to convert ever two characters of a column into a row.
I am using Oracle 9i.
Thanks in Advance,
Jaggyamjaggyam wrote:
Note : I am using 9i.It's usually a good idea to mention that at the beginning otherwise we have to assume you are using the latest/supported versions of oracle.
Does this work in 9i.... (I don't have an old version to try it on)
SQL> ed
Wrote file afiedt.buf
1 with t as (select '00112233445566778899' as txt from dual union all
2 select 'aabbccddeeff' from dual)
3 ,m as (select max(length(txt)/2) mx from t)
4 --
5 select txt
6 from (
7 select substr(txt, ((rn-1)*2)+1, 2) as txt
8 from t, (select rownum rn from m connect by rownum <= mx)
9 )
10* where txt is not null
SQL> /
TX
00
aa
11
bb
22
cc
33
dd
44
ee
55
ff
66
77
88
99
16 rows selected.
SQL> -
Hi guys
i have data coming in multiple rows and want to show same data in columns like multiple colours per product. colour are fixed in numbers i.e only three colours are there per product not more than that..
sample data is like this
id product_name colour
101 A red
101 A black
101 A Green
result required:-
id product_name colour1 colour2 colour3
101 A red black green
thanks & RegardsHi,
That's called a Pivot. In Oracle 8.1 and higher, you can use ROW_NUMBER, CASE, and an aggregate function, such as MIN for pivoting. (Starting in Oracle 11, there's SELECT ... PIVOT.)
You didn't post CREATE TABLE and INSERT statements for your table, so I'll use scott.emp to illustrate:
WITH got_r_num AS
SELECT deptno
, job
, ename
, ROW_NUMBER () OVER ( PARTITION BY deptno
, job
ORDER BY ename
) AS r_num
FROM scott.emp
SELECT deptno
, job
, MIN (CASE WHEN r_num = 1 THEN ename END) AS ename_1
, MIN (CASE WHEN r_num = 2 THEN ename END) AS ename_2
, MIN (CASE WHEN r_num = 3 THEN ename END) AS ename_3
FROM got_r_num
GROUP BY deptno
, job
ORDER BY deptno
, job
Output:
DEPTNO JOB ENAME_1 ENAME_2 ENAME_3
10 CLERK MILLER
10 MANAGER CLARK
10 PRESIDENT KING
20 ANALYST FORD SCOTT
20 CLERK ADAMS SMITH
20 MANAGER JONES
30 CLERK JAMES
30 MANAGER BLAKE
30 SALESMAN ALLEN MARTIN TURNER
If you do happen to have more than 3 items, the query still works, but only the first 3 are shown. (In deptno=10, there is a 4th SALESMAN named WARD.) -
Showing report data columns into two rows instead of one row using SSRS 2012
Hi All,
I have a ssrs report with 13 columns and I want to show those 13 columns data into two rows instead of showing in one row. please send me step by step process.
id fullname firstname lastname mailingaddress billingaddress
city state zipcode
1 ABC A C
xyz xyz123 york
PA 12345
homephone cellphone workphone company
1234567890 4567890123 0123456789 ABC,Inc
id fullname firstname lastname mailingaddress billingaddress
city state zipcode
2 XYZ X Z
abc abc123 lewisburg
PA 54321
homephone cellphone workphone company
4567890123 0123456789 1234567890 xyz,Inc
id fullname firstname lastname mailingaddress billingaddress
city state zipcode
3 BCD B D
123abc xyz123 leesburg PA
54123
homephone cellphone workphone company
4567895623 0783456789 1238967890 Hey,Inc
Thanks in advance,
RH
sqlDo a right mouse click on the left, gray row marker => "Insert Row"=> "Inside Group
- Above or Below", then you get a second detail row.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Row values into column....
Hi Experts,
Can i add column values into a single cell. Like my requirement is i want to add values of Name column in a single cell of some other table. For example if Table A contains A, B, C D names then in second table i want all these name in one cell as ABCD. I'm not able to find solution. please help me. i'm working on ODI. Any help or clue.
Regards
-KirtiHi,
2 suggestions:
1) If you have a constant number of columns you could put, at an interface, so much "instances" of the datastore as the number of columns, create the join and put the necessary filter at each "instance". The mapping will be the concatenation of the column from each instance
or
2) Create a procedure where you have the select column_to_be_concatenated at Source TAB and an update of that at Target TAB (if necessary you can define a dynamic PL/SQL to deal with insert update!)
Does it help you? -
How to copy existing row value into new row with a trigger. Same table
Oracle guru,
I am looking for a before or after trigger statement that will copy existing values inserted in the previous row into columns A & B. Then insert those values in a new row into column A & B if null? Same table. Hopefully my question is clear enough.
-Oracle 10g express
-I have an existing " before insert trigger" that insert id and timestamps when a new row is created.
-Table is composed of column like id,timestamps,A,B and more.
Thanks in advance
Pierre957911 wrote:
Oracle guru,
I am looking for a before or after trigger statement that will copy existing values inserted in the previous row into columns A & B. Then insert those values in a new row into column A & B if null? Same table. Hopefully my question is clear enough.
-Oracle 10g express
-I have an existing " before insert trigger" that insert id and timestamps when a new row is created.
-Table is composed of column like id,timestamps,A,B and more.
Thanks in advance
PierreI will call it a very Wrong design.
It is a wrong Table Design. You are duplicating the data in table and not complying with the Database Normalization rules.
How about Verifying if Column A & B are NULL before inserting and inserting another row and avoiding it in Triggers?
If you are bent to achieve this, below code might be helpful. However, I would never go with this approach. If you would care about explaining the reason for going ahead with such a data model, people could suggest better alternative that might conform with Normalization rules.
create or replace trigger trg_test_table
after insert on test_table
for each row
declare
pragma autonomous_transaction;
begin
if :new.col_a is null and :new.col_b is null then
insert into test_table
select 2, systimestamp, col_a, col_b
from test_table
where pk_col = (select max(pk_col) from test_table b where b.pk_col < :new.pk_col);
end if;
commit;
end trg_test_table;Read SQL and PL/SQL FAQ and post the mentioned details.
Do not forget to mention output from
select * from v$version; -
How to break one row records into 3 row records
I have two tables which consists of date records,
table1
first_date second_date
01-feb-10 01-mar-10
tabl2
new_date old_date
01-jan-10 01-aug-10
if first table dates falls between new_date and old_dates, i need to showit as three row records instead of1 row in table2Hi,
1001383 wrote:
I have two tables which consists of date records,
table1
first_date second_date
01-feb-10 01-mar-10
tabl2
new_date old_date
01-jan-10 01-aug-10
if first table dates falls between new_date and old_dates, i need to showit as three row records instead of1 row in table2Do both first_date and second_date have to fall between old_date and new_date, or is it enough if either one does?
What do you want to see on those 3 rows?
Depending on your data and your requirements, here's one way:
WITH cntr AS
SELECT LEVEL AS n
FROM dual
CONNECT BY LEVEL <= 3
SELECT t2.*
FROM table2 t2
CROSS JOIN cntr
WHERE EXISTS (
' SELECT 1
FROM table1 t1
WHERE t1.first_date BETWEEN t2.old_date AND t2.new_date
OR t1.second_date BETWEEN t2.old_date AND t2.new_date
;I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements) for both tables, and the results you want from that data.
Include examples of any special situations you need to handle, such as the same row in table2 matching several rows in table1.
See the forum FAQ {message:id=9360002} -
Make 1 row turn into X rows, based on value X in column?
Hello everyone, got a question for you! I've got a table as follows:
ITEM_NUM,IN_STOCK
1001A,2
1001B,1
1001C,2
1001D,3
I'd like to get the following output:
1 1001A
2 1001A
3 1001B
4 1001C
5 1001C
6 1001D
7 1001D
8 1001D
So each row gets repeated for as many times as it has for the in_stock value. And down the left side, we get rownum.
I can do this with PL/SQL code (a cursor to get both columns, and for each row, run a loop to place these into a collection). But if there's a way just to skip the loop and write a query, I'd rather do this!
Thanks!
-Thomas HWell you can pretty much use any row source here but I favour pipelined function for overall simplicity / clarity and performance.
Personal Oracle Database 10g Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE TABLE t (item_num VARCHAR2 (5), in_stock NUMBER);
Table created.
SQL> INSERT INTO t VALUES ('1001A',2);
1 row created.
SQL> INSERT INTO t VALUES ('1001B',1);
1 row created.
SQL> INSERT INTO t VALUES ('1001C',2);
1 row created.
SQL> INSERT INTO t VALUES ('1001D',3);
1 row created.
SQL> CREATE OR REPLACE FUNCTION many (
2 p_rows IN NUMBER)
3 RETURN number_table PIPELINED
4 IS
5 BEGIN
6 FOR l_row IN 1..p_rows LOOP
7 PIPE ROW (l_row);
8 END LOOP;
9 RETURN;
10 END;
11 /
Function created.
SQL> SELECT ROWNUM, item_num
2 FROM t, TABLE (many (in_stock));
ROWNUM ITEM_
1 1001A
2 1001A
3 1001B
4 1001C
5 1001C
6 1001D
7 1001D
8 1001D
8 rows selected.
SQL> -
How to convert row data into columns without using pivot table?
Hello guys
I have a report that has several columns about sales call type and call counts
It looks like this:
Calls Type Call Counts
Missed 200
Handled 3000000
Rejected 40000
Dropped 50000
Now I wanna create a report that look like this:
Missed call counts Handled Call counts Rejected Counts Drop counts Other Columns
200 300000000 40000 50000 Data
So that I can perform other calculations on the difference and comparison of handled calls counts vs other call counts..
I know pivot table view can make the report look like in such way, but they cant do further calculations on that..
So I need to create new solid columns that capture call counts based on call types..
How would I be able to do that on Answers? I don't have access to the RPD, so is it possible to do it sololy on answers? Or should I just ask ETL support on this?
Any pointers will be deeply appreciated!
Thank youThanks MMA
I followed your guidance and I was able to create a few new columns of call missed count, call handled counts and call abandoned counts.. Then I create new columns of ave missed counts, ave handled counts and so forth..
Then I went to the pivot view, I realized there is a small problem.. Basically the report still includes the column "call types" which has 3 different types of call "miss, abandon and handled". When I exclude this column in my report, the rest of the measures will return wrong values. When I include this column in the report, it shows duplicate values by 3 rows. It looks like this:
Queue name Call types Call handled Call missed Call abondoned
A Miss 8 10 15
A Handled 8 10 15
A Abandoned 8 10 15
in pivot table view, if I move call type to column area, the resulted measures will become 8X3, 10X3 and 15X3
So is there a way to eliminate duplicate rows or let the system know not to mulitply by 3?
Or is this as far as presentation service can go in terms of this? Or should I advice to provide better data from the back end?
Please let me know, thanks -
Concat different rows column into single row field
Hi,
I have a table tblSite which has SiteID and SiteInvestigator. Can I concat different row base on siteID.
SiteID -- SiteInvestigator
1 -- x
1 -- y
2 -- z
2 -- x1
3 -- x2
Basicaly I want data look like this,
sitid --siteinvestigator
1 -- x,y
2 -- z,x1
3 -- x2
I want to use only sql query or create a view to get data like this. No stored procedure please.
Can somebody help?
Regards,
Vinaythis example might be of help.
SQL> select * from tab1;
COL1 COL2 COL3 COL4
Sofinummer 1 occupation 1
Sofinummer 1 occupation 2
Sofinummer 1 occupation 3
Sofinummer 2 occupation 1
SQL> select col1, col2,
2 substr(replace(max(substr(sys_connect_by_path (col3||' '||
3 col4, '-'),2)),'-',' '),1,60)
4 as col3
5 from tab1
6 start with col4 = 1
7 connect by col4 = prior col4 + 1
8 and prior col1 = col1
9 and prior col2 = col2
10 group by col1, col2;
COL1 COL2 COL3
Sofinummer 1 occupation 1 occupation 2 occupation 3
Sofinummer 2 occupation 1
SQL> -
To get all the required data in a column into a row
Hi,
I have a table T which contains columns Id,Name,Type
The structure of the table will be like
Id Name Type
1 ABC S
2 DEF F
1 ADR F
3 ASD D
1 DCH C
1 ADE S
2 CDF D
I need an output like this
Id Types
1 S,F,C
2 F,D
3 D
Can any one help me in this regard. It will be thankful.
Thank You
11081985Hi,
That's called String Aggregation . The following page shows several ways to do it:
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
Which way is best for you? That depends on your requirements (e.g., Is order important? What to do about duyplicates?) and your version of Oracle.
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, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ {message:id=9360002} -
I want to order several photos. I have flagged them and there is no option to select all and order the prints. I don't want to create a new event with these photos, as I want them in their original event files.
How are multiple photos ordered/exported for printing?Go to your Flagged Photos Smrt Album on the Left.
Command - a will select All
Then File -> New -> Album
Regards
TD -
Please help - Joining three tables and get row values into Column. Please help!
Hi,
There is a SourceTable1 (Employee) with Columns like EmployeeID,Name,DOB.
There is a sourcetable2 (EmployeeCode) with columns like EmployeeID,Code,Order.
There is a source table 3 #EmployeeRegioncode and its columns are (EmployeeID , RegionCode , [Order]
The target table 'EmployeeDetails' has the following details. EmployeeID,Name,DOB,Code1,Code2,Code3,Code4,regioncode1
regioncode2 ,regioncode3 ,regioncode4
The requirement is , the value of the target table columns the Code1,code2,code3 ,code4,code5 values should
be column 'Code' from Sourcetable2 where its 'Order' column is accordingly. ie) Code1 value should be the 'Code' value where [Order] column =1, and Code2 value should be the 'Code' value where [Order] =2, and so on.
Same is the case for Source table 3- 'Region code' column also for the columns regioncode1
regioncode2 ,regioncode3 ,regioncode4
Here is the DDL and Sample date for your ref.
IF OBJECT_ID('TEMPDB..#Employee') IS NOT NULL DROP TABLE #Employee;
IF OBJECT_ID('TEMPDB..#EmployeeCode') IS NOT NULL DROP TABLE #EmployeeCode;
IF OBJECT_ID('TEMPDB..#EmployeeDetails') IS NOT NULL DROP TABLE #EmployeeDetails;
---Source1
CREATE table #Employee
(EmployeeID int, Empname varchar(20), DOB date )
insert into #Employee VALUES (1000,'Sachin','1975-12-12')
insert into #Employee VALUES (1001,'Sara','1996-12-10')
insert into #Employee VALUES (1002,'Arjun','2000-12-12')
---Source2
CREATE table #EmployeeCode
(EmployeeID int, Code varchar(10), [Order] int)
insert into #EmployeeCode VALUES (1000,'AA',1)
insert into #EmployeeCode VALUES (1000,'BB',2)
insert into #EmployeeCode VALUES (1000,'CC',3)
insert into #EmployeeCode VALUES (1001,'AAA',1)
insert into #EmployeeCode VALUES (1001,'BBB',2)
insert into #EmployeeCode VALUES (1001,'CCC',3)
insert into #EmployeeCode VALUES (1001,'DDD',4)
insert into #EmployeeCode VALUES (1002,'AAAA',1)
insert into #EmployeeCode VALUES (1002,'BBBB',2)
insert into #EmployeeCode VALUES (1002,'CCCC',3)
insert into #EmployeeCode VALUES (1002,'DDDD',4)
insert into #EmployeeCode VALUES (1002,'EEEE',5)
---Source tbl 3
CREATE table #EmployeeRegioncode
(EmployeeID int, RegionCode varchar(10), [Order] int)
insert into #EmployeeRegioncode VALUES (1000,'xx',1)
insert into #EmployeeRegioncode VALUES (1000,'yy',2)
insert into #EmployeeRegioncode VALUES (1000,'zz',3)
insert into #EmployeeRegioncode VALUES (1001,'xx',1)
insert into #EmployeeRegioncode VALUES (1001,'yy',2)
insert into #EmployeeRegioncode VALUES (1001,'zz',3)
insert into #EmployeeRegioncode VALUES (1001,'xy',4)
insert into #EmployeeRegioncode VALUES (1002,'qq',1)
insert into #EmployeeRegioncode VALUES (1002,'rr',2)
insert into #EmployeeRegioncode VALUES (1002,'ss',3)
---Target
Create table #EmployeeDetails
(EmployeeID int, Code1 varchar(10), Code2 varchar(10),Code3 varchar(10),Code4 varchar(10),Code5 varchar(10) , regioncode1 varchar(10),
regioncode2 varchar(10),regioncode3 varchar(10),regioncode4 varchar(10))
insert into #EmployeeDetails VALUES (1000,'AA','BB','CC','','','xx','yy','zz','')
insert into #EmployeeDetails VALUES (1001,'AAA','BBB','CCC','DDD','','xx','yy','zz','xy')
insert into #EmployeeDetails VALUES (1002,'AAAA','BBBB','CCCC','DDDD','EEEE','qq','rr','ss','')
SELECT * FROM #Employee
SELECT * FROM #EmployeeCode
SELECT * FROM #EmployeeRegioncode
SELECT * FROM #EmployeeDetails
Can you please help me to get the desired /targetoutput? I have sql server 2008.
Your help is greatly appreciated.select a.EmployeeID,b.code1,b.code2,b.code3,b.code4,b.code5,c.Reg1,c.Reg2,c.Reg3,c.Reg4 from
#Employee a
left outer join
(select EmployeeID,max(case when [Order] =1 then Code else '' end) code1,
max(case when [Order] =2 then Code else '' end)code2,
max(case when [Order] =3 then Code else '' end)code3,
max(case when [Order] =4 then Code else '' end)code4,
max(case when [Order] =5 then Code else '' end)code5 from #EmployeeCode group by EmployeeID) b
on a.EmployeeID=b.EmployeeID
left outer join
(select EmployeeID,max(case when [Order] =1 then RegionCode else '' end) Reg1,
max(case when [Order] =2 then RegionCode else '' end)Reg2,
max(case when [Order] =3 then RegionCode else '' end)Reg3,
max(case when [Order] =4 then RegionCode else '' end)Reg4 from #EmployeeRegioncode group by EmployeeID) c
on a.EmployeeID=c.EmployeeID
Thanks
Saravana Kumar C
Maybe you are looking for
-
Can not reinstall Java 7 on Windows 8 x64
Hi, Restinstalling Java 7 opens a dialog box saying that Java is already installed and should be uninstalled first. When I click on Yes to go on with unstalling, I get a second msg box saying that this action is only valid on installed products. I tr
-
Print button low resolution (72dpi) prints and PDFs
Hello, When I printed single pages from an Aperture book using the 'Print..' button the prints look rather soft. For the prints, this is not much of a problem (just proofing), but I'm having the same problem when I print a book to PDF (or JPEG) that
-
Thunderbolt to usb Mixing desk
Im running Reaper as my DAW (Recording soft wear) on my iMac, is there a USB to Thunderbolt lead Available to use from USB from my Allen & Heath Desk to my Thunderbolt input to make the transfer of data faster and higher quality? `
-
Rac node failure crs cleanup failing
I have a three node rac database, 10.2.0.4 running on Windows server 2008. I lost a hard drive on one of the servers and it corrupted the mirror disk as well so I am having to rebuild. I am going through these procedures, RAC on Windows: How to Clean
-
Strange Slow Down OSX 10.4.x
Has anyone experienced this and solved it? I am having a strange problem. The system slows down until it eventually requires a reboot. It can see the problem the worst with PHP/Webmail application(s). However if I do a "time which ls" when there is a