Transposing columns to rows in excel through ODI
Hi all,
We are trying to transpose Columns to rows along with Headers considering excel as source and oracle table as target
For example we are having metadata and data in Excel sheet like below
Metadata:- A,B,TC1,TD1,L1,U1,TC2,TD2,L2,U2,TC3,TD3,L3,U3
Data:- X,Y,1,2,3,4,5,6,7,8,9,10,11,12
M,N,a,b,c,d,e,f,g,h,i,j,k,l
Then we need in the below way in oracle table
A,B,TC1,TD1,L1,U1
X,Y,1,2,3,4
X,Y,5,6,7,8
X,Y,9,10,11,12
M,N,a,b,c,d
M,N,e,f,g,h
M,N,i,j,k,l
Is there any process to achieve this?
If so Please let us know
Thanks in advance
Hi SH,
Thanks for your reply
We already tried http://s3.amazonaws.com/Ora/KM_IKM_Pivot.zip by following the link https://community.oracle.com/thread/904535?tstart=0
But unfortunately we got the same error which is mentioned in that link
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 35, in ?
java.sql.SQLException: Invalid column name
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
I am newbie to odi - if possible can you please guide me how to do transpose in odi by considering excel as source and oracle as target
Thanks
Similar Messages
-
How to transpose columns to rows in ODI
Hi,
I am trying to transpose Columns to rows along with Headers. For instance if i have
Account Name | Assigned To | Lead Source | Currency | Onsite_April |Offisite_April2 | FCST AMC LIC April
| | | | | |
Microsoft | Mark | Channel1 | INR | 1000 | 2000 | 3000
Then i need in the below way
Account Name | Assigned To | Lead Source | Currency | Month | Amount
| | | | |
Microsoft | Mark | Channel1 | INR | Onsite_April | 1000
Microsoft | Mark | Channel1 | INR | Offisite_April2 | 2000
Microsoft | Mark | Channel1 | INR | FCST AMC LIC April | 3000
Is there any specific function where i can achieve this?
More over i need break up Month column into two i.e Onsite_April will be Onsite (in one column) April (in another column).Hi
here is what i got by using the above KM
create table cad_temp_1(item_id number, location_id number, sales_date_ud1 varchar2(100), qty_ud2 number);
create table cad_temp_2(item_id number, location_id number, D01012010 number, D01022010 number);
insert into cad_temp_2 values(1,1,200,300);
commit;
Source in interface is : cad_temp_2
Target is: cad_temp_1
Mapping is
Item_id - Item_id execute on: CAD_TEMP_2 (Source selected) Update - Insert and Update checked
Location_id - Location_id execute on: CAD_TEMP_2 (Source selected) Update - Insert and Update checked
sales_date_ud1 - :NA execute on: <null> (Target selected) Update - Insert, Update, UD1 selected
qty_ud2 - :NA execute on : <null> (Target selected) Update - Insert, Update, UD2 selected.
Execute the interface
It works.
Thanks
Bhaskar -
Transpose columns and rows in numbers
I need to transpose columns and rows in Numbers and I do not want to write script to do it. Is there an easier way?
Give me a proper transpose and I will uninstall Excel and never look back.
Ok, here's a proper transpose, that can be placed in an Automator Service so it becomes a simple menu pick as below (and can also be assigned a keyboard shortcut).
To use it (this is slightly different from Excel) you select the range you want to transpose, choose Copy Transpose, click a destination cell in an existing table in the current document or another document, and command-v (Edit > Paste) or option-shift-command-v (Edit > Paste and Match Style).
The one-time setup is as follows. In Automator choose File > New > Service, drag a Run AppleScript action from the left into the right pane, choose 'No Input' for 'Services receives selected' and 'Numbers' for 'in'. Then paste the following into the Run AppleScript action, replacing all text already there by default:
--Transpose - select range, run, paste transposed values where wanted
try
tell application "Numbers" to tell front document to tell active sheet
set selected_table to first table whose class of selection range is range
tell selected_table
set my_selection to the selection range
set first_col to address of first column of my_selection
set last_col to address of last column of my_selection
set first_row to address of first row of my_selection
set last_row to address of last row of my_selection
set str to ""
repeat with i from first_col to last_col
repeat with j from first_row to last_row
set str to str & (value of cell j of column i of selected_table) & tab
end repeat
set str to str & return -- add line return after row
end repeat
end tell
end tell
set the clipboard to str
display notification "Ready to paste transposed values" with title "Numbers"
on error
display dialog "Select a range first and then try again"
end try
--end script
Hit the compile "hammer" and the script should indent properly. Then save the service with the name you want to appear in your menu, and it will thereafter be available via the Services menu (and keyboard shortcut, if you set one up in System Preferences > Keyboard > Shortcuts > Services).
That's it. Less then five minutes' one-time set-up work and you've got a menu pick for a transpose functionality that is as convenient as Excel's.
SG -
HI All,
I want to transpose columns to rows in my reports. I tried through Pivot Table and i was able to do that, but columns name are not appearing in the left.
Plz help me out how to do that with column name/
Can we do the same with measure also???
ThanksAll, thanks for the information.
I have a similar requirement as being discussed here. However, I do not have any measures in my report. It is a plain request which fetches data in three columns A, B and C (and variable number of rows depending on the data available).
Can I still use pivot table to transpose this data such that the resultant display would have three rows always and variable number of columns, with the first column containing the header A, B and C ? If yes, how do I go about it? Else, is there any other approach?
Thanks again
I
Edited by: user635102 on Sep 18, 2008 12:31 PM -
hi ,
i need to transpose columns into rows ,
i know i can use the UNION ALL but my num of columns will most likely not be fixed so how can i do that ?
pls adviseThis is from one of the forms link,, i reallyy dont know the link, but i guess this is "adrains" code
SQL> WITH ilv AS (
2 SELECT str || ',' AS str
3 , (LENGTH(str) - LENGTH(REPLACE(str, ','))) + 1 AS no_of_elements
4 FROM t
5 )
6 SELECT RTRIM(str, ',') AS original_string
7 , SUBSTR(str, start_pos, (next_pos-start_pos)) AS single_element
8 , element_no
9 FROM (
10 SELECT ilv.str
11 , nt.column_value AS element_no
12 , INSTR(
13 ilv.str,
14 ',',
15 DECODE(nt.column_value, 1, 0, 1),
16 DECODE(nt.column_value, 1, 1, nt.column_value-1)) + 1 AS start_pos
17 , INSTR(
18 ilv.str,
19 ',',
20 1,
21 DECODE(nt.column_value, 1, 1, nt.column_value)) AS next_pos
22 FROM ilv
23 , TABLE(
24 CAST(
25 MULTISET(
26 SELECT ROWNUM FROM dual CONNECT BY ROWNUM < ilv.no_of_elements
27 ) AS number_ntt )) nt
28 );
ORIGINAL_STRING SINGLE_ELEMENT ELEMENT_NO
X,Y,Z X 1
X,Y,Z Y 2
X,Y,Z Z 3
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG XXX 1
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG Y 2
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG ZZ 3
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG AAAAA 4
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG B 5
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG CCC 6
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG D 7
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG E 8
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG F 9
XXX,Y,ZZ,AAAAA,B,CCC,D,E,F,GGG GGG 10
13 rows selected.
Note that the above SQL performs the following steps:
* determines how many elements are in each string (WITH clause);
* for each string, generates a collection of n elements (TABLE expression), where n is the derived number of elements in the string. Note in particular the use of "less than" in the "CONNECT BY ROWNUM < ilv.no_of_elements" on line 26. In all versions other than 10.1.x, this will need to be "CONNECT BY ROWNUM <= ilv.no_of_elements" (i.e. "less than or equal to"). There is an unusual bug with this row-generation technique in 10.1 that generates an additional row from the CONNECT BY;
* uses the generated rows in a Cartesian Product with the original data to generate n rows per string, based on the above definition of n;
* calculates the start and end position of each element in each string (INSTR); and
* cuts each element from each string (SUBSTR). -
Transpose columns and rows / Switch columns and rows
Hello,
Is it possible to interchange columns and rows in order to create a left-to-right scrolling table instead of a top-to-bottom scrolling one?
In detail:
I have this:
| col 1 | col 2 | col 3
row 1 | | |
row 2 | | |
row 3 | | |
... | | |
...and want to have this:
| row 1 | row 2 | row 3 | ...
col 1 | | | |
col 2 | | | |
col 3 | | | |
Does anyone know if this is possible with the standard table or the ALV?
Thanks in advance & Kind regards,
RobertHi,
So there is no easy solution by just setting a flag in the ALV config!? ...too bad!
As for the dynamic creation:
Would there be an issue with different data types in one "column" (former row)? As a matter of fact there probably will be a mix of character, numbers, ...
Regards,
Robert -
How to transpose columns to rows?
Hi,
here is my situation and I would love is someone could give me some help.
This is how my data is currently presented(first line represents the header, the second line represents the value:
Number A1 A2 B1 B2 C1 C2
001187 1 2 1 6 1 1
and I would need to get it into the following format:
Number A B C
001187 1 1 1
001187 2 6 1
In summary all values from columns with same start name should be transposed into one column.
Would anyone have any suggestions?Assuming you have one table that has the columns : Number A1 A2 B1 B2 C1 C2
then something like :
select number, a, b, c
from (select 1 the_order, number, a1 a, b1 b, c1 c
from table
union all
select 2 the_order, number, a2 a, b2 b, c2 c
from table)
order by number, the_order -
How to transpose columns to rows in OBIEE
Lets say I have a row of data with 3 columns as shown below.
Col1 Col1 Col3
Val1 Val2 Val3
How can this be shown as 3 rows as below
Col 1 Val1
Col 2 Val2
Col 3 Val2
Thanks.Use the Narrative View
Prefix: <table border=1>
Narrative:
<tr><td>Col1</d><td>@1</td></tr>
<tr><td>Col2</d><td>@2</td></tr>
<tr><td>Col3</d><td>@3</td></tr>
Postfix:
</table>
Enjoy! -
Transpose columns into rows-Please Help
Hi,
I have a table(test_data) in following format:
F_P reference_id first_nm last_nm
EM_NULL 0 0 0
EM_NOT_NULL 0 0 0
DM_NULL 1296 145 1689
DM_NOT_NULL 0 0 0I need to transpose the the above table as :
Column_Name EM_NULL EM_NOT_null DM_null DM_not_null
Reference_ID 0 0 1296 0
first_nm 0 0 145 0
last_nm 0 0 1689 0I tried below code but unable to get the first column values as reference_id,first_nm,last_nm although I was successful in getting the other column values.Below is the code:
With
lines as (select level line from dual connect by level <= 3),
cols as (select level col from dual connect by level <= 3)
select
max(decode(col, 1,
decode(line, 1, to_number('REFERENCE_ID') ,
2, to_number('FIRST_NM'),
3, to_number('LAST_NM')
)))column_name,
max(decode(col, 2,
decode(line, 1, REFERENCE_ID,
2, FIRST_NM,
3, LAST_NM
)))EM_NULL,
max(decode(col, 3,
decode(line, 1, REFERENCE_ID,
2, FIRST_NM,
3, LAST_NM
)))EM_NOT_NULL,
max(decode(col, 4,
decode(line, 1, REFERENCE_ID,
2, FIRST_NM,
3, LAST_NM
)))DM_NULL,
max(decode(col, 5,
decode(line, 1, REFERENCE_ID,
2, FIRST_NM,
3, LAST_NM
)))DM_NULL
from lines, cols,
(select rownum rn, TEST_DATA.* from Test_Data)
where rn = col
group by line
order by lineBut since my 1st column values are character its not allowing me the group by function.
Edited by: BluShadow on 23-Sep-2011 08:31
formatted and added {noformat}{noformat} tags.I think you want something like this...
SQL> ed
Wrote file afiedt.buf
1 with test_data as (select 'EM_NULL' as f_p, 0 as reference_id, 0 as first_nm, 0 as last_nm from dual union all
2 select 'EM_NOT_NULL', 0, 0, 0 from dual union all
3 select 'DM_NULL', 1296, 145, 1689 from dual union all
4 select 'DM_NOT_NULL', 0, 0, 0 from dual)
5 --
6 -- end of test data
7 --
8 select decode(rn,1,'Reference_ID',2,'first_nm',3,'last_nm') as Column_name
9 ,max(decode(f_p,'EM_NULL',decode(rn,1,reference_id,2,first_nm,3,last_nm))) as EM_NULL
10 ,max(decode(f_p,'EM_NOT_NULL',decode(rn,1,reference_id,2,first_nm,3,last_nm))) as EM_NOT_NULL
11 ,max(decode(f_p,'DM_NULL',decode(rn,1,reference_id,2,first_nm,3,last_nm))) as DM_NULL
12 ,max(decode(f_p,'DM_NOT_NULL',decode(rn,1,reference_id,2,first_nm,3,last_nm))) as DM_NOT_NULL
13 from test_data, (select rownum rn from dual connect by rownum <= 3)
14 group by decode(rn,1,'Reference_ID',2,'first_nm',3,'last_nm')
15* order by decode(Column_name,'Reference_ID',1,'first_nm',2,3)
SQL> /
COLUMN_NAME EM_NULL EM_NOT_NULL DM_NULL DM_NOT_NULL
Reference_ID 0 0 1296 0
first_nm 0 0 145 0
last_nm 0 0 1689 0Unless you're using 11g and then you could look at the new PIVOT/UNPIVOT keywords -
Unable to Transpose Columns to Rows in DataExport Command
Hi,
The Data export code for On and Off Gives me the same result
SET LOCKBLOCK HIGH;
SET CACHE HIGH;
SET CALCPARALLEL 3;
SET DATAEXPORTOPTIONS
DataExportLevel "LEVEL0";
DataExportColFormat ON;
DataExportOverwriteFile ON;
DataExportDimHeader OFF;
DataExportRelationalFile ON;
DataExportColHeader "Scenario";
FIX ("SAP",&CurrFcst,&Currmnth:Sep,"Forecast Employees",&CurrFY,@IDescendents("All_Cost_Center"),@IDescendents("Pay Type"),@IDescendents("Work Type"),@IDescendents("Other_Accounts")
DATAEXPORT "File" "," $DataExportPath "0";
ENDFIX;
ENDFIX;
Result
WT"|"Non-Exempt"|7|5|5|5|5|4|4|4|4|4
"SAP"|"FY13"|"Plan"|"A100C30100"|"Forecast Employees"|"Full-Time"|"Indirect WT"|"Exempt"|3|3|3|3|3|3|3|3|3|3
"SAP"|"FY13"|"Plan"|"A100C30110"|"Forecast Employees"|"Full-Time"|"Direct WT"|"Exempt"|8|6|6|6|6|6|6|6|6|6
"SAP"|"FY13"|"Plan"|"A100C30120"|"Forecast Employees"|"Full-Time"|"Direct WT"|"Exempt"|7|4|4|4|4|4|4|4|4|4
"SAP"|"FY13"|"Plan"|"A100C30130"|"Forecast Employees"|"Full-Time"|"Direct WT"|"Exempt"|4|4|4|4|4|4|4|4|4|4
"SAP"|"FY13"|"Plan"|"A100C30160"|"Forecast Employees"|"Full-Time"|"Indirect WT"|"Exempt"|5|4|4|4|4|3|3|3|3|3
The way that i want the Data to be Represented is
SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Jan" 5.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Feb" 5.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Mar" 5.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Apr" 5.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "May" 4.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Jun" 4.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Jul" 4.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Aug" 4.0000
"SAP" "Plan" "Forecast Employees" "FY13" "A100C20270" "Non-Exempt" "Direct WT" "Full-Time" "Sep" 4.0000
I believe that this issue is because of the Range that is used (&Currmnth:Sep)
Could Someone help on this Issue.
Thanks,
JoeI hope below code will give you result desired format, changes I made are in bold and italics
SET LOCKBLOCK HIGH;
SET CACHE HIGH;
SET CALCPARALLEL 3;
SET DATAEXPORTOPTIONS
DataExportLevel "LEVEL0";
DataExportColFormat OFF;
DataExportOverwriteFile ON;
DataExportDimHeader OFF;
DataExportRelationalFile ON;
+/*DataExportColHeader "Scenario"*/+;
FIX ("SAP",&CurrFcst,&Currmnth:Sep,"Forecast Employees",&CurrFY,@IDescendents("All_Cost_Center"),@IDescendents("Pay Type"),@IDescendents("Work Type"),@IDescendents("Other_Accounts")
DATAEXPORT "File" "," $DataExportPath "0";
ENDFIX;
ENDFIX; -
Hi there,
Context:
I have to run a job weekly which would load (update/insert) DestTable with data from SourceTable, before i load the data into DestTable i have to transform the data which includes transpose Columns to rows based on a composite key and calculate to derive few columns. I have written this job in .net exe but it is taking huge amount of time to finish the job, like it took 5hours to process 1.9 million records.
SourceTable has a similar structure
ColName
Item_id
sales
Item_desc
profit
state_code
DestTable has a similar structure
ColName
Item_id
Sales_for_state1
sales_for_state2
sales_for_state3
sales_for_state4
profit
profit_margin --this is calculated based on the above columns
the above is just a glimpse of the tables' structure that i have to process.
Resolution:
I would like to rewrite the .net exe code into a PL/SQL. can you help me write a query that would transform the columns to rows and calculate and then insert them in to the DestTable.
ThanksAs far as I understand your structure, it's not a pivot-like thing. So, probably, you can make a transformation of the following kind. And then directly upload to the target_table:
select item_id,
sum(decode(state_code,'CODEOFSTATE1',sales, null)) s4state1,
sum(decode(state_code,'CODEOFSTATE2',sales, null)) s4state2,
sum(decode(state_code,'CODEOFSTATE3',sales, null)) s4state3,
sum(decode(state_code,'CODEOFSTATE4',sales, null)) s4state4,
sum(profit)
from source_table
group by item_id -
I have a Windows server app that generates Excel workbooks to be emailed to political campaign volunteers to be loaded into Numbers on an iPad, edited, then emailed back to be posted to the server database. There are two problems encountered:
1. The Excel workbook has the first row (column headings) and first column (route identifier) of cells locked, so that they will not scroll off the screen, but Numbers doesn't respect the locks, so when the user scrolls horizontally or vertically, the column headings and/or the route identifier scroll off the screen.
2. The Excel workbook has pop-up "tool-tip" type comments in certain column headings in order to provide the user with the acceptable entries for those columns, but Numbers does not respect those. When the user touches any of the commented column heading cells, a context menu appears instead of the comment.
What must I do in the Excel workbook sheets, or what settings can be made in Numbers to correct the above?I imported a Numbers '09 file into Numbers on the iPad. All comments were removed during import. Frozen header row and column were retained.
Thank you for your responses I must ask, however, when you refer to "importing" the Excel file, are you referring to a two step process whereby the Excel file is first converted by some other process into Numbers format, then opened in the Numbers application - which is what I have to do in my PC application to generate the Excel file, and reverse that process to convert the Excel back into my database format - or are you simply referring to opening the file in Numbers as "importing" it? And please excuse any ignorance, as I'm not at all familiar with Apple's terminologies. In fact, I don't own an iPad myself, but rather I have to depend on one of my clients to do the testing for me.
I imported an XLSX file into Numbers on the iPad. The file used "freeze panes" to "freeze" the first column and row. Only warning on import was that it changed fonts. It imported without the first row and column frozen and with no comments. Nothing I can do about the missing comments but it was a simple matter to turn the first column & row into headers and freeze them.
Unfortunately this would not be an efficient solution, since the end users are, for the most part, elderly political campaign volunteers who are fairly computer illiterate. These workbooks are actually canvassing lists - known as walklists. Their purpose is for the volunteers to interview voters, record the results of the interviews, and post the results to a database, which provides the campaigns with valuable strategizing capabilities. Also, these workbooks have multiple pages - as many as 10 or more. and from what I infer from the above, the setting changes would have to be made on each page.
My whole intent in developing this iPad/Tablet methodology was to significantly reduce volunteer's work - which is a recruitment benefit - and eliminate paper. While the latter would be accomplished, the former would not, and in fact would tend to increase it. It's necessary to keep the first row - column headings - and the first column - the route identifier - from scrolling off the page, so that the volunteer won't have to keep scrolling up and down and right and left to know what the data are.
Conclusion: Comments are not supported on the iPad version of Numbers. Frozen headers are not imported from Excel but can be recreated easily.
I was previously directed to the Apple website http://www.apple.com/ipad/from-the-app-store/apps-by-apple/numbers.html which extols the wonders of the Numbers application. About halfway down the page there's a section regarding, "Sliders steppers and pop-ups". The web page states that pop-ups can be set up but, being a marketing site, gives no indication whatsoever as to how it's done. I was hoping someone could tell my if there's any way to carry them over from an Excel file. -
Report output format xml, missing column while open in excel for single row
Dear,
There is a strange case, we have an customize concurrent program to display output in xml format. Now Problem is, if query get single record on the bases of parameter then there is no column heading available in excel. However, if parameter meet more than one record then there is no issue with column heading and reports is working find.
Pls have an idea?Dear Pk,
Here is an example, will show the actual problem. Let explain you, first i have run report by restricting query on single record which output name is "output1", again i run same report by changing where clause so it return multiple row which is "output2". if you past code in text document each one and save it as xml but when you open this file in excel report you will find column heading which rows consist multiple row, however, ouput1 file have no heading columns that's a problem.
1.Oputput1
<?xml version="1.0"?>
<!-- Generated by Oracle Reports version 6.0.8.11.3 -->
<DEPTNO>
<LIST_G_EMPNO>
<G_EMPNO>
<EMPNO>7839</EMPNO>
<ENAME>KING</ENAME>
<HIREDATE>17-NOV-81</HIREDATE>
<SAL>5000</SAL>
<DEPTNO>10</DEPTNO>
</G_EMPNO>
</LIST_G_EMPNO>
</DEPTNO>
2.Oputput2
<?xml version="1.0"?>
<!-- Generated by Oracle Reports version 6.0.8.11.3 -->
<T01103240>
<LIST_G_EMPNO>
<G_EMPNO>
<EMPNO>7788</EMPNO>
<ENAME>SCOTT</ENAME>
<HIREDATE>09-DEC-82</HIREDATE>
<SAL>3000</SAL>
<DEPTNO>20</DEPTNO>
</G_EMPNO>
<G_EMPNO>
<EMPNO>7902</EMPNO>
<ENAME>FORD</ENAME>
<HIREDATE>03-DEC-81</HIREDATE>
<SAL>3000</SAL>
<DEPTNO>20</DEPTNO>
</G_EMPNO>
</LIST_G_EMPNO>
</T01103240>
Hope you got it. -
Excel tables... columns and row formatting after I update the indesign page
When my excel table gets updated in indesign I lose formatting (hight/wide) for the columns&rows. There are 26 columns and each one is a difference size. Do I have to formatting (hight&wide) each column and row every time the excel table is updated?
We have many publications with statistical tables, which are done in excel. We want to try to do some publications with only tables and do it in-house. The problem is when we place the table in indesign and finish formatting the table. We will get a updated table that needs to be updated in indesign. But when we do we update we lose all of the indesign formatting. Fixing the fonts, type size, etc is easy but how do we get back the all column widths.
-
How to Transpose series of rows & columns to singular inline column?
Hi gang!
Looking to do the reverse of my previous post (here: http://discussions.apple.com/message.jspa?messageID=9355192#9355192).
Specifically, looking to transpose from many rows & columns to 1 inline column...
from:
A1 A2 A3 A4 A5 A6 A7
B1 B2 B3 B4 B5 B6 B7
to:
A1
A2
A3
A4
A5
A6
A7
B1
B2
B3
B4
B5
B6
B7
For a whole set of data (over 330 rows of 7 columns)!
A function for doing the inverse was graciously provided in the previous post, but am stuck as to how to reverse it!
Previous (from 1 column to many):
INDEX(TRANSPOSE('Table_Src' :: B2:H2),7,1*(ROW()-2)+COLUMN()-1)
becomes... (from many to 1 column)
Anyone with ideas? Found the Function guide only more confusing! :OI would use this simple script:
--[SCRIPT] on run
set {rname, tName, sName, dName, colNum1, rowNum1, colNum2, rowNum2} to my getSelParams()
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
set liste to {}
repeat with r from rowNum1 to rowNum2
repeat with c from colNum1 to colNum2
copy value of cell r of column c to end of liste
end repeat
end repeat
end tell
set liste to my recolle(liste, return)
set the clipboard to liste
end run
--=====
on getSelParams()
local r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2
set {r_Name, t_Name, s_Name, d_Name} to my getSelection()
if my parleAnglais() then
if r_Name is missing value then error "No sheet has a selected table."
else
if r_Name is missing value then error "Aucune feuille ne contient une table sélectionnée."
end if
set two_Names to my decoupe(r_Name, ":")
tell application "Numbers" to tell document d_Name to tell sheet s_Name to tell table t_Name
set col_Num1 to address of column of cell (item 1 of two_Names)
set row_Num1 to address of row of cell (item 1 of two_Names)
if item 2 of two_Names = item 1 of two_Names then
set {col_Num2, row_Num2} to {col_Num1, row_Num1}
else
set col_Num2 to address of column of cell (item 2 of two_Names)
set row_Num2 to address of row of cell (item 2 of two_Names)
end if
end tell -- _Numbers …
return {r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2}
end getSelParams
--=====
set {r_Name, t_Name, s_Name, d_Name} to my getSelection()
on getSelection()
local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
tell application "Numbers" to tell document 1
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of tables
if x > 0 then
repeat with y from 1 to x
try
(selection range of table y) as text
on error errMsg number errNum
set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
return {theRange, theTable, theSheet, theDoc}
end try
end repeat -- y
end if -- x>0
end tell -- sheet
end repeat -- i
end tell -- document
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
on recolle(l, d)
local t
set AppleScript's text item delimiters to d
set t to l as text
set AppleScript's text item delimiters to ""
return t
end recolle
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
Select the range to transpose
Run the script
paste where you want.
Yvan KOENIG (from FRANCE lundi 4 mai 2009 15:17:08)
Maybe you are looking for
-
Warning codes generated in UCCHECK - Technical Upgrade - 4.0b to ECC 6.0
Hi SDN'ers , I am currently working on Technical Upgrade project from 4.0 b system to ECC 6.0 system . I am facing a problem relating to the analysis of the warnings displayed whehn we run the UCCHECK for the client inventory by checking the "Display
-
Hi All - I scanned a TON of documents to my mac today and I can't find any of them. They were scanned from the HP Officejet 4632 through Preview. I watched as all documents came up as they were being scanned. Before each scan, I placed them into a d
-
Why does the reminders active screen move around so much since one of the iOS updates a few times ago? Currently on iOS 8.1 on iPhone 5 (wife having same issue on same iOS on iPhone 5S). When you go in to reminders and click on an existing reminder
-
Returning String[] from C program
How can I return a string[] from a cprogram to a java program? private native String[] readRFIDData(); JNIEXPORT jobjectArray JNICALL Java_RfidDM_readRFIDData (JNIEnv *, jobject); Above is the definition of a jni method . I have gone through the samp
-
I cant get past the users screen.
I have a hp pavilion slimline s5212y. When Windows starts I get to the users screen and then my mouse and keyboard stop working. No lights or anything.even in safe mode.. they work before I get to the users screen. I have tried everything I can think