How can I subtract a percentage?
Is there a way to subtract percentages? Here is an example of
what I need to do: 138 - 5% = 131.1
Some of what I have is...
<cfset HDQty = 6>
<cfset HDSAmplePrice = #getSamplePrice.HDPrice#>
<cfset HDSubTotal = #HDQty# * #HDSAmplePrice#>
<cfset HDDiscount = #getDiscount.DiscountAmt#>
This is where I don't know what to do, obviously if I just
subtract the discount it minuses 5 not 5%
<cfset HDTotal = #HDSubTotal# - #HDDiscount #>
Any and all help is greatly appreciated!!!
quote:
Originally posted by:
ICSchaef
Is there a way to subtract percentages? Here is an example of
what I need to do: 138 - 5% = 131.1
Any and all help is greatly appreciated!!!
Write it out manually first.
138 - (138 * .05)
Then convert it to code.
Similar Messages
-
When I open a jpeg image at 100% is too large to see. How can I change the percentage to be able to view document?
== This happened ==
Every time Firefox openedYou have to change the settings in whatever program you use to open the jpg. Firefox has no control over that. What program do you use to open jpg?
-
How can i compare in percentage, vowels and consonants in english and german language?
how can i compare in percentage, vowels and consonants in english and german language?
Hi,
Try comparing the Unicode value of the characters, see the code samples in these threads:
Generating unicode
for arabic character similar to Character map in c#
How
do you get the numeric unicode value of a character?
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How can I subtract amount[3] from this sum? sum(amount[0],amount[1],amount[2])
sum(amount[0], amount[1], amount[2]) - amount[3]
Kyle -
How can i subtract budget and actuals amount from gl_balances in discoverer
I have a problem with a discoverer report.
The table is GL_BALANCES (Financials), and i tried to subtract data of current year and last year, same month, or data from actuals and budgets amounts.
Data from actuals have the "A" code in the ACTUAL_FLAG field, and budgets amounts have a "B" code. I construct a cross-tab report with ACTUAL_FLAG field in the "X" axis and the accounts segments in the "Y" axis (From GL_CODE_COMBINATIONS). The problem is: How can i substract budget and actuals amounts? Is the same field but differents columns in report.
I cannot use analytics function because the version of database does not support that .
Somebody told me: "...You need to construct a custom folder to handle this..."
I don't want to finish the reports in Excel...
Thanks.Hi Miguel
You can either create a database view or custom folder to do this using aliases for the two joins to the same table.
For example, you need something like this in the body of the SQL:
select
act.code_combination_id,
nvl(act.period_net_dr,0) actual_net,
nvl(bgt.period_net_dt,0) budget_net,
nvl(bgt.period_net_dt,0) - nvl(act.period_net_dr,0) diff,
act.period_name
from
gl_balances act,
gl_balances bgt
where
act.set_of_books_id = bgt.set_of_books_id and
act.code_combination_id = bgt.code_combination_id and
act.period_name = bgt.period_name
Of course you will still need to add your own joins to get the code combinations but I trust you get the gist.
Hope this helps
Regards
Michael -
How can I enter actual percentage of completion in the WBS elements?
Hi all !
I Can not enter Actual percentage of completion in WBS elements...!
I have followed these steps in Progress analysis:
1.- In the progress tab of WBS elements I have entered Measurement method ESTIMATION for
progress analysis (Plan&Actual).
2.- In the WBS element I have estimated PLAN percentage of completion 100% in period 8
3.- In the progress tab of network activities, I used ESTIMATION method for Plan and WORK for actual
to calculate the percentage of completion.
4.- I have entered final network confirmations
Actual Start date: 08.11.2014
Actual Finish date: 08.15.2014
Remaining work is cero.
5.- I run Project analysis to display measurement methods with transaction CNE1
and Progress analysis with transaction CNSE5
In Progress analysis the Processing % of work in Network activities is 100% but 0% in the WBS
element
Adj.NAgg.Act. POC (Adjusted non-aggregated actual percentage of completion)is 100% in network activities
POC actual, non-agg.(Non-aggregated actual percentage of completion)is 100% in network activities.
Does SAP calculates actual POC?
Should I manually enter Actual percentage of completion in the WBS elements?
I can not enter percent of completion (actual value) for WBS elements. The field is non editable !
Please help !Hi Rafael,
I am facing the same problem.
I am using Plan method at activity : Time Proportional
Actual method at activity : Work completion
At wbs level Plan and actual is Time proportional.
I am not identified how the "Adjusted non-aggregated actual percentage of completion" and
"Non-aggregated actual percentage of completion" is calculated.
Please help me for the same.
Regards,
Pradeep -
How can i calculate the percentages and update the progressBar in the splash screen form ?
I created a splash screen form:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
namespace GetHardwareInfo
public partial class SplashScreen : Form
public SplashScreen()
InitializeComponent();
private Mutex mutex = new Mutex();
public void SyncedClose()
mutex.WaitOne();
this.Close();
mutex.ReleaseMutex();
public void UpdateProgressBar(int percentage)
if (this.InvokeRequired)
mutex.WaitOne();
if (!IsDisposed)
this.BeginInvoke(new Action<int>(UpdateProgresPRV), percentage);
mutex.ReleaseMutex();
else
UpdateProgresPRV(percentage);
private void UpdateProgresPRV(int per)
if (progressBar1.IsDisposed) return;
progressBar1.Value = per;
private void SplashScreen_Load(object sender, EventArgs e)
The SplashScreen form have in the designer image and on the image a progressBar1.
Then in form1 i did in the top:
List<string> WmiClassesKeys = new List<string>();
IEnumerable<Control> controls;
string comboBoxesNames;
SplashScreen splash = new SplashScreen();
And in the constructor:
controls = LoopOverControls.GetAll(this, typeof(ComboBox));
string[] lines = File.ReadAllLines(@"c:\wmiclasses\wmiclasses1.txt");
foreach (string line in lines)
foreach (ComboBox comboBox in controls.OfType<ComboBox>())
if (line.StartsWith("ComboBox"))
comboBoxesNames = line.Substring(14);
else
if (line.StartsWith("Classes"))
if (comboBox.Name == comboBoxesNames)
comboBox.Items.Add(line.Substring(14));
foreach (ComboBox comboBox in controls.OfType<ComboBox>())
comboBox.SelectedIndex = 0;
The method GetAll is to loop over specific controls:
public static IEnumerable<Control> GetAll(Control control, Type type)
var controls = control.Controls.Cast<Control>();
return controls.SelectMany(ctrl => GetAll(ctrl, type))
.Concat(controls)
.Where(c => c.GetType() == type);
When i'm running the program it's taking some time to make the foreach loops in this time i need to show the SplashScreen and update the progressBar untill the foreach loops over.Don't use Application.Doevents. It's not required and can cause problems.
I do not really grasp the approach you are taking here. So let me make a different suggestion:
SplashScreen:
using System;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApplication1
public partial class SplashScreen : Form
private static SplashScreen DefaultInstance;
public SplashScreen()
InitializeComponent();
public static void ShowDefaultInstance()
Thread t = new Thread(TMain);
t.Name = "SplashUI";
t.Start();
public static void CloseDefaultInstance()
DefaultInstance.Invoke(new Action(DefaultInstance.Close));
private static void TMain()
DefaultInstance = new SplashScreen();
DefaultInstance.Show();
Application.Run(DefaultInstance);
public static void UpdateProgress(int Progress)
if (DefaultInstance.InvokeRequired)
DefaultInstance.Invoke(new Action<int>(UpdateProgress), Progress);
else
DefaultInstance.progressBar1.Value = Progress;
Form1:
using System.Windows.Forms;
namespace WindowsFormsApplication1
public partial class Form1 : Form
public Form1()
InitializeComponent();
SplashScreen.ShowDefaultInstance();
for (int i = 1; i<=100; i++)
System.Threading.Thread.Sleep(20); // simulates work
SplashScreen.UpdateProgress(i);
SplashScreen.CloseDefaultInstance();
EDIT: Please note that the progressbar itself is being animated by the system, so it might look slower than it really is. To workaround this, there are solutions available (you'll find them) that first set the value one higher than necessary, then
back to the actual value.
Edit #2: You do need a different thread, otherwise the UI is locked while the loop is running in your Form1's constructor.
Armin -
How can I have conditional percentage in MXML?
I love the fact that you can set a components width or height to a percentage of its parent container.
<mx:Button height="100%" />
What I would like to do is have a conditional percentage based on some bindable boolean
[Bindable] public var switch:Boolean = true;
<mx:Button height="{switch ? '100%' : '20%'}" />
Unfortunately I get an error saying that I can't use a string in place of a number. I also tried this syntax and it still wont work,
<mx:Button height="{switch ? 100% : 20%}" />
Any suggestions? Is this even possible? Thanks.There is a secret piece of metadata called [PercentProxy(
"percentHeight")]
that you can use... It redirects percentage values elsewhere.
Take a look at UIComponent.get height() -
How can i subtract two numeric numeric numbers from two switch cases ?
I have two switch cases in my labView program. I can see them individually on front panel but i need to subtract them and see the result on front panel.
Can someone please help me out...
I am trying to display (Result1 - Result 2) on my front panel. Result1 and Result2 will change with time.
Regards,
Awais
Attachments:
play4.vi 122 KBMove result 1 and result 2 out of the case structures and subract them.
Right now result 1 or result 2 only get written to if its respective comparison is true. What do you want to do with the math if either comparison is false? You haven't defined your problem clearly enough. -
How can I get the percentage of the image color more faster?
I tried the command of ColorSampler/ColorSamplers.
but , sampling speed is very slow.
So, the script run sampling for 2000x1000 pixels image , then it hangs for five minutes over.
Do you know the method that can be processed early?
Sample Script:
var myDoc = app.activeDocument;
var lighterSamples=0; // number of lighter pixels
var darkerSamples=0; // number of darker pixels
var docWidth = myDoc.width;
var docHeight = myDoc.height;
app.activeDocument.colorSamplers.removeAll();
var pixelLoc = [UnitValue(0) , UnitValue(0)];
var myColorSampler = app.activeDocument.colorSamplers.add(pixelLoc);
for(xPos = 0 ; xPos < docWidth ; xPos++){
for(yPos = 0; yPos < docHeight; yPos++){
var myColor = myColorSampler.color;
if(myColor.rgb.red>125){
lighterSamples++;
}else{
blackSamples++;
pixelLoc[0] = xPos;
pixelLoc[1] = yPos;
myColorSampler.move(pixelLoc);
alert("number of lighter px="+lighterSamples+" / number of darker px="+darkerSamples);
Thanks.
NakamoriA variation of this thread might help.
http://forums.adobe.com/thread/834970?tstart=0
If you saved your document as an eight bit RGB RAW file you could use this code...
File.prototype.readByte = function() {//aka unsigned byte
return this.read(1).charCodeAt(0);
var rawFile = File.openDialog("Please select Raw Image");
rawFile.encoding = 'BINARY';
rawFile.open('r');
var whiteSamples = 0;
var blackSamples = 0;
var Total = rawFile.length/3;
while(!rawFile.eof){
var R = rawFile.readByte();
if(R > 125){
whiteSamples++;
}else{
blackSamples++;
var G = rawFile.readByte();
var B = rawFile.readByte();
rawFile.close();
alert("Total pixels = "+ Total + " White Samples = " +whiteSamples + " Black Samples = " + blackSamples); -
In the following sql, i need to subtract nvl(m.evaluation_rights,0) from ooc.installs (which is found in the subquery)
i continually get an error ORA01722, invalid number
select m.model||CHR(9)||
m.ej_sftwr_id||CHR(9)||
m.ej_sftwr_lic_ty_txt||CHR(9)||
m.ej_technology_owner||CHR(9)||
m.ej_technology_monitor||CHR(9)||
m.ej_appl_own_empl_id||CHR(9)||
ooc.installs||CHR(9)||
nvl(m.evaluation_rights,0)||CHR(9)||
ooc.installs-nvl(m.evaluation_rights,0) <--------my attempt at subtracting
from modelm1 m,
(select ej_sftwr_id, count(*) installs
from computer r
where ej_sftwr_id like '1%'
group by ej_sftwr_id) ooc
where ooc.installs>nvl(m.evaluation_rights,0)
and ooc.ej_sftwr_id=m.ej_sftwr_id
order by m.model;
any help would be greatly appreciatedIf you're sure to have only number in your columns :
SQL> select ename||sal-nvl(comm,0) from emp
SQL> /
select ename||sal-nvl(comm,0) from emp
ERROR at line 1:
ORA-01722: invalid number
Elapsed: 00:00:00.07
SQL> select ename||to_number(sal-nvl(comm,0)) from emp
SQL> /
ENAME||TO_NUMBER(SAL-NVL(COMM,0))
SMITH800
ALLEN1300
WARD750
JONES2975
MARTIN-150
BLAKE2850
CLARK2450
SCOTT3000
KING5000
TURNER1500
ADAMS1100
JAMES950
FORD3000
MILLER1300
14 rows selected.
Elapsed: 00:00:00.00
SQL> Nicolas. -
How can I check the percentage of my iPhone 5's original battery capacity?
I'm wondering if there's any way I can check what the capacity of my iPhone 5's battery is compared to its original capacity. I know Apple will replace the battery for free if it is under 50% of the original capacity since it's still covered under the one-year warranty but I'd rather know that's the case before I send it in and go without a phone for a week.
A problem does exist; it takes significantly less time for me to deplete my battery now than it did when I bought my phone. Please stop acting like this discussion is over just because you cannot answer my question. I would like to seek the knowledge of other regarding ways to check my battery capacity. I appreciate your suggestions, but I purchased an iPhone 5 because it was an upgrade to the iPhone 4 and it was supposed to have the same battery life. However, 20 months after I purchased my iPhone 4 the battery still lasted longer than the battery in my 11 month old iPhone 5. My warranty expires in a few weeks and I need to know now whether I should send it because once the warranty expires a battery replacement is going to set me back $80 plus shipping fees.
-
How can I calculate column percentage in Essbase report writer?
If you think about sample:basic, I have Q1 and Q2 on my columns and PkgType, Bottle and Can on my rows. i want to create a new column "%" and show the quarterly values as a percent of PkgType for the respective quarter. Essbase Analytical Services Technical Reference has this example but it doesn't work on my report, I don't if it's because I have attribute dimension on my rows:
// This report performs column calculations based on values in a
// report row.
<PAGE (Scenario, Product, Market)
Actual
<COLUMN (Year)
Qtr1 Qtr2
{ DECIMAL 2 3 4 }
{ NAMEWIDTH 22 WIDTH 7 3 4 }
{ ORDER 0 1 3 2 4 5 }
<ROW (Accounts)
{ SAVEROW } Sales
{ CALCULATE COLUMN "%" = 1 % "Sales" 1 }
{ CALCULATE COLUMN "% " = 2 % "Sales" 2 }
{ CALCULATE COLUMN "Avg" = 1 + 2 / 2. }
<DESCENDANTS Accounts
Any help will be much appreciated!sorry that example was based on Demo:Basic and it does work but when apply that logic to what I try to do, it doesn't work.
Please see the PkgType example I sent and I am trying to get this result in Sample:Basic.
Sales New York Product Actual
Qtr1 % Qtr2 %
Pkg Type 7,705 100 9,085 100
Bottle 5,707 74.07 6,727 74.04512933
Can 1,998 25.93 2,358 25.95487067
I tried this script but didn't work:
<PAGE("Measures","Market","Product","Scenario")
<COLUMN("Year")
<ROW("Pkg Type")
"Sales"
"New York"
"Product"
"Actual"
"Qtr1"
"Qtr2"
"Pkg Type"
"Bottle"
"Can"
{ CALCULATE COLUMN "%" = 1% "Pkg Type" 1 }
{ CALCULATE COLUMN "% " = 3 % "Pkg Type" 3 }
! -
How can i calculate manually fact and dimensional table ralations?
hi friends,
how can i know the information dimension table >15 of fact table, how can i calculate thses percentages manually?
regards
suneel.hi Suneel,
it's another topic, to improve query performance, we evaluate if aggregate help or not, to justify we use bw statistic or ST03N, where summarization ratio is > 10;
the summarization ratio = number of record read from database / number of record transferred,
we need also the other parameter 'percentage of db time', time spent on database / total query runtime.
check
SAP BW Query Performance Tuning with Aggregates
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
hope this helps. -
after upgrading to ios 5.1 on my iphone 3gs, the battery percentage dosent work well, it dosent move. how can i fix the problem?
Have you tried doing turning the battery level display off and then General -> "Reset all settings"? You won't loose any data and that should do the trick.
Maybe you are looking for
-
So I sign up for iTunes Match an start adding music to my iPod touch 5 generation I have a lot of music on my hard drive that I had for over 3 years now but some reason they are not syncing to my iPod touch notting is wrong with my music some may not
-
Trace file in different location
Dear all, 11g on Solaris 10. My oracle home (dump location) located in a file system of 10GB.. I need to trace a session which will generate huge trace file. Is there anyway I can have the trace file generated in a different location where I have eno
-
Why does my Xserve keep crashing?
Running 10.7.2 Dec 27 00:30:00 xserve newsyslog[14983]: logfile turned over due to size>1000K Dec 27 00:30:09 xserve kernel[0]: IOSCSIMultipathedLogicalUnit: Timed out waiting for paths to become available, loops = 4 Dec 27 00:30:20 xserve kernel[0]:
-
I keep getting a Time Capsule Error, how do I resolve?
I keep getting a Time Capsule Error, how do I resolve?
-
Save to SharePoint from Reader X
Hi, I have some clients that are attempting to save from Reader X to a network place (web folder) configured in their OS. For users running Windows 7 this works without issue, however users on Windows XP just get a blank folder when choosing to open