Calcscript for period to date
Hi
Can any one help in writing a calc script that is close to period to date function.
I need a script that gives period to date functionality but its going to be like this
Jan = jan
Feb= jan+ Feb
June= Jan+feb+mar+apr+may+june
July =July
Aug = July+Aug
Sep=July+Aug+Sep
Dec=july+aug+sep+Oct+Nov+Dec. Means it is like HalfYear_to_Date ....
Is there any simple function or a simple way to achieve this. We are on Essbase 7 , BSO cube.
Thanks
M.N
To do this, you will need to use two pretty cool calculation functions: @CURRMBRRANGE and @SUMRANGE. The first will provide a dynamic member range to the calculation engine based on the position of the current member, and the second will add all of the values together.
Here's the syntax for the range function: *@CURRMBRRANGE (dimName, GEN, genLevNum, {startOffset}, {endOffset})*
We need to use the {startOffset} parameter to specify the first member in that level, so here's what it would look like:
@CURRMBRRANGE("Time", LEV, 0, )
(yes, that last comma needs to be there and we're simply passing a null value into the argument)
Now that we have the range, the sum syntax is: *@SUMRANGE (mbrName {, XrangeList})*
It gets a little tricky here because you may not know what to put into mbrName, but just put any account in there:
@SUMRANGE("Sales", @CURRMBRRANGE("Time", LEV, 0, ))
Also look into Dynamic Time Series as it's a great solution that's also out of the box. It's still nice to know how to do it manually :)
Similar Messages
-
Extracting data with zero values for periods without data
Hello Together,
i extracted data from our hfm application from period 1 to 3.
Now i found that some rows begin with period 2 or 3 because there are no data in period 1 or 2.
So my question is, how i can get zero values for periods with no data.
Hope someone can help me.
Many thanks in advance.
Martin
P.S.: Our actual hfm version is 11.1.1.3
editFor the periods with no data, HFM does not have a "0" to offer for the data extraction. Since the default data extract from HFM has each period on it's own row in the *.dat file, I don't understand your comment about rows starting with period 2 or 3. In the *.dat file the row for period 1 simply won't exist. Are you using a custom approach/tool for data extraction?
The only time HFM will offer a "0" where there is indeed no data, is if you extract derived data. You must include calculated data, and even then I believe HFM will only extract a "0" for the first period after a period where there was data, and only for flow accounts (Revenue/Expense). so if you have "100" in period 1, and no data in period 2, such that the derived value YTD for period 2 is "0", then you must include calculated values in the extract and you should see "0" for period 2. However, I don't believe HFM will extract "0" for period 3 - instead it will be blank/missing.
In general it could be very dangerous to force HFM to give zeros where there is no data.
--Chris -
Pay day for period end date as mid month.
Hi All,
plz suggest how to proceed.
Payroll period starts from 15th of month to 14th of next month and payday is last working day of month having period end day.
Example
Period start day 15th April
Period end day 14th May
Pay day last working day or last day of May for period 15th April to 14th May.Hi,
I think what you are meeting with is Monthly End Accrual (MEA) senario.
Pls check the following URL in PY US solutions:
http://help.sap.com/saphelp_46C/helpdata/EN/d8/c9e93401bdee06e10000009b38f83b/frameset.htm
The related node is under :
Payroll United States (PY-US)->Final Payroll Processing (PY-US-FP)-> Month-End Accruals Concept
Br,Kee -
Making Period Start Date read-only on Appraisal page
Hi,
I have a requirement to default Appraisal Period Start Date and Period End Date and make these fields non-editable. I am able to default the values for these fields by extending CO. When I make these fields read-only and performs any operation on page, getting error
+'You must enter a value for Period Start Date as criteria for the List Of Values.'+
Please suggest a solution to resolve this error.
Thanks.
Edited by: user12037955 on May 12, 2011 9:26 PMpublic void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
java.util.Date dateValue1 = null;
java.util.Date dateValue2 = null;
java.util.Date date = null;
OAApplicationModule oaapplicationmodule = pageContext.getApplicationModule(webBean);
OAMessageDateFieldBean bean1=(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("StartDate");
OAMessageDateFieldBean bean2=(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("EndDate");
String startDate=bean1.getText(pageContext);
String endDate=bean2.getText(pageContext);
String strDate1=null;
String strDate2=null;
if((startDate==null||startDate.equals(""))&& (endDate==null||endDate.equals("")))
date=pageContext.getCurrentDBDate();
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd");
String dateValue=simpledateformat.format(date);
String year=dateValue.substring(0,4);
try
String sqlStatement = "";
CallableStatement cs = null;
// OAApplicationModule oaapplicationmodule = pageContext.getApplicationModule(webBean);
OADBTransactionImpl txn = (OADBTransactionImpl)oaapplicationmodule.getOADBTransaction();
cs = txn.createCallableStatement(" ",1);
sqlStatement = "SELECT to_char(to_date(ffv.attribute1,'RRRR/MM/DD HH24:MI:SS'),'DD-MON-YYYY') attribute1, " +
" to_char(to_date(ffv.attribute2,'RRRR/MM/DD HH24:MI:SS'),'DD-MON-YYYY') attribute2 " +
" FROM apps.fnd_flex_value_sets ffvs,apps.fnd_flex_values ffv " +
" WHERE ffv.flex_value_set_id = ffvs.flex_value_set_id " +
" AND ffvs.flex_value_set_name = 'XXX_PMP_Fiscal_Date_VS' " +
" AND (SYSDATE BETWEEN NVL(ffv.start_date_active,SYSDATE) AND NVL(ffv.end_date_active,SYSDATE)) " +
" AND flex_value= " + year +
" AND ffv.enabled_flag = 'Y' ";
ResultSet rset = cs.executeQuery(sqlStatement);
if (rset.next())
strDate1 = rset.getString(1);
strDate2= rset.getString(2);
catch(Exception e)
throw new OAException("Error:" + e.toString(), OAException.ERROR ) ;
SimpleDateFormat convertFormat = new SimpleDateFormat("dd-MMM-yyyy");
if(strDate1!= null || strDate2!=null)
try
dateValue1 = convertFormat.parse(strDate1.toString());
dateValue2 = convertFormat.parse(strDate2.toString());
catch(Exception exception)
bean1.setValue(pageContext,dateValue1);
bean2.setValue(pageContext,dateValue2);
bean1.setReadOnly(true);
bean2.setReadOnly(true);
} -
How to get start date of the period for a given date from cube
I have a situation where i need to find the start day of the period for a given date. is there a way to know that. i want to use that in my report. i enter the date from my report(i have date parameter), depends on the date, i want to display the start day
of the period. how can i write expression for that in my report?
ramHi ramprasad74,
According to your description, you are using Analysis Services as a data source for the report, the cube has hierarchy: Fyear, FQuarter, FPeriod, fweek, Fdate. You want to add a date parameter to the report, after you changed value of the parameter, the
report will return the first day of FPeriod.
To achieve your goal, we need to add a parameter to the report, then use the parameter in mdx query. For detail information, please refer to the following steps:
In the Report Data pane, right-click on a dataset created from a SQL Server Analysis Services data source type, and then click Query. The MDX query designer opens in Design mode.
On the toolbar, click Design to toggle to Query mode.
On the MDX query designer toolbar, click Query Parameters symbol. The Query Parameters dialog box opens.
In the Parameter column, click <Enter Parameter>, and then type the name of a parameter.
In the Dimension column, choose a value from the drop-down list.
In the Hierarchy column, choose a value from the drop-down list.
In the Default column, from the drop-down list, select a single value.
Click OK.
In query designer dialog box, type the mdx query like below:
with member [Measures].[FirstChild]
as
[Date].[Fiscal].currentmember.parent.firstchild.name
select {[Measures].[FirstChild]} on 0,
[Date].[Fiscal].[Date].members on 1
from
( SELECT ( STRTOSET(@ParameterName, CONSTRAINED) ) on 0
from
[Cube]
Here are relevant threads you can reference:
https://social.msdn.microsoft.com/forums/sqlserver/en-US/c7146ac3-40ea-4d53-b321-c707aebbd405/how-to-pass-date-parameter-to-mdx-query
https://social.msdn.microsoft.com/forums/sqlserver/en-US/fd12a865-bc90-4a65-af42-ce38a8cfa29b/pass-date-time-parameter-to-mdx-query-ssrs
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
If you have any feedback on our support, please click
here. -
Oracle (SQL) support for Temporal / time period based data
Beyond standard SQL (DATE type etc. and <,>, LEAST, GREATEST, etc.) does Oracle offer anything to help handle time period based data? E.g. overlapping periods, joins when gaps in time periods from 2+ tables, period contiguity checks, etc. I've developed various SQL query techniques, but they're all rather cumbersome using standard SQL.
Oracle Spatial offers geo-location support - is there anything similar for temporal query support?
Any good books / docs on the subject?Check out Workspace manager for limited out of the box temporal support.
You may also want to have a read through this series of articles about temporal database systems. They aren't Oracle specific, but may help you with your temporal system design. -
Posting in prv period for actual GI date
Hi,
I want to post a outbound delivery in the prv period as 31.12.2009 so that I can make GR in prv period posting date as 31.12.2009. ofcourse the period is open for Dec'09 and Jan'10 . I tried by changing date in field actual GI in vl02n and saved the delivery , but system takes todays date as posting date. That is system allows posting date for the month of Jan'10 while GR . Is there any method by means I can get this changes saved and take entry in GR.
Thanks & Best Regards,
AKIn my system it accepts 31/12/2009 in actual GI date , when I checked up the material document & account document for this perticular OBD under document flow , I get posting date as 08.01.2010 and the posting period as 10 and 2009 generated internally. That's why I get ERROR like "MARC-VMTRA exceeded by 16.090 MT" if I take posting date 31.12.2009 in GR, where as for posting date 01.10.2010-08.01.2010 does not show any error. This is my assumption.
Will pl check in your system the document flow -> material document & account document posting date for OBD.
Thanks & Regards,
AK -
Auto TECO Orders for which finished date has been reached-Periodic Job
Dear PP GURUS N EXPERTS,
My company want to TECO all the production order automatically for which finished date has been reached or (Finish date is before current date).
On SDN, I have found that it can be carried our by scheduling the variant of PPIO_ENTRY or COHV. and it will be a periodic job.
I want to know that for this which parameters I have to select and where / how I mention that order finish date has been reached. Since it will be a periodic job.
Early response will be highly appreciated.
With thanks,
DSCDear DSC
You can use tranaction code CO44, define a variant for periodic job.
Important selection parameters :
Status selection profile : define which kind of production orders you want to set TECO indicator, for example with status CNF or DLV.
Basic finish date : define basic finish date, for example if you want to TECO the production orders whose basic finish date is less than or equal current date, when you create the variant, selection variable can be D ( D: Dynamic date calculation ), name of variable can be "current date"
Actions : please select the indicator "complete Technically".
You can have a try, please let me know the result.
Qiu -
Just downloaded the 7.1.1 IOS update and I'm able to stream my music from the cloud. I'm wondering how I can stream more than just my purchased music?And does this use up data? Also, how can I get playback to stop pausing for periods of time? It is a wifi thing??
If streaming music when connected to your carrier's cellular network, it uses cellular data.
Only the music you purchased from the iTunes Store can be streamed unless you have purchased iTunes Match.
If there is a slow down at the server where the music is stored or high traffic, steaming can be paused. You can also download a song from the iTunes Store cloud to your iPhone so it doesn't need to be steamed. -
ERPI Error during Export data to GL for period 2012
Hi, experts
When I write back data from Planning to EBS, I encounter the following error during Export data to GL for period 2012. I have confirmed that Planning data has been upload to ERPI.
Do you have any hints on this error for me? Thanks a lot.
Log:
,COALESCE(ppa.YEARTARGET, pp.YEARTARGET) YEARTARGET
,CASE
WHEN (INSTR(UPPER(wld.TEMP_COLUMN_NAME),'AMOUNT',1) = 1) THEN
CAST(SUBSTR(wld.TEMP_COLUMN_NAME,7,LENGTH(wld.TEMP_COLUMN_NAME)) AS NUMERIC(15,0))
ELSE 0
END ENTITY_NAME_ORDER
FROM (
AIF_WRITEBACK_LOAD_DTLS wld
LEFT OUTER JOIN TPOVPERIODADAPTOR_FLAT_V ppa
ON ppa.INTSYSTEMKEY = 'JC2PLN'
AND ppa.PERIODTARGET = wld.DIMENSION_NAME
AND ppa.YEARTARGET = 'FY12'
) LEFT OUTER JOIN TPOVPERIOD_FLAT_V pp
ON pp.PERIODTARGET = wld.DIMENSION_NAME
AND pp.YEARTARGET = 'FY12'
WHERE wld.LOADID = 176
AND wld.COLUMN_TYPE = 'DATA'
) query
GROUP BY PERIODTARGET
,YEARTARGET
,ENTITY_NAME_ORDER
) q
,TPOVPERIOD p
,AIF_GL_PERIODS_STG prd
WHERE p.PERIODKEY = q.PERIODKEY
AND NOT EXISTS (
SELECT 1
FROM AIF_PROCESS_DETAILS pd
WHERE pd.PROCESS_ID = 176
AND pd.ENTITY_TYPE = 'PROCESS_WB_EXP'
AND pd.ENTITY_ID = prd.YEAR
AND prd.SOURCE_SYSTEM_ID = 3
AND prd.SETID = '0'
AND prd.CALENDAR_ID = '10000'
AND prd.PERIOD_TYPE = 'Month'
AND prd.START_DATE > p.PRIORPERIODKEY
AND prd.START_DATE <= p.PERIODKEY
AND prd.ADJUSTMENT_PERIOD_FLAG = 'N'
ORDER BY prd.YEAR
2012-10-12 11:05:10,078 INFO [AIF]: COMM Writeback Period Processing - Insert Periods into Process Details - END
2012-10-12 11:05:10,516 INFO [AIF]: COMM End Process Detail - Update Process Detail - START
2012-10-12 11:05:10,594 DEBUG [AIF]:
UPDATE AIF_PROCESS_DETAILS
SET STATUS = 'FAILED'
,RECORDS_PROCESSED = CASE
WHEN RECORDS_PROCESSED IS NULL THEN 0
ELSE RECORDS_PROCESSED
END + 0
,EXECUTION_END_TIME = CURRENT_TIMESTAMP
,LAST_UPDATED_BY = CASE
WHEN ('native://DN=cn=911,ou=People,dc=css,dc=hyperion,dc=com?USER' IS NULL) THEN LAST_UPDATED_BY
ELSE 'native://DN=cn=911,ou=People,dc=css,dc=hyperion,dc=com?USER'
END
,LAST_UPDATE_DATE = CURRENT_TIMESTAMP
WHERE PROCESS_ID = 176
AND ENTITY_TYPE = 'PROCESS_WB_EXP'
AND ENTITY_NAME = '2012'
2012-10-12 11:05:10,594 INFO [AIF]: COMM End Process Detail - Update Process Detail - END
2012-10-12 11:05:10,719 INFO [AIF]: ERPI Process End, Process ID: 176I do not have any hints on this.
Would need to see the ODI Operator when the process is ran. -
MC.9 - Material Number appears for period 06/2007 but not 07/2007
Hi Experts,
Have you encountered the situation whereby in MC.9(S039), the data of a certain Material Number appears for period 06/2007 but not 07/2007
This material# has no stock & movements for 07/2007, but for another material# with the same conditions, there is no problem.
Thanks & Regards
LawrenceHello Experts,
i´m having the same issue at my system.
Does anyone know why for a certain material report MC.9 shows balance at some Store Location although it doesn´t have any movements, while for other Store Location it isn´t showed any line, not even with zero values.
I hope somebody can answer this issue.
Thank you very much in advance.
Regards,
cecil -
Period open date in FA_DEPRN_PERIODS
I want to know what controls period open date and close in FA_DEPRN_PERIODS
table. We have first open period (JAN-02) for year 2002 from '02/27/2002' and
now we have some depriciation transaction for this year (2002) before this
date.
So when we are running Journal Entry Reserve ledger Report for this year then
those transaction are not matching showing up because they are before
'02/27/2002'. So can I update period open date to early date or what is the
impact on system.Did you refer note 1061798.1
If this note didn't help you,
let us know the version also let us know if the GL period is ever used.
Regards,
Srini -
Custom Report for the Stock and Stock value for a specific date
Hi SAP Gurus,
Is there any SAP standard t-code or any logic to get the transcations (additions (for example: Purchases) and subtractions (Sales) to the inventory) for a particular materials in a plant and with Total Stock and also Total Stock value when that particular transaction happened?
Our system is R/3 4.7
I looked at the MB5B, MBCE, MBCA, MC44, MB51 and some other standard T-codes but could not find the total stock value at the time of Transaction happened.
The history tables MBEWH and MARDH are updated after the month end closing procedures, right, which means I will have the inventory value changing every month if material has Price "S".
Thank you,
-HarterHi Harter,
Unfortunately, you cannot see in a single tcode the value of stock and stock quantity on a specific date. As you yourself have pointed out, we only have to make use of the history table MBEWH, MARDH for the month wise stock quantity and value. Along with that you should also make use of the table MBEW to take teh stock quantity and value. So the total value of stock on a particular date will be
Stock qnty = MBEWH value until the previous month (for teh specific valuation class, period etc) + MBEW value for the present date.
But this will nto work out if you want to find out teh stock quantity and stock value on a past date basis. For past data, only m onthwise data is available. For this anyway you can refer to MC.1 and so on reports. -
How to calculate opening and closing balance for period
Hi all,
i have to find out opening and closing balance.
the table structure of temporary table is
select * from hwcn_xn_fa_report_temp1 where asset_id=10029400
PERIOD_COUNTER CST_OP_BAL CST_ADDITION CST_TRANSFER CST_DISPOSAL COST_CLOSING_BALANCE
24108 0 0 0
24109 12000
24110 0 0 0
24111 0 0 0
in this table cst_op_balnce and cost_closing_balace is null
i have display cost_op_bal and cost_closing_balnce
cost_closing_balance=cst_op_bal+cst_addition+cst_transfer+cst_disposal
for period 2408 op_balnce=0 closing_bal=0
for period 2409 op_balnce=0 closing_balce=1200
for period 2410 op_bal=1200 closing_bal=1200
closing balance of dec will be opening bal of jan
thanks and regards
Edited by: user10664276 on Apr 19, 2009 11:08 PM
Edited by: user10664276 on Apr 19, 2009 11:13 PMHi,
user11118871 wrote:
Can you explain what that is? Thank you if you have one example.
ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING
When you use the analytic SUM (c) function, then, on each row, it returns the values of column (or expression) c from several rows in the result set added together.
Which rows? That depends.
If the analytic clause (the part in parentheses after OVER) does not include ORDER BY, then it is all rows.
If the analytic clause has an ORDER BY clause, but no windowing clause (that is, ROWS BETWEEN ... or RANGE BETWEEN ...), then the rows included in the sum are all rows up to and including the row where the function is being called (as sorted by the analytic ORDER BY).
If the analytic cluase has both ORDER BY and a windowing clause "ROWS BETWEEN x PRECEDING AND y PRECEDING", then the rows included in the sum are the rows from x to y rows before the one where the function is called.
Do some experiments with different values of x and y.
First, create a table like the one in the problem above, but simplified a little.
CREATE TABLE test_sum
( period NUMBER
, new_amt NUMBER
INSERT INTO test_sum (period, new_amt) VALUES (24108, 1);
INSERT INTO test_sum (period, new_amt) VALUES (24109, 4);
INSERT INTO test_sum (period, new_amt) VALUES (24110, 2);
INSERT INTO test_sum (period, new_amt) VALUES (24111, 8);
INSERT INTO test_sum (period, new_amt) VALUES (25001, 32);
INSERT INTO test_sum (period, new_amt) VALUES (25002, 16);
COMMIT;The original problem above used names that were meaningful for its application, and columns that have nothing to do with the SUM function. Let's simplify the former and lose the latter.
That problem involved the SUM of three columns added together. Since we just want to understand how the windowing clause works, let's simplify that to one column.
With these simplifications, my original query is:
SELECT period
, new_amt
, SUM (new_amt) OVER ( ORDER BY period
ROWS BETWEEN UNBOUNDED PRECEDING
AND 1 PRECEDING
) AS opening_balance
, SUM (new_amt) OVER ( ORDER BY period
) AS closing_balance
FROM test_sum
ORDER BY period;Given the data above, it produces these results:
. PERIOD NEW_AMT OPENING_BALANCE CLOSING_BALANCE
24108 1 1
24109 4 1 5
24110 2 5 7
24111 8 7 15
25001 32 15 47
25002 16 47 63So, for example, on the row where period=24110,
opening_balance=5, which is the total of new_amt from all rows up to but not including that row: 5=1+4, and
closing_balance=7, which is the total of new_amt from all rows up to and including that row: 7=1+4+2.
To really understand how the windowing clause works, do some experiments. Change the definition of opening_balance to include " BETWEEN x PRECEDING AND y PRECEDING". You'll find that:
(a) "UNBOUNDED PRECEDING" means the same as "n PRECEDING", where n is greater than the number of rows in your result set.
(b) "CURRENT ROW" means the same as "0 PRECEDING"
(c) x must be greater than or equal to y
(d) neither x nor y can be negative (but you can use "FOLLOWING" instead of "PRECEDING" to get the same effect).
For more, see the introduction to "Analytic Functions" in the [SQL Language manual|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions001.htm#sthref972]
When you're finished, don't forget to
DROP TABLE test_sum; -
Bapi/function module to get opening or closing stock for a posting date
I am creating a report where i need to get the opening stock value and closing stock value for the given starting date and ending date respectively for the PP report.
The T-code for that is MB5B.
So,can any1 plzz tell me how i can get the stock value for a starting date/ending date...
Is there any BAPI or function module to find this out..
or any logic?
Thanks.Hi Kiran,
You would like to findout opening and closing stock of a particular period and of a particular period....
If we would like to findout opening and closing stock of material A as of 18 / 8 / 2008,
then do like this.
go to MBEW table .. there u get opening stock as on today. Today the date is 20/8/2008. from today's opening stock if we add / subtract the movements which have happened on 19/8/2008 and 18/8/2008 u'll get opening and closing stock as on 18/8/2008.
U get the movements from MKPF ( material doc header) and MSEG (material doc item ) based on posting date. In MSEG u get movement type.
If the movement type is 101, it means the stock is added.
If the movement type is 102, it means the added stock is reversed.
from today's opening stock deduct the stock with moverment type 101 and add the stock with movement type 102.
This will give u opening stock as on 18/8/2008.
To get closing stock of 18/8/2008 ..... the opening stock of 19/8/2008 is 18/8/2008's closing stock.
Maybe you are looking for
-
Hello! Im thinking of switching to a mac but one thing stumps me - would i be able to use an external sound card (creative sound blaster x fi, USB based) From what it seems, Creative does not directly support the operating system but was wondering if
-
What do broadcasters use to bring live footage into/through PrPro?
In another thread, the question of how to import "live" shooting from a vid-cam came up, and the standard answer is ... only by firewire will PrPro capture directly off a video camera. But ... I know it's used in work where broadcasters in real-time
-
Hi, I want to create reports for my windows application(vb2005 with oracle 10g database). I was using crystal report when i was developping with an access database and vb.net but its not working. Does someone have an idea of doing it with vb2005 and
-
Unable to link Jtext field with third party software.
Hi pals, I am stuck in a problem which is as follows: "I have one third party software (lightspeed) which helps one to link it to any application. Here I am able to link this app with the text field of google.com opened in a browser or in a java fram
-
Dispatcher stop after restoring DB
Hi, we have install new DEV server ver . sap r/3 enterprise 4.7 2.00 with ms sql 2000 on windows 2003 srv and then restore db of ms sql of old DEV server. we have done the following. 1) Install MS SQL 2000 with SP4 . 2) install central instance of r/