Percentage of a sum
How do I sum up a set of cells and then display just 10% of the total ?
So for example
100
200
300
400
TOTAL is 1000 but I just want the cell to display 10% of this value.
10 percent is the same as the fraction 10 out of 100 (or 10 divided by 100).
so 10% of the sum is:
enter the values in column A then enter the formula
B1=SUM(A1:A4)×10÷100
This is shorthand for select cell B1, then type (or copy and paste from here) the formula:
=SUM(A1:A4)×10÷100
Similar Messages
-
How to use trigger to catch the sum of a column is greater than 1
Here is my problem.
I create a table, which is preference( name char, percentage real);
the sum of the percentage for some user(name) should be 1;
And one user can have many records in the table as needed.
I should to validate the insert data which is valid after a series of insert operation? How can I do it?Exactly what I was thinking:
SQL> create table preference
2 (
3 name varchar2(20),
4 percentage number(3)
5 );
Table created
SQL> create materialized view preference_mv
2 refresh on commit
3 as select name,sum(percentage) total_percentage
4 from preference
5 group by name;
Materialized view created
SQL> alter table preference_mv add constraint c_pref_pct check (total_percentage = 100);
Table altered
SQL> insert into preference values ('name1',25);
1 row inserted
SQL> insert into preference values ('name1',50);
1 row inserted
SQL> insert into preference values ('name1',25);
1 row inserted
SQL> commit;
Commit complete
SQL> insert into preference values ('name2',10);
1 row inserted
SQL> insert into preference values ('name2',30);
1 row inserted
SQL> commit;
commit
ORA-12008: error in materialized view refresh path
ORA-02290: check constraint (SCOTT.C_PREF_PCT) violatedSQL> -
I am a realy newbie regarding to the ALD in Business One.
I am trying to print out at the end of my producttable in my invoice a line like this:
"incl. VAT with Code A2 at 16,00% (for instance) of (the amount of all the lines which are calculated with the Code A2) (and then the sum of the taxes)"
Could you tell me how to describe the function ?
Thanks in advanceI had the same problem. At first it looks as though SAP has already worked upon tax summaries inside ALD, but there was no way to find out how they should work.
One can only shout out loud that, at least with german laws, <b><i>ALD is no use for sales documents as long as it can't produce VAT sums</i></b>.
<u><b>Here's a workaround:</b></u>
1. Create three sum variables for each relevant vat group:
- price before taxation (e.g. "PRICE")
- price after taxation (e.g. "GROSS")
- tax itself (e.g. "VAT")
Example:
Implementing two tax groups, create:
@PRICE1,@PRICE2,@GROSS1,@GROSS2,@VAT1,@VAT2
2. Use conditional accumulation for the sum variables:
Example for a @GROSS1 variable:
if( Belegzeile.Steuerdefinition_VatGroup.Code="A1" , Belegzeile.Preis_inkl__Steuer * Belegzeile.Menge , 0 )
Sorry 'bout the german field names; I'm sure it'll be easy to translate.
3. Create taxation summary in the footer of your table:
- Add one line per tax group.
- Use the corresponding sum variables to print out values.
- Use one of the sum variables for definition of a print condition. Example:
@GROSS1>0
The corresponding VAT sum line will only be printed if there are amounts available in the current document.
That's all!
It's quite easy, but it requires static definition of known tax groups. Sum variables can only be numeric, so there's no way to extract the tax group names from the database for later use.
However, to create a more generic template you can define the group names and codes by user variables. Usage of such "constants" could make adaption of form templates much easier (I use them for tax names and fstring$ format definitions).
====================================
Extension:
If you want to extract the vat percentage rates into sum variables you would have to expand the variable calculations as such (example for sum variable @PERC1):
if(@PERC1=0 and Belegzeile.Steuerdefinition_VatGroup.Code="A1",Belegzeile.USt__Prozentsatz_pro_Zeile,0)
@PERC_A1 will only be accumulated once and takes over a single desired value.
<i>keywords: "advanced layout designer" tax taxation "tax summary" "vat summary" vat invoice legal</i> -
Crystal Reports Pie Chart showing Sum 100% in Legend. How to remove?
I have a Pie chart which displays correctly but in the Legend is displayed the values with the correct percentages AND the Sum showing 100%.
I need to either remove the Sum line or be able to change the text from the report since I have to produce the report in 4 languages and the Sum always shows up in the language of the server.
the legend looks something like;
value1 25%
value2 25%
value3 75%
Sum 100% <------ this line must go or be changed (e.g. in Italian as Totale)
Running a server for each language is not an option
There are a variable number of values so I cannot overlay a rectangle on a fixed position. (awfull solution)
Is there any way I can simply turn off the Summ (not the whole legend which is needed)?
any help would be greatly appreciated.
I am using Crystal Reports 2008
Best Regards
Chris RyderWell Thank you everyone for your suggestions.
The client is very specific about the look and feel so I cannot change to not using a legend. However, the discussions serves to confirm that it is NOT possible which is actually just as useful.
In Conclusion
To restate the problem the client has a report which can be displayed in one of four languages by choice from the end user. The report contains a pie chart which displays the various segment names and percentages as a legend. At the bottom of this legend appears automaticaly the word Summ in the langauge of the the 'Server Locale' (in our case german Summe) and the 100% value.
I wished to know if it was possible to either change the language of this word (without changing the server as I do not have access) or to remove it altogether.
The answer is NO it is not possible to remove only this word or to change it in anyway.
Our final workaround is;
we hide the Legend on the graph and build it as a seperate entity next to the graph. Not ideal as everything is then done twice and we have an indirect link between the segment colours and the legend colours which is not apparent directly in the report. But at least the client has signed off on the report.
once again thank you for taking the time to think about the problem.
Chris Ryder -
Cross -tabs Percentage of Count Truncating Issue
Hi- I'd appreciate any insight into how I can get the percentage of a count in a cross-tab to display a decimal point. The system is currently truncating the percent values-- 12.9% is showing as 12%. I've tried to usual formatting options. It works with a percentage of a sum just fine. Thanks!
You are correct. It can be done using SUM as opposed to COUNT. I created a formula assigning a number to the counting field. example: IF FIELD_CODE = 'A' THEN 1 ELSE IF FIELD_CODE = 'B' THEN 1   By assigning a number you can now SUM the formula.Â
-
User LIS average ratios instead of sum
Hi guys,
Im creating a user LIS, i know that when creating LIS on MC21 there is flag with indicates if its reasonable to add the values on this ratio, and i need to know if by any chance instead of adding the rations on LIS, system can make an average of them. See in LIS MCI7 system calculate MTBF & MTBR and average them, how can i make that with a user created ratio.
Thanks.Hello,
Plese see below the correct syntax for the SUM function
The following examples are applicable to both Basic and Crystal syntax:
Sum({file.QTY})
Calculates the sum of all values in the QTY field.
Sum({orders.AMOUNT}, {orders.CUSTOMER ID})
Sums (totals) the orders in each group of orders in the Amount field. The orders are separated into groups whenever the value in the Customer ID field changes.
Sum({orders.AMOUNT}, {orders.DATE}, "monthly") % Sum({orders.AMOUNT })
Groups values in the Amount field by month, and calculates the sum of the values for each month group as a percentage of the sum of the values for the entire report.
Sum([{file.AMOUNT}, {file.PRICE}, {file.COST}])
Sum of values in the Amount, Price, and Cost fields. -
Formula for calculating aggregate percentage and percenatge of gender
hi all
i have a sp from which i get result columns gender,percentage,studentcount,year
my sp is like this..
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[usp_GetState]') AND type in (N'P'))
DROP PROCEDURE usp_GetState
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[usp_GetState]
( @ExamYear Smallint
,@ExamType Nvarchar(10)
AS
BEGIN
SET NOCOUNT ON;
WITH cte_Schools AS
SELECT
[Foreign]= CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END StateName
,COUNT( DISTINCT M.SchoolCode) Schools
,SUM( M.Nos) Students
FROM rptFinalResultSummaryMaster M
LEFT OUTER JOIN State S ON M.StateCode=S.StateCode AND M.Zone=UPPER(LEFT(S.Zone,1))
LEFT OUTER JOIN Country C ON S.CountryId= C.CountryId
WHERE M.Year=@ExamYear AND M.CourseCode=@ExamType
GROUP BY CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END
SELECT
SlNo=ROW_NUMBER() OVER(PARTITION BY [Foreign] ORDER BY StateName)
,[Foreign] ,StateName, Schools, Students
, Percentage = (Students/(SELECT SUM(Students)*1.000 FROM cte_Schools))*100
FROM cte_Schools
ORDER BY [Foreign],StateName
END
GO
now..i wrote formula for percentage and when i connected this sp to my rdl where i took tablixi gave percentage value to gender and total percentage column
gender(column group)
total
number percentage
passcategory
this is my tablix format
my output looks like
boys girls
total
number(percentage)
passcategory1 (percenatge) 21 (40.38) 43 (56.75)
64(48.56)
passcategory2 (percenatge) 11 (21.15) 10 (13.51) 31(17.33)
passcategory3 (percentage) 20 (38.46) 21 (28.37) 41(33.41)
total (percentage)
52(xxx) 74 (xxx) 136 (100%)
i'm not getting thegender percentage properly for girls and boys total percentage of boys and girls coming correctly but individual percentage is not properly coming...that's because in sp i gave calculation for only total percenatge ..how can i calculate
the individual percentage of girls and boys in single column...so that i can place in gender column in tablix..and i can retrieve individual percentgaes of girls and boys seperately as shown in output..
please reply..its urgent
thanks in advance..
luckyplease reply..its urgent
Here is a tip: if you want to tick off people from helping you, you should absolutely include "urgent" in your post. That's a good way to encourage people to move to the next post. I did see this one earlier today, but did not have the time.
Anyway, I cannot really make out heads or tails of your question. Your output takes about gender, but I cannot see it in the output from the query, which appears to group by "Foreign" and StateName. How does the boys and girls get into the picture?
And for that matter that "totals" column?
Erland Sommarskog, SQL Server MVP, [email protected] -
Okay, so I need to sum the values of a particular cell in a table, display that value, then display a message if they sum to more than 100. I tried to use javascript, but I couldn't figure out how to make a sum function. With FormCalc the sum function is built-in and works perfectly, but I can't get the message box to work. Here's what I have so far (in the calculate event):
Sum(Body[*].Percentage_of_Interest)
if ((Sum(Body[*].Percentage_of_Interest)) > 100) then
xfa.host.messageBox("The percentages you entered sum to more than 100%. Please check to ensure you have not made an error.", "Error", 0, 0);
endif
If I comment out the bottom three lines, the top one works fine, but if I uncomment them, the field displays 0.00000% and doesn't respond when I change the values of the cells it is adding. Anyone have any suggestionsI figured it out. Here's the code I'm using
var sum = 0;
for (var i = 0; i < _Body.count; i++) {
sum += Body.all.item(i).Field_Name.rawValue;
this.rawValue = sum;
if (sum > 100) {
xfa.host.messageBox("The percentages you have entered sum to more than 100%. Pleace check to ensure you have not made an error.", "Error", 0, 0); -
Need Help With Custom Calculation Script
Hey everyone. I'm using Acrobat Pro X and stumbling a bit on the syntax for the following equation. I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3". However,the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 & "Cell2". For example: If the user enters "3" into "Cell3" I need the returned value to be 3% of the sum of "Cell1" + "Cell2". If the user enters "9" into "Cell3" I need the returned value for "Cell3" to be 9% of the sum of "Cell1 & Cell2" and the end result needs to be the sum of "Cell1+Cell2+Cell3". In greater detail:
If "Cell1" = $500, "Cell2" = $500 and "Cell3" = "3" then I need the returned value to be $1030.00.
I hope this makes sense. Here's what I have so far but alas, it's not working. Any help would be GREATLY appreciated.
// Get first field value, as a number
var v1 = +getField("Cell1").value;
// Get second field value, as a number
var v2 = +getField("Cell2").value;
// Get processing field value, as a number
//var v3 = +getField("Cell3"/100).value;
// Calculate and set this field's value to the result
event.value = v3+(v1+v2);
Thanks,
SolanI posted an answer but realized it wasn't what you wanted. There is some confusion about what you want for Cell3. On the one hand, you say you want the user to enter a vaule in the field, but them you say you want its value to be calculated based on what the user enters and two other field values. It seems to me Cell3 should be the field that the user enters the percentage and the calculated field's (Cell4) script could then be:
// Get first field value, as a number
var v1 = +getField("Cell1").value;
// Get second field value, as a number
var v2 = +getField("Cell2").value;// Get processing field value, as a number
// Get the percentage
var v3 = +getField("Cell3").value;
// Calculate and set this field's value to the result
event.value = (1 + v3 / 100) * (v1 + v2); -
Pivot table sorting with month_id and average column in BI publisher temp
In my project we are using the Oracle BI analysis for creating reports in BI publisher.
At first we are creating the report in OBIEE answers then using it as data model in BI Pub.
My reporting table holds data like below:
Month_Name Year Month_Id Compensation Emp ID
JAN 2011 1000 50 1234
FEB 2011 1001 60 1235
We need to show the data in pivot format i.e period(concated month+year) in column and comepsation values as measure and emp id in rows.I also need to show percentage i.e sum(Compensation/no of selected of periods).
For average in OBIEE pivot i have create one calulated item. But I can't sort the data(for periods with the month_id) as its spillting the average column also.
How can i sort it? like JAN2011 FEB2011 MAR2011 in pivot
also in BI pub this calculated item not showing correct value.
Please help.Hi,
You can achieve this requirement by sort order column based on the month number and year you can sort this criteria column.also by using time_key,if the time_key is in sequence.
mark if helpful/correct...
thanks,
prassu -
Pie Chart in Management Cockpit
Hi everybody,
this time a question concerning pie charts in Mgt Cockpit. Does anyone how to show the percentage values of each part of the pie within the chart? Is this possible? I only see the absolute values concatenated with the "%"-sign, which makes no sense.
Or do I have to adjust the query to make the query deliver percentage-values (which sum up to 100%)?
Thx in advance!
ThomasHi,
If you want to see the percentage value according to the total value, write <b>0.0$Percent%</b> in the <i>format</i> section of your series/point. -
Problem with the "Wait" function in dialing a number with an extension.
I inserted a "wait" into phone number, followed by an extension. When I tap the number, it dials the call. Next to the "End" button, there is a button that shows "Dial..." and the extension. HOWEVER, the next calls for other numbers will always show the same "Dial..." and the extension until IOS restart. Any solution?
Hello,
Plese see below the correct syntax for the SUM function
The following examples are applicable to both Basic and Crystal syntax:
Sum({file.QTY})
Calculates the sum of all values in the QTY field.
Sum({orders.AMOUNT}, {orders.CUSTOMER ID})
Sums (totals) the orders in each group of orders in the Amount field. The orders are separated into groups whenever the value in the Customer ID field changes.
Sum({orders.AMOUNT}, {orders.DATE}, "monthly") % Sum({orders.AMOUNT })
Groups values in the Amount field by month, and calculates the sum of the values for each month group as a percentage of the sum of the values for the entire report.
Sum([{file.AMOUNT}, {file.PRICE}, {file.COST}])
Sum of values in the Amount, Price, and Cost fields. -
Hi,
I am using dbms_sqltune package for sql tuning in 10g. In DBMS_SQLTUNE.CREATE_TUNING_TASK one paramter is bind_list.i want to pass the parameter for sql.suppose two dates.Pls tell me how can i do.
Thanks
ReenaHi, this is what I found in teh documantation:
Table 101-14 CREATE_TUNING_TASK Function Parameters
Parameter Description
sql_text The text of a SQL statement
begin_snap Begin snapshot identifier
end_snap End snapshot identifier
sql_id The identifier of a SQL statement
bind_list An ordered list of bind values in ANYDATA type
plan_hash_value The hash value of the SQL execution plan
sqlset_name The SQL tuning set name
basic_filter The SQL predicate to filter the SQL from the SQL tuning set
object_filter The object filter
rank(i) An order-by clause on the selected SQL
result_percentage A percentage on the sum of a ranking measure
result_limit The top L(imit) SQL from the (filtered/ranked) SQL
user_name The username for whom the statement is to be tuned
scope Tuning scope (limited/comprehensive)
time_limit The maximum duration in seconds for the tuning session
task_name An optional tuning task name
description A task of the SQL tuning session to a maximum of 256 characters
plan_filter Plan filter. It is applicable in case there are multiple plans (plan_hash_value) associated with the same statement. This filter allows for selecting one plan (plan_hash_value) only. Possible values are:
LAST_GENERATED: plan with the most recent timestamp
FIRST_GENERATED: plan with the earliest timestamp, the opposite to LAST_GENERATED
LAST_LOADED: plan with the most recent first_load_time statistics information
FIRST_LOADED: plan with the earliest first_load_time statistics information, the opposite to LAST_LOADED
MAX_ELAPSED_TIME: plan with the maximum elapsed time
MAX_BUFFER_GETS: plan with the maximum buffer gets
MAX_DISK_READS: plan with the maximum disk reads
MAX_DIRECT_WRITES: plan with the maximum direct writes
MAX_OPTIMIZER_COST: plan with the maximum optimizer cost
sqlset_owner The owner of the SQL tuning set, or NULL for the current schema owner
Hope it helps,
Lutz -
How to have total result of CKF use the formula of the CKF
Hello experts, in a couple of BI reports we need that a Calculated Key Figure's total result use its same formula, instead of using the different calculations that are offered for totals. Let me explain:
We have the following report (please ignore the "-"):
Month----Entries---Exits----Percentage
Jan--82--
25%
Feb--63--
50%
Mar--81--
12.5%
Result--226--
Percentage is calculated as "Exits / Entries * 100", or "Exits %A Entries" (in the latter case, the default calculation of total is "average", while in the former it is "sum") and has an exception aggregation of "Average" with reference characteristic "Calendar Month". The problem we have run up with is that we want the result of Percentage calculated the same way, which is somewhat similar to an average. However, the result is always calculated based on the individual results. This gives us different numbers.
Result Percentage = Total Exits %A Total Entries = (6 / 22) * 100 = 27.27% (CORRECT)
Result Percentage = Average of individual Percentages = (25 + 50 + 12.5) / 3 = 29.16% (INCORRECT)
I've tried different approaches, such as changing the reference characteristic and exception aggregation, selecting "average" as the method of calculating results or individual values, checking the "cummulated" and "Also apply to results" checkboxes, etc. but I was unsuccessful.
Any thoughts?I'll post sample data and give a more thorough explanation of both queries (the one that works correctly and the one that does not). Both queries come from the same infocube:
The correct query: it is a monthly report of entries vs exits for all store types but one (called "general" which should not be included here) in a base country (so if base country is, for example, France, then all stores in France). The query structure and sample data (ignore the "-"):
January--February--
Exits--EntriesPercentageExitsEntries--
Percentage
Store type 1--52025%918--
50%
Store type 2--41822.22%320--
15%
Store type 3--125621.43%1360--
21.67%
Total--2194
22.34% -2598--
25.51%
This query is initially restricted by the base country and the store type "general" (so that it is not considered).
The incorrect query: it is a monthly report of entries vs exits for store type "general" ONLY, outside the base country. The query structure and sample data (for ease of analyzing, I am repeating the data in the key figures, changing the store for the calendar month):
Country 1--Country 2--
Exits--EntriesPercentageExitsEntries--
Percentage
January--52025%918--
50%
February--41822.22%320--
15%
March--125621.43%1360--
21.67%
Total--2194
30.33% -2598--
28.89%
This query is initially filtered by the store type "general" and the base country (so that it is not considered).
As you can see, the percentage can change quite a lot. What confuses me is that in both cases I am using the same CKF "Percentage" with "Average" as exception aggregation and "Calendar Month" as Reference Characteristic.
Percentage = Exits %A Entries
When dealing with individual results, everything is ok. It is only when dealing with totals that the query miscalculates, calculating the totals as the "Percentage" average (the sum of individual values / the number of values).
I modified the incorrect query to match the correct query, so that it looked like a copy of it, and the results were calculated correctly. Then, when I modified it again to return it to its original form, the results were calculated incorrectly again.
Any suggestions? Do you think this could be a configuration issue or something like that? -
Calculate/overwrite level 1 data
<p>the following calculation generates the accurate value butdisplays in the wrong cell.</p><p> </p><p>"% Non-Quota entries pre-filed" = ("# ofPre-Filed Non-Quota Entries"->Month01 / "TotalNon-Quota Entries Filed"->Month01) * 100;</p><p> </p><p>in order for it to populate the correct cell i tried doingthis:</p><p> </p><p>"% Non-Quota entries pre-filed"<b>->Month01</b> =("# of Pre-Filed Non-Quota Entries"->Month01 /"Total Non-Quota Entries Filed"->Month01) * 100; </p><p>/* this doesn't work because "% Non-Quotaentries pre-filed"<b>->Month01</b> is an invalid member name.</p><p> </p><p>Month01 is a level 1 member with Week1, Week2, Week3,Week4, rolling up to it. How do I calculate and overwrite</p><p>"% Non-Quota entries pre-filed"<b>->Month01?</b></p><p> </p><p>I also tried including all dimension members by doing this:</p><p>"% Non-Quota entriespre-filed"->Actual->Year2006->GTO<b>->Month01</b>= ...etc</p><p>/* which are all level 0 members except for Month01. */</p><p> </p><p>please advise. thanks in advance.</p><p> </p>
Brent:<BR><BR>Since all the measures you want to use and populate come from the same time period, yoiu can use a FIX statement to accomplish what you want.<BR><BR>/* First FIX on the members of the non-Time dims you want to be populated */<BR><BR>FIX(@LEVMBRS(<i>TimeDimName</i>, 1), Actual, Year2006, GTO)<BR><BR>/* modify the FIX above to change the scope of your calculation */<BR><BR>/* Now do the math. The formula will spin through the Level One members<BR>of the Time dimension one by one, using the same time member for each account<BR>in the formula */<BR><BR>"% Non-Quota entries pre-filed" = "# of Pre-Filed Non-Quota Entries" /<BR>"Total Non-Quota Entries Filed" * 100;<BR><BR>ENDFIX<BR><BR>Beware the fact that rolling up the Time dimension will overwrite the monthly percentage with the sum of its children (weeks), so this formula needs to be executed after that.<BR><BR>Hope this helps.
Maybe you are looking for
-
In struts Can't display dynamic content using "include"?
Hi everyone: I am using struts1.1. I have a index.jsp and it have a hyperlink "<html:link forward="show">Show All forum</html:link>". In my struts-config.xml there is a element:" <global-forwards> <forward name="show" path="/jsp/allarticle.jsp"/> <fo
-
I have downloaded icloud on my Iphone 4, ipad and pc with windows 7 and i am having problems streaming photos. I have everything turned on and i am at home with good wi-fi yet i can't get any of the photos that i take on my phone to stream onto ither
-
Does anybody know we can freeze some columns in Answers the way we do it in excel. Thx
-
LDAP Queries - Load balance - Cache
Hello, i have configured LDAP Queries with Multiple-host-options: "Laod-balance". 2 LDAP hosts are defined in this querie Can anyone tell me what happens if the defined LDAP hosts are not available? Are users cached by Ironport appliance or is there
-
Any Disadvantages to Core Duo iMac Having A 32 Bit Processor?
I have posted this in the iMac Forum with no response. I know a lot of FCE/FCP users have iMacs and plenty of technical knowledge. I have just read the following statement in MacRumors where they were reviewing the Intel iMac:- "Whereas the G5 was a