Change Column to Row
I have a table :
AA AF AF+AA Target AF+AA Booking
1 2 3
4
5 6 7
8
Now I need to make this as:
Metric Measure MetriCode
AA(AO DP) 1 02
AA(AO DP) 5 02
AF 2 08
AF 6 08
AA(AO DP) 3 02
AA(AO DP) 7 02
AA(AO DP) 4 08
AA(AO DP) 8 08
I need to convert column into row with the "Metric" Name and all my values shouls be "Measure". Also Anything like AA with be AA(AO DP) and AF would be Authorized Futures. Also whatever change tp AA(AO Dp) I need to add metriccode ='08'
and Authorized Future ='02'.
How can I get this result?
SPPandey
I have a table :
AA AF AF+AA Target AF+AA Booking
1 2 3
4
5 6 7
8
Now I need to make this as:
Metric Measure MetriCode
AA(AO DP) 1 02
AA(AO DP) 5 02
AF 2 08
AF 6 08
AA(AO DP) 3 02
AA(AO DP) 7 02
AA(AO DP) 4 08
AA(AO DP) 8 08
I need to convert column into row with the "Metric" Name and all my values should be "Measure". Also Anything like AA shall be AA(AO DP) and AF would be Authorized Futures. Also whatever change to AA(AO Dp) I need to add metriccode ='08' and Authorized
Future ='02'.
How can I get this result?
SPPandey
SPPandey
Similar Messages
-
Hi experts,
How to change columns to rows and row to columns in executable program . Any function modules(se 37)
or any class(se24) are there please give me suggestions.
Thank you,
dinesh reddy.Hi,
Use this FM in your ABAP code
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = 'c:/test_data.xls'
I_BEGIN_COL = '1'
I_BEGIN_ROW = '1'
I_END_COL = '10'
I_END_ROW = '10'
TABLES
INTERN = it_tab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
Regards,
Jyothi CH. -
HI All,
Please consider the following scenario,
DAta in the data source is in following format
participation number valuetype value
1 ABC 200
1 DEF 300
1 EFG 500
1 XXX 300
But i want it should b stored in following format in DSO ( I dont want to show some value types for.eg XXX in this case)
Participation number ABC DEF EFG
1 200 300 500
How can i Do that ....Is ABAP the only option.. if yes ,it will be of great help if somebody give me the code to enter in the transformation .Hi guys
I think im having a similar problem.
I have created a progarm that displays username displaying in columns ie.:
User edited day
TSmith 3 mon
MPeters 5 thurs
RAndrews 10 wed
I have been requested to change this to columns like
TSmith MPeters RAndrews
3 5 10
mon thurs wed
This is how my code looks like:
DATA ls_fieldcat TYPE lvc_s_fcat.
ls_fieldcat-tabname = 'gt_list'.
ls_fieldcat-fieldname = 'CPUDT'.
ls_fieldcat-scrtext_m = 'Date captured'.
ls_fieldcat-row_pos = 0.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO pgt_fieldcat.
ls_fieldcat-tabname = 'gt_list'.
ls_fieldcat-row_pos = 0.
ls_fieldcat-fieldname = 'USNAM'.
ls_fieldcat-scrtext_m = 'User'.
APPEND ls_fieldcat TO pgt_fieldcat.
ls_fieldcat-tabname = 'gt_list'.
ls_fieldcat-row_pos = 0.
ls_fieldcat-fieldname = 'NUMBER'.
ls_fieldcat-scrtext_m = 'Number of entries'.
APPEND ls_fieldcat TO pgt_fieldcat.
Could you please assist?
Thanks -
SSRS 2012
Dataset (40 columns) including the first 3 rows for Report layout configuration (eg: the <second> row specifies the column background color).
Starting from the 4th row, the dataset contains data to be displayed.
I would like to change the background color of the ColumnHeader/Column based on the value in the same column in the <second> row.
How can I accomplish the this requirement? (this must be applied for all the columns)
ThanksHi Fasttrck2,
Per my understanding that you want to specify the background color of all the columns/column header based on the value in one special column of the special row, right?
I have tested on my local environment and you can add expression to condition show the background color in the columns properties or the column header properties.
Details information below for your reference:
Specify the background color in the Column header: you can select the entire column header row and in the properties add expression in the Background color :
If you want to specify the background color for the entire column, you can select the entire column and add the expression, repeat to add background color for other columns.
If you want to specify the background color based on the value in the specific columns and row, you can create an hidden parameter to get the list of values from the specific column, specify the Available values and default values by select "Get
values from a query", finally using the expression as below to get the specific value you want:
Expression(Backgroud Color):
=IIF(Parameters!Para.Value(1)="1221","red","yellow")
If your problem still exists, please try to provide some smaple data of the report and also the snapshot of the report structure to help us more effective to provide an solution.
Any problem, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support -
CSS issue when changing the table row height to 16px
Hello,
After changing the table row height through css like this:
.table-row-cell, .table-cell {
-fx-cell-size: 16;
the table rows are correctly displayed with a 16px height but the cell bottoms seem to be incorrectly set.
For example the following css style (a red 3px bottom border):
.table-cell {
-fx-border-width: 0 0 3 0;
-fx-border-color: red;
doesn't work anymore with the new row height whereas it works with the 24px standard row height.
While investigating with Scenic View, I noticed that changing the row height changes the TableRow layoutBounds height (from 24px to 16px so that's ok) but not the boundsInParent height which remains to 27px. I think it should become 19px (16 + 1.5 + 1.5). I don't know if it's a bug.
Anyway, any help making the css red border working for a 16px row height would be greatly appreciated.
Regards,
Bruno.Q: Would this help to just use absolute div tags and give me 'ABSOLUTELY ABSOLUTE' positioning?
No. APDivs are not a good primary layout method. Use default CSS positioning (which is no positioning at all). Align page elements with margins, floats and padding.
See example -- 2-Column CSS Layout with Grids
(View Page Source in your browser to see the code)
http://alt-web.com/TEMPLATES/2-col-fixed-with-grid.shtml
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
Hi Gurus
is it possible(any built in function or commands) changing columns name which moving out the data in the column.
create table xyz(x number);---it contains data
after change column name...it should be...
create table xyz(y number);sql>create table xyz(x number);
Table created.
sql>insert into xyz values (1);
1 row created.
sql>alter table xyz rename column x to y;
Table altered.
sql>select * from xyz;
Y
1
1 row selected. -
Hi all,
could anyone please clarify my doubt
in a table how to change the column to row and vice versa.
thanks in advance.
rampaColumn 2 Row
SELECT deptno,
LTRIM(MAX(SYS_CONNECT_BY_PATH(ename,','))
KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
FROM (SELECT deptno, ename,
ROW_NUMBER() OVER (PARTITION BY deptno ORDER BY ename) AS curr,
ROW_NUMBER() OVER (PARTITION BY deptno ORDER BY ename) -1 AS prev
FROM test_emp)
GROUP BY deptno
CONNECT BY prev = PRIOR curr AND deptno = PRIOR deptno START WITH curr = 1;
=========================
SELECT SUBSTR(MAX(SYS_CONNECT_BY_PATH(NAME, ', ')),2) OneLine FROM ( SELECT NAME , ROWNUM NBR FROM (SELECT DISTINCT ENAME NAME FROM test_EMP E))
CONNECT BY PRIOR NBR = NBR - 1 START WITH NBR = 1
==============================
(select 'EName:',substr(max(sys_connect_by_path(ename, ',')),2) col1 from
(select e.*, row_number() over (order by empno) rn from test_emp e)
connect by prior rn = rn - 1 start with rn = 1
union all
(select 'Sal:',substr(max(sys_connect_by_path(sal, ',')),2) col1 from
(select e.*, row_number() over (order by empno) rn from test_emp e)
connect by prior rn = rn - 1 start with rn = 1
=================================
Row 2 Column (not tested)
SELECT test_id,LTRIM(MAX(SYS_CONNECT_BY_PATH(test_val,',')) KEEP (DENSE_RANK LAST ORDER BY curr),',') AS test_val
FROM ( SELECT test_id
,test_val
,ROW_NUMBER() OVER (PARTITION BY test_id ORDER BY test_val) AS curr
,ROW_NUMBER() OVER (PARTITION BY test_id ORDER BY test_val) -1 AS prev
FROM test_xx )
GROUP BY test_id
CONNECT BY prev = PRIOR curr AND PRIOR test_id = test_id
START WITH curr = 1; -
Increase report size (columns and rows) in portal
Hi all,
Hope someone can help me with this. I don't have any experience administering the reporting portal, hopefully this is an easy question.
The portal displaying BI queries shows only about 10 columns and 10 rows at a time. This is annoying since users have to scroll around to see all the rows and columns. Where can I adjust the number of columns and rows displayed?
Thanks,
M.Hi M.B.
Open WAD ( Bex Web Application Designer ) in which , you have assigned BI query. follow the steps for changing no of rows & columns.
Step 1. Properties - > select Web Items parametes.
Step 2. select Ananlysis
Step 3. Scroll down -> paging -> here you can change no of rows & columns.
Hope it will serve your query. If problem solved , closed this thread .
Regards,
Anand Mehrotra. -
Setting the ALV Hierarchy tree with grid line between the columns and rows
Hi Experts,
I would like to ask if there is any suggestion on setting the ALV hierarchy tree to be separated by grid line between the columns and rows just like how it is display the same way in normal ALV grid.
Thanks in advance.Hi Lin,
The requirement which you have stated is not possible.
Lin,
Also i have a query regarding BADI ZME_PROCESS_REQ_CUST, which you had raised on SDN. You have marked the question as solved/answered.
Changing the data of a customize field in purchase requisition
Could you please let me know, the steps you did to update the screen fields through the BADI.
I would really appreciate your reply, because i am facing exactly the same problem which you have mentioned.
Thanks,
Best regards,
Prashant -
Changed column order not applied to interactive report
Hi,
I've changed column order for interactive report.
But it is not applied.
How can I solve this issue?
Thanks,
GuyHi Guy
It depends on where you have changed the column order. If you change the column order using the 'Select Columns' function when you click on the 'Wheel of Magic', then it should work.
If you are changing the column order from the Interactive Reports Attributes page then this will only affect the column order for non displayed items and the single row view.
I hope that helps
Shunt -
Will updates to an EJB3 entity bean update ONLY changed columns?
Hello,
If you have an EJB3 entity bean that maps to a table, and then you change the value of ONE of the fields in the entity bean, will each column in the row be updated, OR just the column that changed in the row?
ThanksOnly fields detected as persistent-dirty will be updated in the database record.
Laurent -
Hi,
I have 6 columns and 4 rows and i want to convert it into 6 rows and 4 columns and want to display in table control.
plz help me in this ....Hi Kinjal,
Question is not clear. You want to change the internal table values with 6 columns & 4 rows to 4 columns & 6 rows?
If my understanding is correct, check the bleow logic:
loop at itab1.
case sy-tabix.
when 1.
itab2-c1 = itab1-c1.
append itab2.
itab2-c1 = itab1-c2.
append itab2.
itab2-c1 = itab1-c3.
append itab2.
itab2-c1 = itab1-c4.
append itab2.
itab2-c1 = itab1-c5.
append itab2.
itab2-c1 = itab1-c6.
append itab2.
when 2.
itab2-c2 = itab1-c1.
modify itab2 transporting c2 index 1.
itab2-c2 = itab1-c2.
modify itab2 transporting c2 index 2.
itab2-c2 = itab1-c3.
modify itab2 transporting c2 index 3.
itab2-c2 = itab1-c4.
modify itab2 transporting c2 index 4.
itab2-c2 = itab1-c5.
modify itab2 transporting c2 index 5.
itab2-c2 = itab1-c6.
modify itab2 transporting c2 index 6.
when 3.
itab2-c3 = itab1-c1.
modify itab2 transporting c3 index 1.
when 4.
itab2-c4 = itab1-c1.
modify itab2 transporting c4 index 1.
Endloop.
Finally you will get 6 rows with 4 coulmns. -
Is there a chance to change data from row to column and vice versa just by a click. Need to have the data of the rows in horizontal view in the table.
Badunit wrote:
Yvan has a script to do this.
You're right, and I just finished to upgrade the one transposing values *_( not formulas)_*.
It's uned in two passes.
Pass 1, select the range to transpose and call the script which will extract the values of the selected cells.
Pass 2, select the left_top of the target area and call the script which will insert the transposed values.
If the left_top wasn't moved since pass 1, the original range is cleared before the insertion of transposed values.
If some one which to have a script which always transpose without moving the left_top, the two pass aren't required.
Just ask, I will post this variant.
--[SCRIPT transposeDead]
Enregistrer le script en tant que Script : transposeDead.scpt
déplacer le fichier créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Merci à Scott Lindsey & Ed.Stockly du forum [email protected]
qui m'ont aidé à construire le code récupérant le bloc sélectionné.
Sélectionnez le bloc de cellules à transposer
aller au menu Scripts , choisir Numbers puis choisir transposeDead (exécute le script une première fois)
Le script récupère les informations utiles sur le bloc à transposer
Sélectionner la première cellule du bloc destination
aller au menu Scripts , choisir Numbers puis choisir transposeDead (exécute le script une deuxième fois)
Il insère les valeurs transposés.
Comme il s'agit de valeurs les modifications éventuelles du bloc source ne seront pas répercutées.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
+++++++
Save the script as a Script transposeDead.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
une_valeur you would have to create the folder Numbers and even the folder Applications by yourself.
Thanks to Scott Lindsey & Ed.Stockly from [email protected]
which helped me to build the code grabbing the selected range.
Select a group of cells.
go to the Scripts Menu, choose Numbers, then choose transposeDead (Run the script once.)
It grabs infos about the selection
select the first cell of the destination
(can't be in the source range)
go to the Scripts Menu, choose Numbers, then choose transposeDead (Run the script one more time.)
It will insert the transposed values.
As they are values, possible changes in the source block will not be reflected.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2009/01/19
2009/01/25
2009/06/03 -- enhanced for blank cells
2010/08/31 -- enhanced quite all.
property theApp : "Numbers"
property les_valeurs : {}
property old_dName : missing value
property old_sName : missing value
property old_tName : missing value
property old_rowNum1 : missing value
property old_colNum1 : missing value
--=====
on run
local rname, rowNum2, colNum2, dName, sName, tName, rname, rowNum1, colNum1
local nb_rows, nb_columns, rows_available, rows_needed, columns_available, columns_needed, une_valeur
try
if les_valeurs = {} then (*
Here we are in the first pass.
Extract infos about the source range *)
set {old_dName, old_sName, old_tName, rname, old_rowNum1, old_colNum1, rowNum2, colNum2} to my getSelParams()
Extract the values of selected cells *)
tell application "Numbers" to tell document old_dName to tell sheet old_sName to tell table old_tName
set les_valeurs to value of cells old_rowNum1 thru rowNum2 of columns old_colNum1 thru colNum2
end tell
else --============
Here we are in the second pass *)
set nb_rows to count of les_valeurs
set nb_columns to count of item 1 of les_valeurs
set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
if {old_dName, old_sName, old_tName, old_rowNum1, old_colNum1} = {dName, sName, tName, rowNum1, colNum1} then
We didn't change the left_top of the selection so clear the original range. *)
tell application "Numbers" to tell document old_dName to tell sheet old_sName to tell table old_tName
repeat with r from 1 to nb_columns
repeat with c from 1 to nb_rows
clear cell (old_rowNum1 - 1 + r) of column (old_colNum1 - 1 + c)
end repeat -- c
end repeat -- r
end tell
end if
Now we know the starting point of the destination area. *)
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
set rows_available to (get row count)
set rows_needed to rowNum1 - 1 + nb_rows
Add rows if needed *)
if rows_needed > rows_available then
repeat (rows_needed - rows_available) times
add row below row rows_available
end repeat
end if -- rows_needed
Add columns if needed *)
set columns_available to (get column count)
set columns_needed to colNum1 - 1 + nb_columns
if columns_needed > columns_available then
repeat (columns_needed - columns_available) times
add column after column columns_available
end repeat
end if -- columns_needed
Insert the transposed values *)
repeat with r from 1 to nb_rows
repeat with c from 1 to nb_columns
set une_valeur to item c of item r of les_valeurs
tell cell (rowNum1 - 1 + r) of column (colNum1 - 1 + c)
if une_valeur is 0.0 then
clear
else
set value to une_valeur as text
end if
end tell
end repeat -- c
end repeat -- r
end tell -- Numbers
Clears the property for next use *)
set les_valeurs to {}
end if
on error
Clears the property for next use *)
set les_valeurs to {}
end try
end run
--=====
set {rowNum1, colNum1, rowNum2, colNum2} to my getCellsAddresses(dname,s_name,t_name,arange)
on getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
local two_Names, row_Num1, col_Num1, row_Num2, col_Num2
tell application "Numbers"
set d_Name to name of document d_Name (* useful if we passed a number *)
tell document d_Name
set s_Name to name of sheet s_Name (* useful if we passed a number *)
tell sheet s_Name
set t_Name to name of table t_Name (* useful if we passed a number *)
end tell -- sheet
end tell -- document
end tell -- Numbers
if r_Name contains ":" then
set two_Names to my decoupe(r_Name, ":")
set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, item 1 of two_Names)
if item 2 of two_Names = item 1 of two_Names then
set {row_Num2, col_Num2} to {row_Num1, col_Num1}
else
set {row_Num2, col_Num2} to my decipher(d_Name, s_Name, t_Name, item 2 of two_Names)
end if
else
set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, r_Name)
set {row_Num2, col_Num2} to {row_Num1, col_Num1}
end if -- r_Name contains…
return {row_Num1, col_Num1, row_Num2, col_Num2}
end getCellsAddresses
--=====
set { dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
on getSelParams()
local r_Name, t_Name, s_Name, d_Name
set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
if r_Name is missing value then
if my parleAnglais() then
error "No selected cells"
else
error "Il n'y a pas de cellule sélectionnée !"
end if
end if
return {d_Name, s_Name, t_Name, r_Name} & my getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
end getSelParams
--=====
set {rowNumber, columnNumber} to my decipher(docName,sheetName,tableName,cellRef)
apply to named row or named column !
on decipher(d, s, t, n)
tell application "Numbers" to tell document d to tell sheet s to tell table t to ¬
return {address of row of cell n, address of column of cell n}
end decipher
--=====
set { d_Name, s_Name, t_Name, r_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 {theDoc, theSheet, theTable, theRange}
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 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
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--=====
--[/SCRIPT]
I will enhance the old transposeLive too.
Yvan KOENIG (VALLAURIS, France) 31 août 2010 17:58:27 -
Hi all,
I'm just filling a Numbers table from a webseite per copy & paste.
Can I swap columns and rows in Numbers like in Quantrix?
AxelHere is a new transpose script.
This one inserts formulas grabbing the contents of the original block so the transposed one reflects the changes which may be done in the original block.
It's a bit long but I post it here because it introduce some handlers allowing us to acess some interesting features.
--[SCRIPT transposeLive]
Enregistrer le script en tant qu'Application ou Progiciel : transposeLive].app
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Merci à Scott Lindsey & Ed.Stockly du forum [email protected]
qui m'ont aidé à construire le code récupérant le bloc sélectionné.
Sélectionnez le bloc de cellules à transposer
menu Scripts > Numbers > transposeLive (exécute le script une première fois)
Le script récupère les informations utiles sur le bloc à transposer
Sélectionner la première cellule du bloc destination
(elle ne peut être dans le bloc source)
menu Scripts > Numbers > transposeLive (exécute le script une deuxième fois)
Il insère des formules récupérant le contenu du bloc transposé.
Les modifications au contenu du bloc source seront répercutées.
+++++++
Save the script as an Application or an Application Bundle: transposeLive].app
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Thanks to Scott Lindsey & Ed.Stockly from [email protected]
which helped me to build the code grabbing the selected range.
Select a group of cells.
menu Scripts > Numbers > transposeLive (Run the script once.)
It grabs infos about the selection
select the first cell of the destination
(can't be in the source range)
menu Scripts > Numbers > transposeLive (Run the script one more time.
It will insert formulas grabbing the transposed range.
Changes in the source one will be reflected.
Yvan KOENIG (Vallauris, FRANCE)
19 janvier 2009
property theApp : "Numbers"
property sourceCell : missing value
property sourceTable : missing value
property sourceSheet : missing value
property nbRows : missing value
property nbColumns : missing value
--=====
on run
set firstPass to sourceCell = missing value
if firstPass then (*
Here we are in the first pass.
We grab infos about the source range *)
set {rName, sourceTable, sourceSheet, dName} to my getSelection()
if rName is missing value then error "No selected cells"
set twoNames to my decoupe(rName, ":")
if sourceTable does not start with "'" then set sourceTable to "'" & sourceTable & "'"
if sourceSheet does not start with "'" then set sourceSheet to "'" & sourceSheet & "'"
set sourceCell to item 1 of twoNames
set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
if item 2 of twoNames = item 1 of twoNames then
set {colNum2, rowNum2} to {colNum1, rowNum1}
else
set {colNum2, rowNum2} to my decipher(item 2 of twoNames)
end if
set nbRows to rowNum2 + 1 - rowNum1
set nbColumns to colNum2 + 1 - colNum1
else --**************
Here we are in the second pass
We insert formulas grabbing the transposed cells *)
set deci to character 2 of (0.5 as text)
if deci is "." then
set delim to ","
else
set delim to ";"
end if
set p2lproj to my getLproj(theApp)
set OFFSET_loc to my getLocalizedFuncName(p2lproj, "OFFSET")
--set ADDRESS_loc to my getLocalizedFuncName(p2lproj, "ADDRESS")
--set INDIRECT_loc to my getLocalizedFuncName(p2lproj, "INDIRECT")
set {rName, tName, sName, dName} to my getSelection()
if rName is missing value then error "No selected cells"
set twoNames to my decoupe(rName, ":")
set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
if item 2 of twoNames = item 1 of twoNames then
set {colNum2, rowNum2} to {colNum1, rowNum1}
else
set {colNum2, rowNum2} to my decipher(item 2 of twoNames)
end if
(* Here we know the starting point of the destination area. *)
tell application theApp
activate
tell document dName to tell sheet sName to tell table tName
set rowsCible to (get row count)
set rowsNeeded to rowsCible - 1 + nbColumns
if rowsNeeded > rowsCible then
repeat (rowsNeeded - rowsCible) times
add row below row rowsCible
end repeat
end if -- rowsNeeded
set columnsCible to (get column count)
set columnsNeeded to columnsCible - 1 + nbRows
if columnsNeeded > columnsCible then
repeat (columnsNeeded - columnsCible) times
add column after column columnsCible
end repeat
end if -- columnsNeeded
repeat with i from 1 to nbRows
repeat with j from 1 to nbColumns
set value of cell (colNum1 - 1 + i) of row (rowNum1 - 1 + j) to "=" & OFFSET_loc & "(" & sourceSheet & " :: " & sourceTable & " :: " & sourceCell & delim & i - 1 & delim & j - 1 & ")"
end repeat
end repeat
end tell -- table of sheet of document
end tell -- Application
set sourceCell to missing value
set sourceTable to missing value
set sourceSheet to missing value
set nbRows to missing value
set nbColumns to missing value
end if
end run
--=====
on getSelection()
local mySelectedRanges, sheetRanges, thisRange, _, myRange, myTable, mySheet, myDoc, mySelection
tell application theApp
activate
tell document 1
set mySelectedRanges to selection range of every table of every sheet whose it is not missing value
repeat with sheetRanges in mySelectedRanges
try
count of sheetRanges
on error
set sheetRanges to {sheetRanges}
end try
repeat with thisRange in sheetRanges
if contents of thisRange is not missing value then
try
--return thisRange --poorly formed result
thisRange as text
on error errMsg number errNum
set {_, myRange, _, myTable, _, mySheet, _, myDoc} to my decoupe(errMsg, quote)
--set mySelection to (a reference to (range rn of table tn of sheet sn))
return {myRange, myTable, mySheet, myDoc}
end try
end if -- contents…
end repeat -- thisRange
end repeat -- sheetRanges
end tell -- document 1
end tell -- application
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on decipher(n)
local letters, colNum, rowNum
set letters to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if (character 2 of n) as text > "9" then
set colNum to (offset of (character 1 of n) in letters) * 64 + (offset of (character 2 of n) in letters)
set rowNum to (text 3 thru -1 of n) as integer
else
set colNum to offset of (character 1 of n) in letters
set rowNum to (text 2 thru -1 of n) as integer
end if
return {colNum, rowNum}
end decipher
--=====
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 getLproj(a)
local lprojs, localId, lproj
set lprojs to {{"da_DK", "da.lproj"}, {"nl_NL", "Dutch.lproj"}, {"en_US", "English.lproj"}, {"fi_FI", "fi.lproj"}, {"fr_FR", "French.lproj"}, {"de_DE", "German.lproj"}, {"it_IT", "Italian.lproj"}, {"ja_JP", "Japanese.lproj"}, {"ko_KR", "ko.lproj"}, {"no_NO", "no.lproj"}, {"pl_PL", "pl.lproj"}, {"pt_BR", "pt.lproj"}, {"pt_PT", "pt_PT.lproj"}, {"ru_RU", "ru.lproj"}, {"es_ES", "Spanish.lproj"}, {"sv_SE", "sv.lproj"}, {"zf_CN", "zh_CN.lproj"}, {"zh_TW", "zh_TW.lproj"}}
set localId to my getLocale(a, "http://support.apple.com/en_US/manuals/#iwork")
set localId to text (1 + (count of "http://support.apple.com/")) thru -1 of localId
set localId to text 1 thru ((offset of "/" in localId) - 1) of localId
set lproj to ""
repeat with i from 1 to count of lprojs
if localId is item 1 of item i of lprojs then
set lproj to item 2 of item i of lprojs
exit repeat
end if
end repeat
if lproj = "" then error "A Frameworks file is missing !"
return (path to application support as text) & "iWork '09:Frameworks:SFTabular.framework:Versions:A:Resources:" & lproj
end getLproj
--=====
on getLocale(a, x)
tell application a to return localized string x
end getLocale
--=====
on getLocalizedFuncName(f, x)
return localized string x from table "Localizable" in bundle file f
end getLocalizedFuncName
--=====
--[/SCRIPT]
Yvan KOENIG (from FRANCE lundi 19 janvier 2009 18:57:48) -
Hi I am trying to create a form/spreadsheet for shift bosses at work. I want them to be able to imput certain data but I also want to lockout certain columns and rows. Mostly so the formulas aren't tampered with. Is this possible?
Also, is it possible to save to a database?
Any help would be much appreciated.dogg,
Create separate Input and Calculation tables. Lock the calculation table (Arrange > Lock), leave the input table accessible. If you don't want the calculations to be viewed during input, you can change the colors of all lines, fills and text to White before locking, and put them on a different Sheet for good measure.
Another technique that plays on Numbers graphics advantage is to cover areas of your sheet that you wish to protect with a shape. Create a Shape and place it to cover your sensitive equations. Then set the Shape's Fill Color to 0% Opacity and lock the shape. Now you have what I call the salad bar sneeze guard effect for spreadsheets. You can defeat it if you try hard, but it works most of the time.
Jerry
Message was edited by: Jerrold Green1
Maybe you are looking for
-
AS2 Receiver Error: MIC not verified # unexpected-processing-error
When sending out a test message using Seeburger AS2 receiver channel I get the following error: MIC not verified # unexpected-processing-error So obviously this problem is related to digital signature I think? However I get the same error even if dig
-
HT1657 I can hear sound but the screen is green
I rented a movie (Jumper) on iTunes. I can hear the sound, but the screen is green. Has this happened to anyone else? How do I re-download or get a refund?
-
No Nav Pane in IE 7 using RoboHelp 8
There was a thread earlier about no navigation pane, but it was marked "Archived" and it looked like I couldn't reopen it -- sorry if this is a duplicate. I have a RoboHelp HTML (RoboHelp version 8) project that works fine in IE 6 and FireFox 3.5. H
-
Connect to Gateway Failed during database instance installation
Hi All, I install Netweaver 2004 (6.4) ABAP stack. I've finished the installation of oracle 10.2 and central instance. During the installation of database instance, an error happens when "starting RFC jobs". In the logviewer: ERROR 2007-07-02 18:37:1
-
HT201401 Iphone 3GS screen flashes and doesn't display
Hi there i have been given a Iphone 3gs 16Gb from a friend as they have upgraded to a nexus 4 and the screen connecter was damaged so i have now replaced the LCD with a new one now the screen flashes and doesn't show anything on the screen there is n