How to calculate Average No. Of Years
Hi Experts,
I want to show the data of 'Average years spent by employees in a position'.I ahve the following data : Position, Employee, Valid From and Valid to as Characteristics and no key figures. With this data, I need to show something like this :
<u>Position</u> <u>AvgNo.OfYears</u>
Position1 - 5
Position2 - 3.5
The no. of years is calculated by the formula variable using the valid from and To characterisitics for each employee.
I can get the average using aggregation in the result line . But all the employee names appear along with each position.i.e, if there have been 100 employees till date who have completed Position1, all of them will be displayed. I don't want to show the employees but just the position and the Average no. of years.
If i hide the employees, only the text is not displayed -but there will be 100 vacant lines shown against 1 position (i.e, the no of employees).
I am taking all the data from a DSO. I cannot create a new inforobject either due to some restrictions. Kindly help.
Regards,
Rekha
sorry i was away for several days...
did you find a solution? I had really the same issue in the past and had no issues with using multiple formula variables. When you say "it doesn't work" what do you mean?
In the past I have done this:
Material Attribute - Numerator --> Formula var - Num
Material Attribute - Denominator --> Formula var - Denom
Misc Attribute - Anything Numeric --> Formula Var - X
CKF --> (Num/Denom) *(X/X)
without the (X/X) the results would only be accurate if the detail characteristic was displayed in the rows. With X/X the calculation worked at any level.
I did the same logic for different cubes and data types including Sales, Inventory, Production Control, etc
Similar Messages
-
How to calculate Average balance for an account
Hi,
How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ?
I'm using the following query :
SELECT cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6 "Account_XX",
nvl(sum(l.accounted_dr - l.accounted_cr),0) "Balance"
FROM gl_code_combinations cc,
gl_je_lines l
WHERE cc.code_combination_id = l.code_combination_id
AND l.set_of_books_id ='XX'
and code_combination_id = replace it with code combination_id for account_xx
AND l.effective_date <= '31-Jan-12' (january period end ??)
GROUP BY cc.segment1||'-'||cc.segment2||'-'||cc.segment3||'-'||cc.segment4||'-'||cc.segment5||'-'||cc.segment6
There are some discrepancies in "average balance" after end of month (Jan-12)?
How to calculate average balances for a particular account (Account_XX above)from end of month of Jan to first two days of february?
Thanks,
KiranKiran,
Please let me know first, is Average Balancing feature enabled in your GL Ledger?
Regards
Muhammad Ayaz -
How to calculates averages and send to a file?(source code)
how to calculates averages and send to a file?(source code) I need to get started but I don't know where to begin...........the book I have doesn't really say how to handle averages and send to a file.................anybody got suggestions on how to get started? I am a newbie so place in layman's terms.............thanx
To calculate an average: add all of the numbers together and divide by how many numbers you added together.
ex: (1 + 2 + 3 + 10)/4 = 4 (4 is the average)
As for writing them to a file, look over the API for random or sequential access files. -
How to calculate YTD and Last year YTD on Date in Bex
Hi,
I have a requirement in which I need to show the report as following format.
I need to show Year>monthday as Hierarchy. user will drill down on Month to Date.
Del Qty Ord Qty Del Qty LY Del Qty YTD Del Qty L YTD
Year
> Drill Down to Months
Jan
Feb
Mar
---> 1.03.2010
---> 2.03.2010
---> 3.03.2010
Dec
I have Calday, Calmonth, Calyear all three objects.
Now my question is how I can achive this? On which i need to create hierarchy?
and how to calculate the YTD at day level.
Note:- in the selection calyear is mandatory. User wants to display as per year. So What infoobject I need to take in selection?
and the way to calculate YTD on Day (in the case also ,where user doesn't give the date in selection)
Plz reply asap its uregent !!!
Thanks in advance,
AmitHi,
As per my understanding I think YTD means JAN to current date result. I means say if user enter 062005 then result in YTD should be from 012005 to 062005.
And to do this you need to write a customer exit variable where LOW field of internal table you will put JAN year and HIGH will contain month year entered by user.
Hope this will help you.
Suneel -
How to calculate average in result in BEx
Hi Expert,
I have 2 fields one is project and another # of days to finished project (I used formula to calculate the # of days from start to finished date. NOw in result need to calculate average of days took to finished all projects.
I belive formula will be ( # of days / projects) but how we can apply in query. If anyone know please help out I really appericiate.Hi,
Right click on your formula and go to properties, there you have the options as "Calculate Result as" and "calculate single value as" from the drop down box you can select option as "Average".
Regards,
Durgesh. -
How to calculate Average time from a date field
Hi All,
I have a date type field in my table .
I want to calculate average time for a given country in a select query. Date has to be exculded. Only time has to be taken into consideration.
Kindly help me.
Sample data
india 25-JUN-09 08:12:45
india 25-JUN-09 09:01:12Take which one you want.WITH dates AS
(SELECT sysdate x FROM dual
UNION
SELECT sysdate + 1 +1/24 FROM dual
SELECT TO_CHAR(to_date(AVG(to_number(TO_CHAR(to_date(TO_CHAR(x,'HH24:MI:SS'),'HH24:MI:SS'),'sssss'))),'sssss'),'hh24:mi:ss')
FROM dates;
WITH dates AS
(SELECT sysdate x FROM dual
UNION
SELECT sysdate + 1 +1/24 FROM dual
SELECT floor(24 * AVG(x- TRUNC(x)))
|| ':'
|| floor(mod(24 * AVG(x- TRUNC(x)),1) * 60)
|| ':'
|| floor(mod(mod(24 * AVG(x- TRUNC(x)),1) * 60,1) * 60)
FROM dates;By
Vamsi -
How to calculate average if some of measure values are 0
Hi
I created a webI report on top of a Bex query, I have a more than 10 different measure in WebI report column on which i need to calculate average.
If I use the Average function provided with in WebI report it is calculating average for the measures which are having 0 values too, but i need to calculate average on a column only for those values which are not 0
Ex: Measure Quantity has values in the report like
100
100
0
100
100
Average function is calculating as 400/5
but I need 400/4, because one of the value is 0, so i need to avoid that count which is zero and should divide it by 4 but not 5.
One way is to custom create measure for all measures and make a if else condition and divided by that custom measure, but is there any other procedure?i hope this can help
=Average([myMeasure]) Where ([myMesyre] <> 0)
good luck
Amr
before the 0 add <> not Equal too sign < and >
Edited by: Amr Salem on Jan 19, 2011 9:29 AM
Edited by: Amr Salem on Jan 19, 2011 9:30 AM -
How to calculate average not through basic formula
Can any bodytell me how to calculate averge of 96 rows in the quey designer not by hard coding them.
Is there any formula for creating it through formula or through calculations .
And also how to calculate the maximum value and minimum value of the entire 96 rows which is picking from a Z table -ZDC_2100.
Iam having time blocks of 96 for 24 hrs each of 15Min.Hi,
You can achieve using a counter at baselevel and use exception aggregation at query level...
Also check the below links might be useful:
http://help.sap.com/saphelp_nw04/helpdata/en/75/21054da1392649948e5b94e4fc4bce/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/d2/e0173f5ff48443e10000000a114084/frameset.htm
Hope this helps.......
Rgs,
I.Ravikanth -
How to calculate Average of Keyfigure
Hi Gurus,
I have a requirement where I have to calculate average of key figure value for 1 material.
I tried using 'Average' in exception Aggregation but it just sums up everything.
Can anyone please explain?
ThanksHi
1. Include the key figure you want to average into the columns; call it KF1
2. Create a Formula; call it CTR1, and in the detail view put a 1. (This 1-value is not used except to avoid an error in the formula syntax checker.) On the Aggregation tab, choose Exception Aggregation: Counter for all Detailed Values, and for the Ref. Characteristic, choose the same characteristic as the lowest level characteristic in the initial view of the output. E.g. if you only have 0CALMONTH in the output, choose 0CALMONTH. When you run this, the total at the bottom of this column should be equal to the number of rows in that column. Note that we use Exception Aggregation here so that the total at the bottom is calculated before the output is generated and is available to other formulas in the query design; if we were to use the Calculation tab it would look the same to us in that the total would appear at the bottom, but the calculation would occur too late for us to use within the query.
3. Create a second formula, call it AVG1. The formula will be:
SUMGT KF1 / SUMGT CTR1
SUMGT accesses the Overall Result value at the bottom of the KF1 and CTR1 columns. You can find the SUMGT function in the Data Functions folder - turn on technical names first; the description is Overall Result. You could instead use SUMRT; the difference is that SUMGT will use the filters applied in the filter block; SUMRT will ignore them.
3. Run the query. You should see the Average in every cell in the Average column. You can use this formula as input to another formula, or just use ( SUMGT KF1 / SUMGT CTR1 ) within a formula to access the average value.
Thanks -
How to calculate averages and send to a file?(source code)
Having trouble the book isn't very clear on how to use averages.............could some give me an example of a program..................that gets averages and send to a file..........?
From Deitel and Deitels monster 'How to Program' :
import javax.swing.JOptionPane;
public class Average {
public static void main ( String args[] )
int total, gradeCounter, gradeValue, average;
Swing grade;
total = 0;
gradeCounter = 1;
while ( gradeCounter <= 10 ) { //assuming 10 values
grade = JOption.showInputDialog ( "Enter grade: " ) ;
gradeValue = Integer.parseInt ( grade );
total += gradeValue;
gradeCounter = gradeCounter + 1;
average = total / 10;
JOptionPane.showMessageDialog (
null, "Class Average is" + average, "Class Average",
JOptionPane.INFORMATIOIN_MESSAGE );
System.exit ( 0 );
Import package java.io
Three stream objects are created when you execute , System.in, System.out, System.err
System.out can be directed to send it's output to a file or disk. -
Hi,
I have a calc that is supposed to calculate the average but I dont know how to do it.
Time prompt: enabled to take X number of months.
$$: a certain amount of $$ corresponds to each month taken by the prompt
Example: 8 months (Jan to Aug), $100 each = 800 / 8 = 100
3 months (Jan to March), $100 each = 300 / 3 = 100
The final amount (average) has to be posted to all the months of the next year.
The issue is how to tell BPC the number by which the sum is going to be divided because it varies depending on the months taken.
Thanx, i'll post my script here.
I also have a prompt for the category (version) which may be Real, Budget, etc...
*SELECT(%vapi%,"id","conceptos","vap='i'")
*WHEN conceptos
*IS %vapi%
*WHEN metrica
*IS hojas_r,metros_r,precio_r
*WHEN tiempo
*IS %tiempo_set%
*WHEN versiones
*IS Real_2011
*FOR %anio%=2012
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2012")
*NEXT
*NEXT
*IS Real_2012
*FOR %anio%=2013
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2013")
*NEXT
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT
Thanx
VelázquezHi Karthik,
Thanx for the reply, I changed the following:
PROMPT(RADIOBUTTON,%MESES%,"seleccionar meses a promediar",1,{"1 mes"," 2 meses"," 3 meses"," 5 meses"},{"1","2","3","5"})
TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%TestAlldoraVentas2.lgf)
TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION VIGENCIA=%MESES%")
(this one above is important)
I know that Run_Stored_Procedure is not supposed to coexist with WHEN/ENDWHEN structures... however, I still posted it in my script logic, therefore I got this error:
TOTAL STEPS 1
1. Execute formulas: Failed in 1 sec.
2. FX Restatement: completed in 1 sec.
CHECKLCK= No
MESES=5
(Member Selection)
TIEMPO: 2011.ENE,2011.FEB,2011.MAR
Execute formulasError
error running stored procedure PROMEDIO 5: Could not find stored procedure 'PROMEDIO'.
Please help me out...
I also tried adding %tiempo_set% to the R_S_P but still doesnt work...
Script:
*SELECT(%vapi%,"id","conceptos","vap='i'")
*SELECT(%vapc%,"id","conceptos","vap='c'")
*SELECT(%vape%,"id","conceptos","vap='e'")
*SELECT(%toner%,"id","consumibles","tipo='T'")
*SELECT(%drum%,"id","consumibles","tipo='D'")
*SELECT(%fusor%,"id","consumibles","tipo='F'")
*SELECT(%otros%,"id","consumibles","tipo='O'")
*XDIM_MEMBERSET conceptos=%vapi%,%vapc%,%vape%
*XDIM_MEMBERSET consumibles=consumibles_dummy,%toner%,%fusor%,%drum%,%otros%
*XDIM_MEMBERSET lob=servicios_out
*XDIM_MEMBERSET metrica=precio_r,pieza_r,hojas_r,metros_r
*XDIM_MEMBERSET moneda=usd,mxn
*XDIM_MEMBERSET oi <> oi_dummy
*XDIM_MEMBERSET vendedor = 01,02,03,04,05
*RUN_STORED_PROCEDURE=promedio(VIGENCIA)
*COMMIT
*WHEN conceptos
*IS %vapi%
*WHEN metrica
*IS hojas_r,metros_r,precio_r
*WHEN tiempo
*IS %tiempo_set%
*WHEN versiones
*IS Real_2011
*FOR %anio%=2012
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value% / %meses%, tiempo=%anio%.%mes%,versiones="esperado_2012")
*NEXT
*NEXT
*IS Real_2012
*FOR %anio%=2013
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2013")
*NEXT
*NEXT
*IS Real_2013
*FOR %anio%=2014
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2014")
*NEXT
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT
Thanx
Velázquez -
Hello Good Evening,
Could you please help me here
how to write condition for self table year records, such 2012 name and acctno match with 2013 name and acctno then total, provided below,
create table #tab1 (MasterKey int, AcctNo varchar(12),name varchar(25), SumaofShares numeric, request_dat datetime )
--drop table #tab1
insert into #tab1 values (1000, 100,'Tom', 2500, '10/01/2012')
insert into #tab1 values (1001, 101,'Bat', 1550, '08/11/2012')
insert into #tab1 values (1002, 102,'Kit', 1600, '06/12/2012')
insert into #tab1 values (1003, 103,'Vat', 1750, '04/15/2012')
insert into #tab1 values (1010, 104,'Sim',200, '04/21/2013')
insert into #tab1 values (1011, 105,'Tim',500, '06/18/2013')
insert into #tab1 values (1012, 100,'Tom',800, '08/22/2013')
insert into #tab1 values (1013, 101,'Bat',550, '09/15/2013')
insert into #tab1 values (1014, 100,'Pet',200, '02/21/2013')
insert into #tab1 values (1015, 103,'Vat',150, '03/18/2013')
insert into #tab1 values (1016, 110,'Sun',800, '03/22/2013')
insert into #tab1 values (1017, 111,'Bet',550, '12/15/2013')
insert into #tab1 values (9999, 111,'AAA',110, '12/15/2014')
create table #tab2 (IssueKey int, totalOutstanding numeric, sharedBenefits varchar(1) )
--drop table #tab2
insert into #tab1 values (1000, 500, 'V')
insert into #tab1 values (1001, 150, 'U')
insert into #tab1 values (1002, 100, 'N')
insert into #tab1 values (1003, 170, 'U')
insert into #tab1 values (1010, 100, 'U')
insert into #tab1 values (1011, 200, 'K')
insert into #tab1 values (1012, 340, 'U')
insert into #tab1 values (1013, 560, 'N')
insert into #tab1 values (1014, 280, 'V')
insert into #tab1 values (1015, 150, 'V')
insert into #tab1 values (1016, 840, 'V')
insert into #tab1 values (1017, 530, 'N')
i would like to get 4 columns output
how to get sumofshares (#tab1) and TotalOutStanding(#tab2) summ up with these values please.,
MasterKey (#tab1) and IssueKey (#tab2) are like primary key and foreign key
so the request is
need to calculate, sumofshares (#tab1) and TotalOutStanding(#tab2) as below
1)ShareBenefist = U and year( request_dat) in (2012 , 2103) and (Name for 2012 should match with 2013 name and 2012 Acctno should match with 2013 accounno) in (#tab1)
then '2012 and 2013 accts UN Veriverted'
2)ShareBenefist = V and year( request_dat) in (2012 , 2103) and (Name for 2012 should match with 2013 name and 2012 Acctno should match with 2013 accounno) in (#tab1)
then '2012 and 2013 accts Veriverted'
3)ShareBenefist = N and year( request_dat) in (2012 , 2103) and (Name for 2012 should match with 2013 name and 2012 Acctno should match with 2013 accounno) in (#tab1)
then '2012 and 2013 accts NONVERT'
4)year( request_dat) =2102 and Name and Acctno not match with 2013 account name and acctno (#tab1)
then '2012 last year accounts'
5)year( request_dat) = 2013 and Name and Acctno not match with 2013 account name and acctno (#tab1)
then '2012 This year accounts'
for ex 1) the below accounts in #tab1 has both 2012 and 2013 and acctno same in both years and name is same in both years so it is condired as
insert into #tab1 values (1012, 100,'Tom',800, '08/22/2013')
for ex 2)
insert into #tab1 values (1013, 101,'Bat',550, '09/15/2013')
for ex 4) 2012 records there is not match acctno and name in 2013 recods
insert into #tab1 values (1002, 102,'Kit', 1600, '06/12/2012')
for ex 5) 2013 records there is no match of name and acct no with 2012 records
insert into #tab1 values (1010, 104,'Sim',200, '04/21/2013')
insert into #tab1 values (1014, 100,'Pet',200, '02/21/2013')
insert into #tab1 values (1016, 110,'Sun',800, '03/22/2013')
insert into #tab1 values (1017, 111,'Bet',550, '12/15/2013')
Expected Results (just for format)
AcctTypeDescription, SumofShares, OtotalutStand
'2012 and 2013 accts UN Veriverted',2700,234
'2012 and 2013 accts Veriverted' ,2890,234
'2012 and 2013 accts NONVERT' ,4533,325
'2012 last year accounts' ,2334,567
'2012 This year accounts' ,2222,877
Please
Thank youy in advance
asitaAs I understand it, your sample output was only to show the format, and did not pretend to be give the exact result given the sample data. This is pity, because means that I was not able to verify that my query below gives the desired result.
The exact relation between #tab1 and #tab2 is not clear to me. I'm making the assumption that a row in #tab1 may have zero or one row in #tab2, but not many.
My solution has two CTEs. The first simply joins the tables together and extracts the year. In the second CTE, I perform a self-join over the first CTE which I have divided in two by year. This is a full join, since an account may appear for only one of
the year. Note that it is instrumental to extract the year data in inner queries first.
The final query is just an aggregation over the categories.
create table #tab1 (MasterKey int, AcctNo varchar(12),name varchar(25), SumaofShares numeric, request_dat datetime )
--drop table #tab1
insert into #tab1 values (1000, 100,'Tom', 2500, '10/01/2012')
insert into #tab1 values (1001, 101,'Bat', 1550, '08/11/2012')
insert into #tab1 values (1002, 102,'Kit', 1600, '06/12/2012')
insert into #tab1 values (1003, 103,'Vat', 1750, '04/15/2012')
insert into #tab1 values (1010, 104,'Sim',200, '04/21/2013')
insert into #tab1 values (1011, 105,'Tim',500, '06/18/2013')
insert into #tab1 values (1012, 100,'Tom',800, '08/22/2013')
insert into #tab1 values (1013, 101,'Bat',550, '09/15/2013')
insert into #tab1 values (1014, 100,'Pet',200, '02/21/2013')
insert into #tab1 values (1015, 103,'Vat',150, '03/18/2013')
insert into #tab1 values (1016, 110,'Sun',800, '03/22/2013')
insert into #tab1 values (1017, 111,'Bet',550, '12/15/2013')
insert into #tab1 values (9999, 111,'AAA',110, '12/15/2014')
create table #tab2 (IssueKey int, totalOutstanding numeric, sharedBenefits varchar(1) )
--drop table #tab2
insert into #tab2 values (1000, 500, 'V')
insert into #tab2 values (1001, 150, 'U')
insert into #tab2 values (1002, 100, 'N')
insert into #tab2 values (1003, 170, 'U')
insert into #tab2 values (1010, 100, 'U')
insert into #tab2 values (1011, 200, 'K')
insert into #tab2 values (1012, 340, 'U')
insert into #tab2 values (1013, 560, 'N')
insert into #tab2 values (1014, 280, 'V')
insert into #tab2 values (1015, 150, 'V')
insert into #tab2 values (1016, 840, 'V')
insert into #tab2 values (1017, 530, 'N')
go
WITH joined AS (
SELECT a.MasterKey, a.AcctNo, a.name, a.SumaofShares,
year(a.request_dat) AS year, b.totalOutstanding, b.sharedBenefits
FROM #tab1 a
LEFT JOIN #tab2 b ON a.MasterKey = b.IssueKey
), categories (category, sumofshares, totaloutstanding) AS (
SELECT CASE WHEN A.MasterKey IS NOT NULL AND
B.MasterKey IS NOT NULL
THEN '2012 and 2013 accts ' +
CASE B.sharedBenefits
WHEN 'U' THEN 'UN Veriverted'
WHEN 'V' THEN 'Veriverted'
WHEN 'N' THEN 'NONVERTED'
ELSE ''
END
WHEN A.MasterKey IS NOT NULL THEN '2012 last year accounts'
WHEN B.MasterKey IS NOT NULL THEN '2013 this year accounts'
END,
coalesce(A.SumaofShares, 0) + coalesce(B.SumaofShares, 0),
coalesce(A.totalOutstanding, 0) + coalesce(B.totalOutstanding, 0)
FROM (SELECT * FROM joined WHERE year = 2012) AS A
FULL JOIN (SELECT * FROM joined WHERE year = 2013) AS B
ON A.AcctNo = B.AcctNo
AND A.name = B.name
SELECT category, SUM(sumofshares) AS sumofshares,
SUM(totaloutstanding) AS totaloutstanding
FROM categories
GROUP BY category
go
drop table #tab1, #tab2
Erland Sommarskog, SQL Server MVP, [email protected] -
How to calculate average value?
Hi all,
I'm using Lumira 1.15. I'm doing some practices with the sample dataset BestRunCorp... I want to calculate the average value of gross margin which is grouped by lines so that I can use a line chart to show the difference between the gross margin value and average value.
How can I achieve this ?
Best regards,
ShuangIt looks like it calculates the average based on the dimension
See below:
If you take the "Best run" Excel file, sort by country, calculate the average in Excel, it matches Lumira's 4,056 (for Argentina)
I am not sure I follow your divide by 12 logic? -
I have created and deploy this cube but needed to know how I can show the average of the survey result.
Where I need to calculate the number of 'yes' and 'no' or even if possible "no answers" of every distinct survey question. My most Significant table is the" valuefield" who is part of the fact table and has "yes" and "no"
or null info. Am using MS Visual Studio and SQL SERVER Just a sample of 10 survey questions.
ANY GEEK OUT THERE?Hi G33km,
According to your description, you want to calculate the numbers of survey which is "YES" or "NO", right? In this case, create a calculated measure, in that measure using
Filter function to return the set that results from filtering a specified set based on a search condition (in your scenario is that survey is "YES" or "NO"). And then use the
Count function to return the numbers of survey.
Besides, here is a blog about Optimizing Count(Filter(...)) expressions in MDX, please see:
Optimizing Count(Filter(...)) expressions in MDX
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support -
How to calculate Average using Dimension Formulas or Default Logic
Hello
I am trying to calculate the average without success. Do you know how I can Achieve the following? :
We have multiple u201Cofficesu201D in the ENTITY dimension that fall under a Region. Let´s say 400+ offices under 20 Regions
For example:
Region1
Office A
Office B
Region2
Office C
Office D
Office E
We have an Account named 'SalesUnits', and I am looking to get an Average Sales by Region and then be able to compare one Office against the Average of the REGION it belongs to.
So If I have:
Sales Units
Office C 20
Office D 10
Office E 15
Average of Region 2 would be 201015/3 =15
But the number of office is variable, Sometimes I can have more offices.
So I will have to count the number of offices that belongs to that region.
I need this average so every office can compare their sales against the Region Average.
Do you know how I can do this? I have tried some MDX syntax but without sucess.
Thanks in advance!
AnnaHi Anna,
This will need to be done in Dimension logic as I assume, you;'d like to have the average up the region heirarchy.
I'd suggest having 3 accounts for this
ID .....................................FORMULA
SALES_UNITS...................
OFFICE_COUNT.................1
UNITS_AVEREAGE............SALES_UNITS/OFFICE_COUNT
The formula bit, goes in the formula column. When look at office count against the region heirarchy, it will sum up the 1's thereby giving you the denominator for the formula and you'll get the avereage up the region heirarchy.
Tim
Maybe you are looking for
-
Is there a way to prevent accidentally deleting pictures?
I am wondering if there is any sort of safety setting to keep from having my photos accidentally deleted? My grandson likes to look at the pictures, but I am worried that he will swipe the trash can and then delete the pictures before I can stop him
-
Voided check is being created after automatic run F110
Hi, I have this problem: I run the auctomatic payments F110, everything works fine, but the check is comming out voided. I redid it three times, same story. The postings are all correct, the items get cleated at the vendor accounts, just the checks a
-
How can I reinstall numbers? When I attempt to open a numbers file it says I need a newer version of numbers. Yet, when I enter the APP store it says Numbers is installed and I cannot do anything. How can I fix this?
-
ITunes needs to close when I sync.
So after needing to format my iPod twice in two days, once after resyncing everything back on to it, now the ridiculous program is closing every time that I try to sync it. No music is appearing on my iPod, and it has been like this for the past two
-
I need to cancel the previous game purchase that is not uploaded yet.
My niece plated games in my IPAD2 and accidentally purchase coins in the games but not continue since my credit card security # not entered. Now everytime I downloded free games it keeps on asking to provide the security key in order to continue the