How to calculate an average of YTD measures?
Hi all,
I'm working on BPC 10 for NW.
We use an account-type dimension for Personnel inventory (Personnel to fixed-term contracts, to permanent contracts, number of executives, staff etc.).
The corresponding ACCTYPE is AST because people are seen as a balance sheet account measure. So the measure, even if we're in periodic in our model, is stored as a YTD value.
I want to calculate a average with those measures, for instance the average number of contractors from january to the current month, with a member formula. I can't manage to do that with a calculation because I can't add values of YTD measures: when I try a formula like ([ACCOUNT].A1 , [MEASURES].[YTD]) it returns the same value as the periodic value. Whereas the formula works with EXP account type.
The formula I'd like to have in the end would be something like that:
iif(isleaf([TIME].currentmember),avg(YTD(),([Measures].[PERIODIC],[ACCOUNT].[G102])),[TIME].currentmember.lastchild),solve_order=5
This formula works in a previous version of BPC (5.1) but not in BPC 10.
Any idea?
Thanks very much,
Sébastien.
Assuming the job always starts at mid-might, you can try something like this:
WITH t AS
(SELECT to_date('01-JUL-2011 07:25:31', 'dd-mon-yyyy hh:mi:ss') AS end_date
FROM dual
UNION
SELECT to_date('02-JUL-2011 07:10:58', 'dd-mon-yyyy hh:mi:ss') AS end_date
FROM dual
UNION
SELECT to_date('01-AUG-2011 07:16:24', 'dd-mon-yyyy hh:mi:ss') AS end_date
FROM dual)
SELECT trunc(end_date, 'mon') AS MONTH,
trunc(end_date, 'mon') + avg(end_date - TRUNC(end_date)) AS AVERAGE_TIME
FROM t
GROUP BY TRUNC(end_date, 'mon');
Similar Messages
-
How to calculate the average inventory in ABAP
Dear All,
Please find the below formula and this formula how to calculate the Average inventory at value.Please let me know the abap base tables and the corresponding fields.
Formula
Inventory Turnover = Cost of Goods Sold (COGS) / Average Inventory at value.
Thanks
Regards,
SaiHi Arivazhagan,
Thanks for your quick response .
The field MBEWH from the table is fulfill the average inventory at value.
For Eg :I want to calculate Inventory Turnover = Cost of Goods Sold (COGS)/
Average Inventory at value.
so shall i take Inventory Turnover = Cost of Goods Sold (COGS)/MBEWH
The above formula will meet my requirement to find the average inventory Turnover.
Thanks
Regards,
Sai -
How to calculate moving average price?
hi,
i need someone to explain to me how to calculate moving average priceHi,
Follow the Link,
Re: moving average price -
How to calculate the previous year YTD balance in profit & loss statement
Dear all,
I would like to seek for advice on how to calculate the previous year YTD (Year to date) balance in profit & loss statement
For example, if I enter May 2009, the YTD value should be a sum up of value from Jan to May.
I have tried the current year YTD could be set in column selection dimension "financial period"
FACT PER( Code = YearFirst(@Per):@Per ) Order By PER.Code Descending
Then, I tried the previous year YTD in another column using
FACT PER( Code = YearFirst(@Per-12):@Per-12 ) Order By PER.Code Descending
But it failed -> Abnormally display three column, while the financial period I enter 200903 in parameter @Per
Would anyone kindly help me on that?
Regards,
Simon ChiuDear Jim,
Thanks for your reply.
However, the problems still cannot be solved.
My expected output is 1 column listing the YTD value from previous year.
I have tried two times using both the Code = YTD(@Per-12) and Code = YearFirst(@Per)-12:@Per respectively. However, the Excel display various column.
I am using Financial Period 200903. In the last three column, it display the data in Financial Period 200901, 200902 and 200903 respectively.
For the current year, the YTD is correct and show 1 column listing the sum of account in the Financial Period 200901, 200902 and 200903
Would you kindly advice the code setting and how to set? Also, how I can access the syntax builder?
Regards,
Simon Chiu -
How to calculate moving average price(MAP) when price variance in IV
Hi All,
My current stock for a material is 39 and MAP is 0.8 GBP.
A purchase order is created for the material for a quantity of 1 at price of 0.8 GBP per unit.
Invoice is posted for the above PO at price of 1.74 GBP.
What will be the new MAP for the material now??How to calculate MAP when there is a price variance in Invoice?
Please suggest ASAP.Hi,
The Procedure for calculating MAP is :-
Case 1 :- PO at different price
If in Material Master your MAP is 0.8GBP & closing stock of 30Nos, value is 24GBP
In PO if the price is 0.9GBP & qty is 10nos, then after Goods Receipt Total Value of the GR i.e. Qty * Price + any other delivery cost will be added to the material stock value. Qty is also updated. New Total Value / New Stock Qty will be MAP.
In this case Qty received 10 & price is 0.9 that means value would be 9GBP.
Total Value becomes 24GBP (Present Stock) + 9GBP (Goods Receipt) = 33GBP
Total Qty becomes 30Nos + 10Nos (Goods Receipt) = 40Nos
MAP becomes = 33GBP / 44Nos = 0.75
Case 2 : Invoice Posting (MIRO) at different price than PO
While doing MIRO is we post at different price system will check whether sufficient stock posted in GR is available. In the above case it is 10Nos,
If it is there, then the above logic as in case 1 will take place
If not available, to the extent of stock availability system will post the different value & adjust MAP & remaining is posted to Price Difference Account.
In your case it would be like this :
1. MAP 0.8 for 30Nos (Value would be 24GBP)
2. Invoice Posting 1.74GBP for 1No. That means value would be 24GBP + 1.74GBP = 25.74GBP
Qty would be 30+1 = 40
MAP = 25.74 / 40 = 0.64GBP
Hope this clarifies your doubt
regards,
JP -
Hey all
This is driving me crazy!
I need to calculate the average of a group of percentages excluding cells listed as '0%'.
Please see screen print below, numbers highlighted need to be averaged, when the table is filled out correctly some will remain '0%' whilst others will have a value, I want the average to be calculated only using numbers with a value greater than '0'.
FYI I am looking for the result to display in 'X2'
Thanks :-)you can use the averageif() function. Here is a simple example to get you started:
In this example the average if() function averages values that are non-zero
C2=AVERAGEIF(A1:E1,"<>0",A1:E1)
this is shorthand for select cell C2, then type (or copy and paste from here) the formula:
=AVERAGEIF(A1:E1,"<>0",A1:E1) -
help..!
I want to calculate average interest rate in discoverer, question describes below:
1. the data have 4 columns, 1 account number, 2 balance, 3.interest rate, 4. product type 1, product type 2
2.average interest rate =
sum (product type1 account bal * rate / sum(product bal)).
a*sum(product bal) is sum every records column 2 according the type of product
b*every record need to calculate using balance to divide sum(product bal) for calculate the rate of the sum(product bal) of type of product
c* sum(b*) is what my answer rate.
3.
I need to display average interest rate in discoverer, and each product have a one average rate according user drill-up or drill-down product dimension.
*product dimension have two level
please tell me how to let every record divide by group sum(product bal)
or tell me how to solve this problem.
thanks!
davidHi David
Try using the AVG analytic function.
Best wishes
Michael -
How to calculate this average cost ?
Hello,
I've been thinking on this for problem for a while, but could not come up with a solution. In excel it is easy to do, but in SQL ?
Tried with analytics but no success.
I need to recalculate the AVG_PRICE when QUANTITY > 0, ie when I buy, else AVG_PRICE = prior AVG_PRICE.
these are the rules:
QTY_ON_HAND is a running total of QUANTITY
TOTAL_COST = AVG_PRICE * QTY_ON_HAND
AVG_PRICE = ( TOTAL_COST (preceding row) + TRADE_AMOUNT (current row) ) / QTY_ON_HAND
Group is FUND_CODE, INSTRUMENT_TYPE, INSTRUMENT_CODE
Order is by TRADE_DATE
the numbers I need are on the last row of the .CSV file
AVG_PRICE = 797.0237644
QTY_ON_HAND = 1'327.137600
TOTAL_COST = 1'057'760.21
Any help is more than welcome
thank you
Claudio
this is the data:
CREATE TABLE t (
"FUND_CODE" NVARCHAR2(3),
"INSTRUMENT_TYPE" NVARCHAR2(4),
"INSTRUMENT_CODE" NVARCHAR2(15),
"TRADE_DATE" TIMESTAMP,
"QUANTITY" NUMBER,
"TRADE_AMOUNT" NUMBER
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('01-10-2007 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 115.2502, -92411.183116);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('05-12-2007 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 318.4801, -336101.285453);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('11-01-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -64.6781, 67647.083502);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('25-01-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 72.5117, -109197.254334);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('01-02-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 87.1223, -123386.870253);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('29-02-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 110.869, -93957.707954);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('06-03-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -55.2563, 49721.994761);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('12-03-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 164.4146, -135834.245667);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('18-03-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -37.6276, 41342.685831);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('27-03-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 159.1288, -112293.21594);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('01-05-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 64.6638, -46458.289084);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('23-05-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 137.3465, -85979.32104);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('04-06-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 156.0562, -86183.26);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('01-07-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -342.5453, 265491.46);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('11-08-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -175.8868, 170185.92);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('26-08-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 143.9074, -124927.73);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('28-10-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -321.3085, 472031.39);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('03-11-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), -85.2822, 73202.14);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('01-12-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 38.1563, -27117.03);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('02-12-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 168.331, -135004.83);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('04-12-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 606.1362, -461853.36);
INSERT INTO t ("FUND_CODE", "INSTRUMENT_TYPE", "INSTRUMENT_CODE", "TRADE_DATE", "QUANTITY", "TRADE_AMOUNT")
VALUES ('CLF', 'ifus', 'CLCX', TO_DATE('10-12-2008 12:00:00 AM','DD-MM-YYYY HH:MI:SS AM'), 67.3483, -47610.26);
COMMIT;
this is the result in .CSV format, so that you can "see it" in a spreadsheet
FUND_CODE;INSTRUMENT_TYPE;INSTRUMENT_CODE;TRADE_DATE;QUANTITY;TRADE_AMOUNT;AVG_PRICE;QTY_ON_HAND;TOTAL_COST
CLF;ifus;CLCX;01.10.07;115.250200 ;-92411.18312;801.831;115.250200 ;92'411.18
CLF;ifus;CLCX;05.12.07;318.480100 ;-336101.2855;987.9698711;433.730300 ;428'512.47
CLF;ifus;CLCX;11.01.08;-64.678100 ;67647.0835;987.9698711;369.052200 ;364'612.45
CLF;ifus;CLCX;25.01.08;72.511700 ;-109197.2543;1073.02637;441.563900 ;473'809.71
CLF;ifus;CLCX;01.02.08;87.122300 ;-123386.8703;1129.586093;528.686200 ;597'196.58
CLF;ifus;CLCX;29.02.08;110.869000 ;-93957.70795;1080.679646;639.555200 ;691'154.29
CLF;ifus;CLCX;06.03.08;-55.256300 ;49721.99476;1080.679646;584.298900 ;631'439.93
CLF;ifus;CLCX;12.03.08;164.414600 ;-135834.2457;1024.790089;748.713500 ;767'274.17
CLF;ifus;CLCX;18.03.08;-37.627600 ;41342.68583;1024.790089;711.085900 ;728'713.78
CLF;ifus;CLCX;27.03.08;159.128800 ;-112293.2159;966.4362121;870.214700 ;841'007.00
CLF;ifus;CLCX;01.05.08;64.663800 ;-46458.28908;949.2840914;934.878500 ;887'465.29
CLF;ifus;CLCX;23.05.08;137.346500 ;-85979.32104;907.8734486;1'072.225000 ;973'444.61
CLF;ifus;CLCX;04.06.08;156.056200 ;-86183.26;862.6915958;1'228.281200 ;1'059'627.87
CLF;ifus;CLCX;01.07.08;-342.545300 ;265491.46;862.6915958;885.735900 ;764'116.92
CLF;ifus;CLCX;11.08.08;-175.886800 ;170185.92;862.6915958;709.849100 ;612'380.85
CLF;ifus;CLCX;26.08.08;143.907400 ;-124927.73;863.605235;853.756500 ;737'308.58;
CLF;ifus;CLCX;28.10.08;-321.308500 ;472031.39;863.605235;532.448000 ;459'824.88;
CLF;ifus;CLCX;03.11.08;-85.282200 ;73202.14;863.605235;447.165800 ;386'174.73;
CLF;ifus;CLCX;01.12.08;38.156300 ;-27117.03;851.582394;485.322100 ;413'291.76;
CLF;ifus;CLCX;02.12.08;168.331000 ;-135004.83;838.8189176;653.653100 ;548'296.59;
CLF;ifus;CLCX;04.12.08;606.136200 ;-461853.36;801.8403917;1'259.789300 ;1'010'149.95;
CLF;ifus;CLCX;10.12.08;67.348300 ;-47610.26;797.0237644;1'327.137600 ;1'057'760.21;this is how the numbers have to be:
fund instr instr trade_date quantity trade_amount avg_price qty_on_hand total_cost
code type code
CLF ifus CLCX 01.10.2007 115.2502 -92'411.1831 801.8310 115.2502 92'411.18
CLF ifus CLCX 05.12.2007 318.4801 -336'101.2855 987.9699 433.7303 428'512.47
CLF ifus CLCX 11.01.2008 -64.6781 67'647.0835 987.9699 369.0522 364'612.45
CLF ifus CLCX 25.01.2008 72.5117 -109'197.2543 1'073.0264 441.5639 473'809.71
CLF ifus CLCX 01.02.2008 87.1223 -123'386.8703 1'129.5861 528.6862 597'196.58
CLF ifus CLCX 29.02.2008 110.869 -93'957.7080 1'080.6796 639.5552 691'154.29
CLF ifus CLCX 06.03.2008 -55.2563 49'721.9948 1'080.6796 584.2989 631'439.93
CLF ifus CLCX 12.03.2008 164.4146 -135'834.2457 1'024.7901 748.7135 767'274.17
CLF ifus CLCX 18.03.2008 -37.6276 41'342.6858 1'024.7901 711.0859 728'713.78
CLF ifus CLCX 27.03.2008 159.1288 -112'293.2159 966.4362 870.2147 841'007.00
CLF ifus CLCX 01.05.2008 64.6638 -46'458.2891 949.2841 934.8785 887'465.29
CLF ifus CLCX 23.05.2008 137.3465 -85'979.3210 907.8734 1'072.2250 973'444.61
CLF ifus CLCX 04.06.2008 156.0562 -86'183.2600 862.6916 1'228.2812 1'059'627.87
CLF ifus CLCX 01.07.2008 -342.5453 265'491.4600 862.6916 885.7359 764'116.92
CLF ifus CLCX 11.08.2008 -175.8868 170'185.9200 862.6916 709.8491 612'380.85
CLF ifus CLCX 26.08.2008 143.9074 -124'927.7300 863.6052 853.7565 737'308.58
CLF ifus CLCX 28.10.2008 -321.3085 472'031.3900 863.6052 532.4480 459'824.88
CLF ifus CLCX 03.11.2008 -85.2822 73'202.1400 863.6052 447.1658 386'174.73
CLF ifus CLCX 01.12.2008 38.1563 -27'117.0300 851.5824 485.3221 413'291.76
CLF ifus CLCX 02.12.2008 168.331 -135'004.8300 838.8189 653.6531 548'296.59
CLF ifus CLCX 04.12.2008 606.1362 -461'853.3600 801.8404 1'259.7893 1'010'149.95
CLF ifus CLCX 10.12.2008 67.3483 -47'610.2600 797.0238 1'327.1376 1'057'760.21As you can see on the 3rd line we have a Sell -64.67, thus we take the previous AVG_PRICE.
Keep in mind that:
AVG_PRICE = (TOTAL_COST preceding row + TRADE_AMOUNT current row) / QTY_ON_HAND is calculated only on Buy QUANTITY > 0
TOTAL_COST = QTY_ON_HAND * AVG_PRICE
this is the output of the query kindly suggested by Alex:
FUND_CODE INSTRUMENT_TYPE INSTRUMENT_CODE TRADE_DATE QUANTITY TRADE_AMOUNT QTY_ON_HAND TOTAL_COST AVG_PRICE
CLF ifus CLCX 01.10.2007 00:00 115.2502 -92411.183116 115.2502 -92411.183116 -801.830999998265
CLF ifus CLCX 05.12.2007 00:00 318.4801 -336101.285453 433.7303 -428512.468569 -987.969871067343
CLF ifus CLCX 11.01.2008 00:00 -64.6781 67647.083502 369.0522 -360865.385067 -987.969871067343
CLF ifus CLCX 25.01.2008 00:00 72.5117 -109197.254334 441.5639 -470062.639401 -1064.54046492705
CLF ifus CLCX 01.02.2008 00:00 87.1223 -123386.870253 528.6862 -593449.509654 -1122.4985816804
CLF ifus CLCX 29.02.2008 00:00 110.869 -93957.707954 639.5552 -687407.217608 -1074.82077795318
CLF ifus CLCX 06.03.2008 00:00 -55.2563 49721.994761 584.2989 -637685.222847 -1074.82077795318
CLF ifus CLCX 12.03.2008 00:00 164.4146 -135834.245667 748.7135 -773519.468514 -1033.13145617649
CLF ifus CLCX 18.03.2008 00:00 -37.6276 41342.685831 711.0859 -732176.782683 -1033.13145617649
CLF ifus CLCX 27.03.2008 00:00 159.1288 -112293.21594 870.2147 -844469.998623 -970.415690085447
CLF ifus CLCX 01.05.2008 00:00 64.6638 -46458.289084 934.8785 -890928.287707 -952.9883163502
CLF ifus CLCX 23.05.2008 00:00 137.3465 -85979.32104 1072.225 -976907.608747 -911.103181465644
CLF ifus CLCX 04.06.2008 00:00 156.0562 -86183.26 1228.2812 -1063090.868747 -865.510982946739
CLF ifus CLCX 01.07.2008 00:00 -342.5453 265491.46 885.7359 -797599.408747 -865.510982946739
CLF ifus CLCX 11.08.2008 00:00 -175.8868 170185.92 709.8491 -627413.488747 -900.493486542659
CLF ifus CLCX 26.08.2008 00:00 143.9074 -124927.73 853.7565 -752341.218747 -881.212873632002
CLF ifus CLCX 28.10.2008 00:00 -321.3085 472031.39 532.448 -280309.828747 -881.212873632002
CLF ifus CLCX 03.11.2008 00:00 -85.2822 73202.14 447.1658 -207107.688747 -526.454843941568
CLF ifus CLCX 01.12.2008 00:00 38.1563 -27117.03 485.3221 -234224.718747 -482.617047002393
CLF ifus CLCX 02.12.2008 00:00 168.331 -135004.83 653.6531 -369229.548747 -564.870798818211
CLF ifus CLCX 04.12.2008 00:00 606.1362 -461853.36 1259.7893 -831082.908747 -659.699926604393
CLF ifus CLCX 10.12.2008 00:00 67.3483 -47610.26 1327.1376 -878693.168747 -662.096506607152 As I said I'll try to elaborate on the idea of Alex, does not mean that I don't need any other help.
ON THE CONTRARY !
Any help is more than welcome.
Sorry again if I am not clear in my posting, this is my first time, have patience please.
thanks again
Claudio -
Calculate NWC (Average for last 4 Month)
Do someone know how to calculate NWC (Average for last 4 Month) using @AVG?FIX ("2002", Jan) "Net Working Capital (Average for last 4 Month)" = @AVG(SKIPMISSING, "Net Working Capital", "2001"->Oct,"2001"->Nov, "2001"->Dec, "2002"->Jan);ENDFIXIn my case, we split the Year and Month Dim in our outline.Can this script work in under our situation???Thanks
Try usingFIX ("2002", Jan) "Net Working Capital (Average for last 4 Month)" = @AVG(SKIPMISSING, "Net Working Capital"->"2001"->Oct,"Net Working Capital"->"2001"->Nov,"Net Working Capital"->"2001"->Dec,"Net Working Capital"->"2002"->Jan); ENDFIX
-
Custom measure to calculate average in YTD model
Hi,
I am working in a YTD model which currently has the standard measures: YTD, QTD and periodic. I now need a new custome measure to calculate the average of the YTD values.
So, if on an account I have the following YTD amounts:
month 1: 10
month 2: 20
month 3: 30
I would need the new measure to give me
month 1: 10
month 2: (10+20)/2 = 15
month 3: (10+20+30)/3 = 20
This will also have to work where a month in the middle has a zero value, for example:
month 1: 10
month 2: 0
month 3: 30
I would need the new measure to give me
month 1: 10
month 2: (10+0)/2 = 5
month 3: (10+0+30)/3 = 13.3333333333
Has anyone done this before and would be willing to share the measure formula use with me?
Thanks,
ArnoldSo I've tried to copy the YTD measure and adjust it
IIF([%ACCOUNTDIM%].PROPERTIES("ACCTYPE")="EXP" OR [%ACCOUNTDIM%].PROPERTIES("ACCTYPE")="AST", 1 ,-1)*(([MEASURES].[SIGNEDDATA],CLOSINGPERIOD([%TIMEDIM%].[%TIMEBASELEVEL%]))/[%TIMEDIM%].CURRENTMEMBER.PROPERTIES("MONTHNUM"))
but that doesn't work, whilst I can see the measure I get no values at all. -
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 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 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 do I calculate the average of ONLY the populated fields?
I'm working on an Adobe form to streamline the process of summarizing course evaluations. To protect the anonymity of the students, instructors with 10 or fewer students are given a typed summary of the evaluation results. On the first half of the evaluation, the students are asked to rate a series of statements from 1-5. Three of these are highlighted on the summary form with the average response.
I've already set up the form with 10 unique boxes for each question and an 11th box which calculates the average. Each field is named according to the question number and the student's "number" (I arbitrarily gave each student a number so that each field would be unique):
i.e. #1. Questionquestionquestion. Q1S1 Q1S2 Q1S3 Q1S4 Q1S5 Q1S6 Q1S7 Q1S8 Q1S9 Q1S10 1AVG
The problem, of course, is that no matter how many students were actually in the class, the AVG field will always be calculated based on a group of 10...which isn't accurate or fair to the instructor. I thought about just changing the form and removing the unused fields from the equation each time I make up a new summary, but the point of creating a form was to make it as quick and easy as possible to bang these things out... Plus, some of my coworkers might be using the form from time to time and I'd have to explain what they have to do and if they don't have Adobe Acrobat then they can't actually make the changes and blah blah blah...it just gets ridiculous really quickly!
So anyway, I tried reading some other posts for similar questions in an attempt to figure out a custom calculation script for myself, but I just couldn't focus on it.
I was hoping someone could explain how to write a custom calculation script that will omit any fields which are left blank... Or, even better...is anyone willing to write it for me? At least just an example of the first guy, cause I could probably figure out how to get all the other ones from there.
Thanks.In formcalc the function Avg will calculate the average of only the fields with a value in them. So you would would put in the calcuate event of the average field:
$ = Avg(Q1S1,Q1S2,Q1S3,Q1S4, etc) -
MDX - How to group results to calculate the average
Hi,
I have the following MDX query which selects total unique visits per day between a range of my choosing:
WITH MEMBER [Measures].[MyAvg] AS
Round( AVG(
EXCEPT([Dim Date].[Day Of Week].Members,
{[Dim Date].[Day Of Week].[All].&[1],[Dim Date].[Day Of Week].[All].&[7],[Dim Date].[Day Of Week].[All].UNKNOWNMEMBER}
), [Measures].[UniqueVisitsDay]
), 2)
SELECT { [Measures].[MyAvg] } ON COLUMNS,
NON EMPTY { [Dim Date].[Year Month Date].[PK Date].&[2013-03-01T00:00:00]:[Dim Date].[Year Month Date].[PK Date].&[2013-03-31T00:00:00] } ON ROWS
FROM
[MyCube];
Which gives me the following results:
01/03/2013 634
02/03/2013 16
03/03/2013 19
04/03/2013 698
05/03/2013 704
06/03/2013 692
07/03/2013 774
08/03/2013 755
09/03/2013 9399
10/03/2013 19990
11/03/2013 775
12/03/2013 835
13/03/2013 868
14/03/2013 900
15/03/2013 844
17/03/2013 19
18/03/2013 248
19/03/2013 920
20/03/2013 958
21/03/2013 1092
22/03/2013 798
23/03/2013 21
24/03/2013 10
25/03/2013 731
26/03/2013 770
27/03/2013 537
28/03/2013 300
29/03/2013 28
30/03/2013 8
31/03/2013 4
What I need to do is get the average of this set of results over the month. I am expecting this answer:
1478.233333 (which is total unique hits - 44347 / total rows - 30)
But when I change my MDX code to this:
WITH MEMBER [Measures].[MyAvg] AS
Round( AVG(
EXCEPT([Dim Date].[Day Of Week].Members,
{[Dim Date].[Day Of Week].[All].&[1],[Dim Date].[Day Of Week].[All].&[7],[Dim Date].[Day Of Week].[All].UNKNOWNMEMBER}
), [Measures].[UniqueVisitsDay]
), 2)
SELECT { [Measures].[MyAvg] } ON COLUMNS,
NON EMPTY { [Dim Date].[Year Month].[Mar 2013]:[Dim Date].[Year Month].[Mar 2013] } ON ROWS
FROM
[MyCube];
I get the following result:
MyAvg
Mar 2013 9868
Actual: 9868
Expected: 1478.233333
What am I doing wrong?
Thanks,
RobHi Rob,
In SQL Server Analysis Serviceswe do not have a measure Average aggregation type. Fortunately, we have Sum and Count, and since Average = Sum / Count, we can build our own Average aggregation when we need one. Here is a blog about how to create a average
measure, please refer to the link below.
Average Aggregation in Analysis Services
Regards,
Charlie Liao
TechNet Community Support
Maybe you are looking for
-
I can't get FaceTime or iMessage to work, i get a message displaying waiting for activation. Also when I make a call the FaceTime icon just says activating
-
Hi, Can you please provide the Std web services available for Purchase order creation and Goods receipt creation? Is any link where i can check for this related information? Thanks Srini
-
MacBook Pro seems frozen during sleep
I just experienced an odd problem with my 6 month old MBP. I left the computer with the lid open and came back 30 minutes later and screen was black, as if it had gone to sleep. However, the sleep light was not pulsing and the computer would not wake
-
I have Windows 7 Professional and I used to be able to move the curser over the Firefox Icon in the taskbar and it would show me a telescoped view of all open tabs, now it just shows the tab that I'm currently viewing. How do I fix this?
-
I have below result from joinin three tables called TEST table i placed the below selection in Cursor ID Grp loc type Sum_Lower_1 sum_upper_1 Sum_qty_3 101 abc x 1 50 200 0 101 abc x 3 0