Convert positive to negative value in cells?
Hi,
Can't seem to find this anywhere and Mr Google is starting to refer me to Excel pages, so thought I'd try here - pretty simple, I just want to convert a set of positive values to negative. Is that possible?
Thanks,
osu
If your values are stored in cells of column B, in an other column, say, column C
in cell C2, enter the formula :
=ABS(B2)
then apply Fill Down
If you don't want to use an auxiliary column, use an AppleScript like this one.
--[SCRIPT cellstoabs]
Enregistrer le script en tant que Script : cellstoabs.scpt
déplacer le fichier ainsi 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.
Sélectionner un bloc de cellules.
Aller au menu Scripts , choisir Numbers puis choisir cellstoabs
Le script remplace sur place les valeurs négatives par leur valeur absolue.
--=====
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".
Sous 10.6.x,
aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
puis cocher la case "Afficher le menu des scripts dans la barre des menus".
--=====
Save the script as a Script: cellstoabs.scpt
Move the newly created file 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.
Select a range of cells.
Go to the Scripts Menu, choose Numbers, then choose "cellstoabs"
The script replace the negative values by there ABSolute value.
--=====
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)
2010/10/21
--=====
property liste_valeurs : {}
--=====
on run
local dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2, liste_valeurs, c, cc, r, une_valeur
set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
if rowNum2 = rowNum1 then set rowNum2 to count of rows
set my liste_valeurs to value of cells rowNum1 thru rowNum2 of columns colNum1 thru colNum2
repeat with c from colNum1 to colNum2
tell column c
set cc to c + 1 - colNum1
repeat with r from rowNum1 to rowNum2
set une_valeur to item (r + 1 - rowNum1) of item cc of my liste_valeurs
if une_valeur < 0 then set value of cell r to -une_valeur
end repeat
end tell
end repeat
end tell
set my liste_valeurs to {}
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]
Yvan KOENIG (VALLAURIS, France) jeudi 21 octobre 2010 09:38:59
Similar Messages
-
How can i design square signal which having a positive and negative values equal to each other and separated from each other by controlled time or distance, As it is shown in the figure below. and enter this signal in a daq.
Solved!
Go to Solution.By the time you spend for the nice diadram you might have done the vi
Your DAQ like to have a waveform (array of values and dt ak 1/samplerate)
If you set the samplerate you know the array length , create a array of zeros, and set the values of both amplitudes ...
Since I don't want to wire others homework here are some pictures
And there are some drawbacks is room for improvement in my solution, just think of rounding errors ... and what might happen if the arrays get bigger ....
Spoiler (Highlight to read)
Greetings from Germany
Henrik
LV since v3.1
“ground” is a convenient fantasy
'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ' -
Numeric Integration of positive and negative values in the same signal
Hello.. I need to perform an evaluation of Area Under Curve of my signal, but it contains positive and negative values. I am using the "Numeric Integration" function, but the result expressed by my VI represent: AREA OF POSITIVE VALUES - AREA OF NEGATIVE VALUES, in other words, my result represent the difference between these two areas. But I want to know the total area, the sum of positive values area and negative values area, and because both values has are "+", my final result should has "+" notation.
For example:
Area of positive values: +45.00
Area of negative values: +34.00
Total area: +79.00
How do I modify my VI to obtain the total area value?
I try to split my values in two parts:
A) only the positive and zero values
B) only the negative values
I calculated the areas of both splits and performed an sum of them, but the final result does not matches with total area (computed by another software to know the real value)
I attached an picture of my VI
Thank you
Daniel
Attachments:
Numeric Integration1.png 12 KBUse an event structure for the boolean value changed. You also did not follow Lynn's advice to insert an "absolute value". It would really simplify everything.
Here's how it would look in a newer version of LabVIEW (your icons look different because you have an older version. The functions are the similar).
This is just a draft and the program needs to be improved. Use a state machine with events for read file and another for value change on the sampling rate. Place the data array in a shift so you can change the sampling rate without the need to re-read the file. Modify as needed.
Some important pointers in general:
There is NO need to constantly spin the loop every nanosecond. The only time the loop needs to spin if if one of the inputs has changed.
If you don't use an event structure, all UI loops need a wait to conserve CPU.
Never (almost never) use "switch until released". Typically you want to use "latch when released" which makes the terminal true exactly once until the value is read and it will revert to false after that. "switch until released acts like a doorbell, so if it werent for the file dialog, you would execute the case several times in a row.
You don't need to get the array size and wire N of the FOR loop if you are autoindexing. LabVIEW will spin the loop until it runs out of elements automatically.
There is an atomic operation for "negate" in the numeric palette. No need to multiply with a "-1" diagram constant.
There is an atomic operation for ">=0" in the comparison palette. No need to compare with a "0" diagram constant.
Use a stop button on the loop termination.
Everything that only needs to be done once after the file is read (e.g. you inner loop, etc. also belongs inside the case structure. Right?
In general, you would make things much easier for us if you would attach your actual live VI instead of dead images.
Message Edited by altenbach on 04-19-2008 12:22 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
areaPositive.png 9 KB -
-fx-background-position with negative values bug ?
Hi,
I've reported an issue that seems to be a bug with negative -fx-backgound-position values in CSS : the background image is painted out of bound of the target node.
Here is the CSS code:
/* useradd icon style: with negative offset */
.icon-useradd {
-fx-background-position: -90px 0px;
} I've created a new JIRA issue with attached screenshot :
http://javafx-jira.kenai.com/browse/RT-25522This probably is expected behaviour.
The properties for background fills (color, insets, radius) donot work together with the properties for background images (image, position, repeat, size). They are separate and painted in separate passes in order, quote from the CSS doc below:
>
Each Region consists of several layers, painted from bottom to top, in this order:
background fills
background images
contents
border strokes
border images -
How to show negative value in Pie Chart from Webi?
I have below example data, I want to convert this to a pie chart in Web Intelligence, my problem is after I convert it to a pie chart, the revenue '-30' is shown as '30', looks like the pie chart is not suppor the negative value to show, I want to know if there is any workaround or solution to make the pie chart to show the negative value? Is this behavior is by design? do we have any official document to explain this?
The product I used is BOE XI 3.1 SP3.
Department Revenue
A 100
B -30
C 80
Edited by: Alex Wang on Jul 13, 2010 5:51 PMWhy are you showing this information as a pie chart? It doesn't make sense to try and display a negative slice in a pie chart. I can't really think of a logical way to try and draw a negative slice in a pie chart. With a pie chart you will need all your information to either all be positive or all negative, otherwise it doesn't work.
What you need is to have a bar chart, with positive and negative values on the y axis. -
Stacked bar chart with negative values
Hi,
trying to create a stacked bar chart I only get a grey picture. Reason: my data series provides positive and negative values.
Can anyone tell me a trick how to fix this problem?User614143,
try to add the minumm negative value (but positive) to the parameter for the axis.
e.g. show value+3000 (assuming -3000 is the minimum value)
If you don't have a limitation for the negative values, it doesn't work. (or try to calculate first the most negative value in a before header process)
hope this helps.
Leo -
Hello everyone,
May I know why the standard freight cost is negative sign in SD but positive sign in COPA.
Also sales and various kind of cost are showing positive sign in COPA. No negative sign in COPA?
Thank you.
Regards.Hello,
It is also possible to transfer conditions from MM to update billing data in pooled payment in the Information Systems (IS) retail system. These are transferred according to the same rules as SD conditions. Conditions from SD are always transferred to COPA with + signs, with the exception of credit memos and returns. The reasons for this is that the signs for revenus are handled differently in the different applications of the system. For example, revenus are positive in SD, while they are negative in FI. Consequently, COPA accepts all of the values as positive, and then subtracts deductions and costs from revenues in IS.
Note that indicator transfer +/- is not used to compare the different use of +/- signs between FI or SD and COPA. If you active the indicator, only the positive and negative values for the condition in question will be balanced. This guarantees that the sum of the negative and positive condition values are displayed as a correct total value in the value field asigned to that condition.
In order to perform transfer conditions from the billing documents the same definitions must be established for the value fields in Profitability Analysis and both pricing and conditions types must be defined in SD.
Regards,
Ravi -
Negative values in Service Entry Sheet
Hi,
I am in need of creating service entry sheet lines with negative values (for a certain account assignment).
Bare with me, this will be long (-;
In my business scenario, (PS module, Construction Business) I use PO`s for external services with limits only. This PO has only one line ; the vendors are contractors who build for my company various types of buildings.
Every month I get an invoice from the vendor (contractor) for his monthly work, with a total sum, divided into various types of construction activities (Electricity, Sanitation, Paving and so on).
Against this invoice, a service entry sheet is created, with service lines from a service model containing construction works, in which I use material groups with account determination, so that each activity has its own GL account and cost element.
Immediately upon creation of the service entry sheet, logistic invoice verification is made (MIRO) based on the SES, and the payment is transferred to the vendor`s account.
My problem begins (ah! at last...) with the second monthly invoice and on.
It is almost by default that in this invoice, some of the construction activities from the previous month appear with negative values - mostly corrections.
Is there any way I can enter these negative values in a service entry sheet???
Remember - I cannot revoke the previous entry sheet (because of MIRO and payment)
I have already encountered error SE397, and the problem is that although the total value is positive, my negative values appear for independent account assignment lines.
Thanx in Advance,
Eytan.Hi Sanjeev,
Thank you for your prompt reply.
I do not need to enter an entirely negative SES.
As I wrote, only one line is supposed to have a negative value, while the whole document is positive.
I was able to create a SES with negative values in lines, but only when I used the same material group (hence account assignment). Unfortunately, this does not always help me because In some cases, the negative value belongs to a single account assignment line.
And why can`t I have a similar (automatic) function like material movement 102?
SES automatically creates in the background GR document with material movement 101.
Eytan. -
Different color for positive and negative chart
Hi-
I have a spreadsheet that displays data as a 3D chart - I would like to make the Positive and Negative values different colours (i.e below zero is RED - is that possible?
Thanks!
AndyHi Andy,
You can assign the negative values to one series and the positive values to another. Here's an example:
Column C in the Chart Data table contains the expression:
=IF(B<0, B, "")
Column D in the Chart Data table contains the expression:
=IF(B<0, "", B)
To create this chart, click on Column Label A, then Command-Click on Column Labels C and D. This sets you up to create a 2-series chart. Then Insert a 3-D Area Chart.
The 2 series are offset in the Z-axis, so some angles of view won't look so good, but you can experiment and find a view angle that works for you.
Jerry -
Negative values in red and Positive values in black CONDITIONAL FORMATTING
Hi ... Everyone
I have to show Negative values in red and Positive values in black in one of my report.
i tried these conditions
1. <?if:GAIN<0.00?><?attribute@inlines:color;'red'?><?end if?>
but it shows negative values only in red ,positive values in black are missing
2. <?if:GAIN<0.00?><?attribute@incontext:color;'red'?><?end if?><?if:GAIN>0.00?><?attribute@incontext:color;'black'?><?end if?>
This gives the exact result what i wanted ...but the problem is i have five tables in my report ... so the above condition only allow changes in ONE TABLE ONLY. :(
Plzzzz anyone who can help me to sort out my problem or else SUGGEST ANOTHER WORKING CONDITION
Regards
Subham MittalSubham,
This should not be difficult and moreover the BI Publisher Desktop installation comes with a set of examples:
Start -> Programs -> BI Publisher Desktop -> Samples -> RTF Templates -> Advanced -> Conditional
There you can find two templates with the exact same situation like yours, highlighting either the foreground color or background color.
regards
Jorge -
Force user to enter positive/negative values on certain GL Accounts
Hi
If I want to force the user to be only able to enter positive values for certain GL Accounts and only negative values for other accounts, how can I do this?
Thanks
JohanHello Johan,
I think you have posted your question to the wrong forum.
This forum is specifically regarding the OnDemand applications like https://bi.ondemand.com
Cheers
Steve -
Numbers 3 summing cells with negative values
I am trying to sum a column of cells with postive and negatve numbers but the result does not consider the the negative sign. It just adss absolute values
There is something else going on. I can clearly sum positive and negative numbers:
Please use this note to post a screenshot of the data in question:
https://discussions.apple.com/docs/DOC-6591 -
Numbers do not accept negative values after upgrading to Snow Leopard
I have iWork 9 installed in Leopard, and after upgrading to Snow Leopard, Numbers don't accept negative values, e.g. -141. They are defined as text and are aligned left in the cell, even if the cell is defined for numbers. Positive values are defined as numbers and aligned right.
All my statistics are wrong now. I don't where to find a sollution. Need to fix this asap.I may guarantee that the cell contains a standard minus symbol.
I entered in the Index.xml to see if something was odd.
All is perfect.
I can't imagine that the OP replaced deliberately a wrong char by a correct one before sending the file to my mailbox.
And I repeat,
(1) in the file which I received, the cell was really treated as a text one.
(2) on my machine, on the OP's alternate machine, on the OP's alternate user account, resetting the cell's status to numbers apply well.
So, if a third party component is the culprit, it would be easy to identify: it must be in one of the user account able to receive third party items which means
<userAccount>:Applications
<userAccount>:Library:Address Book Plug-Ins
<userAccount>:Library:Fonts
<userAccount>:Library:Contextual Menu Items
<userAccount>:Library:LaunchAgents
<userAccount>:Library:PreferencesPanes
<userAccount>:Library:Scripting Additions
<userAccount>:Library:Services
<userAccount>:Library:Widgets
But from my point of view it would be more efficient to try to search a culprit in the
<userAccount>:Library:Caches folder.
An efficient tip would be to compress every subfolder of this folder as a .zip file and trash the original file.
Reboot so that the account restarts without the caches.
If th account continue to fail, my idea was bad.
If it behaves well, the culprit was one of the caches.
unpack them one by one so you will get the wrongdoer.
Yvan KOENIG (VALLAURIS, France) mardi 8 septembre 2009 18:50:27 -
Hi
Can we use Negative values in BLOB and CLOB.
Please help me
Thanks
Rameshuser9077483 wrote:
Can we use Negative values in BLOB and CLOB.CLOB stores character data and BLOB stores binary data. So all you could is to store string representation of a number (negative, zero or positive) in a CLOB and binary representation of a number (negative, zero or positive) in a BLOB. Question is why would you do that? Anyway, number to clob conversion is done automaticallly (implicitly), while you would need to use something like utl_raw package to convert number to blob:
SQL> create table tbl(b blob,c clob)
2 /
Table created.
SQL> insert into tbl values(-1,-1)
2 /
insert into tbl values(-1,-1)
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected BLOB got NUMBER
SQL> insert into tbl values(utl_raw.cast_from_number(-1),-1) -- this stores number as blob and as clob
2 /
1 row created.
SQL> select * from tbl
2 /
SP2-0678: Column or attribute type can not be displayed by SQL*Plus
SQL> select c from tbl -- this returns clob, not a number
2 /
C
-1
SQL> select utl_raw.cast_to_number(b),to_number(c) from tbl -- this returns both blob and clob converted back to number
2 /
UTL_RAW.CAST_TO_NUMBER(B) TO_NUMBER(C)
-1 -1
SQL> But again, even though you could (at a relatively large cost of associated conversions and storage expenses) I do not see any reason to store numbers as blob/clob.
SY. -
ICR Upload negative values over Upload File
Dear Experts (or in most cases Dear Ralph ; ),
Ich have a question concerning the Upload File which makes it possible in ICR to upload datas via an Excel/TXT Interface.
My Question is how can I upload negative values?
Because when I upload a value like "-100" the value in ICR will be converted to "100", so a positive amount.
So how can I explain the system that the value in the txt-file should be uploaded as an negative value?
Should I control it over the debits/credits indicator?
Or should the minus stand at the back of the values?
Thanks in advance for any helpful answer
Regards
ThomasHi,
If I am not wrong it will be through debit credit indicator (SHKZG: S for positive and H for negative)
Regards,
Saravan Kanuparthy
Maybe you are looking for
-
Where can I get a Thunderbolt SPLITTER? (Thunderbolt to Thunderbolt & Thunderbolt.) I cannot daisy chain because of no Thunderbolt OUTPUT on the chassis.
-
I've followed the instructions to download previously purchased songs to iTunes (I am using 10.3.1), however when I get to the Purchased page, I only have the tabs Apps and Books showing. It has no Music tab. I have 71 purchased songs showing in the
-
Configuring error message in BEx link in SPM 2.1
Hi, Currently working on Spend Performance Management(SPM) 2.1 application. I am trying to configure error message which pops up along with BEx link whenever we run reports with large amount of data. I would like to configure error message so that it
-
LDAP Replication and Indexing on DS5.1SP4
Dear experts, > We are helping customer to setup a replica directory server that we will replicate data from a master directory server. The master directory server contains 13GB data with index built. We found that search operation failed even we ini
-
A12E1 error on first download of Creative Cloud installer...Please Help
I have tried downloading with root user enabled...what else should i do? I recently installed a brand new hard drive and updated my OSX to 10.8.5