Moving data forward 30 days, 60 days, 90 days
Hi - I have an issue trying to move a set of data 30 days forward. I have tried using SHIFT and PRIOR, but they seem to work best moving data up from prior month(s). My CurCycleOutMonths are from Aug:Dec. What I am trying to have the calc script do is, move the data that is in Aug:Dec to move 3 months forward. So, the data that is in Aug will be in Nov, Sep data will be in Dec, Oct I will shift to next year Jan.
FIX(VersionA,Actual,GM,@relative("Top End",0),"Studio Output Deal",@UDA("Titles",GM))
FIX (FY10)
FIX (&CurCycleOutMonths)
"W1-PR"
IF(@ISMBR("Amort Amount"))
"W1-PR" = @SHIFT("W1-PR"->"Amort Amount",-3,);
ENDIF
ENDFIX
ENDFIX
ENDFIX
Are you looking for a brute force method or a generic calc script?
using brute force (A couple of assumptions
Your periods are dense, Amort amount is in a dense dimension)
FIX(VersionA,Actual,GM,@relative("Top End",0),"Studio Output Deal",@UDA("Titles",GM))
FIX (FY10)
FIX ("W1-PR","AMort Amount")
Nov(
Nov = Aug;
Dec = Sep;
Jan->FY11 = Oct;
ENDFIX
ENDFIX
ENDFIX
I'm not sure if you wanted to copy the data or move it. If you want to move it add
Aug(
Cleardata Aug;
Clear data Sep;
Cleardata Oct;
After the first calc but before your endfix. The one thing about tis is you can only move it once. Once you do, your source data is gone. I don't typically like this as I like to be able to run repetatively and get the same result. If you are going to do the, make sure you back up your data first
Similar Messages
-
The Basic Finish date is a Day earlier than Planned date
Dear Experts,
I am getting a strange behaviour about Maintenance order Basic Finish Date when generated from Maintenance Plan. I have Customizing settings (TCode : OPU7) Adjust: "Adjust Basic dates, adjust dep reqmts to order start date" and scheduling type : Backwards in Time. For this setting Order Basic Finish Date is a day earlier than Planned date , but when Schduling type is Backwards instead of Backwards in Time, Basic Finish date is same as Planned date.
Example: The start of cycle of a monthly plan is 14-Nov-2010, 1st Planned date is 14-Dec-2010. When Scheduling type is " Backwards in time" , the order generated is having Basic Finish Date as 13-Dec-2010 .And when Scheduling type is "Backwards" , Basic finish date is 14-Dec-2010.
Thank you.
-Malay-Hi there,
Please check the primilinairy buffer in your strategy package. This field have an effect on your order start date.
But I agree on Pete, you should use a forward planning.
Regards,
Johan
Edited by: Johan Zeeman on Dec 17, 2010 11:29 AM -
How to get the date of first day of a week for a given date
Hi gurus
can any one say me how to get the date of first day(date of Sunday) of a week for a given date in a BW transformations. For example for 02/23/2012 in source i need to get 02/19/2012(Sunday`s date) date in the result. I can get that start date of a week using BWSO_DATE_GET_FIRST_WEEKDAY function module. But this function module retrieves me the start date as weeks monday(02/20/2012) date. But i need sundays(02/19/2012) date as the start date. So it would be really great if anyone sends me the solution.
Thanks
RavHi,
The simplest way would be to subtract 1 from the date date which you are already getting in transformation routine, but instead of doing that subtraction manually which might need bit of errort, you can simply use another FM to subtract 1 from given date.
RP_CALC_DATE_IN_INTERVAL
Regards,
Durgesh. -
Date for first day of current month
How can i get the date for first day of current month ?
select trunc(sysdate,'MM'),to_char(trunc(sysdate,'MM'),'DD'),to_char(trunc(sysdate,'MM'),'Day') from dual;
-
Show data of last day of previous month against any day of current month
Hi,
I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
Any suggestion ???You're asking to filter your data set to only include rows between:
1) last day of the previous month
2) any day of the current month
This can be achieved with prompting in OBIEE Answers.
last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
For the 'last day of previous month' , use the query:
SELECT
case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
end
FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
For the current date, use the query:
SELECT
case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
end
FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt. -
How to get the date of 60 days before 1999/03/01?
Hi, I have a question about Date and GregorianCalendar here. I have a string "1999/03/01" and I would like to know the date that 60 days before 1999/03/01. What should I do it?
I only went this far:
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
String date = "1999/03/01";
Date day = dateFormat.parse(date);
GregorianCalendar calendar = new GregorianCalendar();
: <--- ??
So, can anyone please tell me what should I do next??
-jxchouPut this in the search box for this forum at the right: add days +date
The first 2 hits are about your question.
The Forum search is your friend... -
How to convert Date format into day in ssrs reports?
Hi
How to convert date format into day?
10/01/2010 as like Monday like that?=weekdayname(datepart("w",Fields!mydate.Value))
-Vaibhav Chaudhari -
Current date - user entered days
Hi all
I have this scenario:
I have safety stored as attribute of material.
I have to do some calculation based on this so i created a replacement path variable and used replace with attribute value.
Now i have 2 safety stock:
1. Current ( safety stock restricted to current date )
2. Safety stock Past : restricted to (current date - User entered no of Days).
How to calculate the second one in 2004s??
ThanksHi Srini
Thanks for quick response. here is the issue. The safey stock needs to be calucated for just that day. so it not aggregated from current date- user entered days to current date.
ex:
Current Safety Stock (10/26/2007) Safety past (10 /26/2007 - 7 days) ( user enters 7 days)
100 200
So how to restrict Safety past to the date which is current - user enetered no of days.
Thanks
Pankaj -
Hi,
I have CURRENT DAY variable and i want to create one more variable which gives the Date before 30 days.
Is there any STD variable which gives the date before 30 days .Please tell me.
I have created one variable with Customer exit processing type and i need to develop code for this. Can anybody provide code how we will get date(dd/mm/yyyy) before 30 days .I have created variable with name "Z_CVAR". Please help me on this.use 0date variable to get the system date ... which is the SAP standard variable which pics the sy-datum.
Next restrict the KF with the 0date and right click on the 0date and click on offset and set the off set for the varaible as -30.
which gives the value -30 days.
If not as suggested in the earlier post -- create a z variable with replacement path -customer exit -- write the code ... in the code itself write the logic to get the -30 days
IF i_step = 2.
CASE i_vnam.
WHEN 'ZCURDAY-30'.
CLEAR: l_s_range.
l_s_range-low = sy-datum -30.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDCASE.
ENDIF.
regards
KP -
Figure out dates corresponding to days of the week, constructing a schedule
Hi everyone,
I'm sorry if this topic has already been covered. I've searched the forums for an answer, but did not see anything I took to be an answer (I'm not very good at this).
I'm trying to make a simple table to tell me which dates a particular day of the week falls on. For instance, I'm making a syllabus for a class that meets every Tuesday and Thursday. I want to know which dates corresponds to every Tuesday and Thursday from here on out.
I currently have a table with two columns. The first column is the day of the week. The first row is Tuesday, the second is Thursday, the third Tuesday, etc. I was able to do this easily with auto fill. I want the next column to be the date.
Here's a picture of what I mean:
Is there a formula that will let me do this?
Thanks!Hi Macademic,
How about putting both into the first column?
Select all of column A and use the Cell Format inspector to set the format as Date and Time, with the Date: and Time: pop-up menus set to:
Date: Mon, Jan 5, 2009
or: Monday, January 5, 2009
or to a Custom format, Date and Time, including only the elements you want in the format you want them.
Time: None
Enter the starting date into A2, and confirm that it is either a Tuesday or a Thursday.
In A3, enter
=A2+2 (if the course starts on a Tuesday)
or
=A2+5 (if the course starts on a Thursday)
In A4, enter
=A2+7
Select A3 and A4, then grab the control (small circle at the lower right corner of the selection) and drag down until you reach the last date of the course.
Regards,
Barry -
When ever enter the date start date up to next year same date between the days divided into 8 parts
when ever enter the date start date up to next year same date between the days divided into 8 parts
Q1.1 (YYYY) = 1st half of Quarter 1 for year YYYY
Q1.2 (YYYY) = 2nd half of Quarter1 for year YYYY
Q2.1 (YYYY) = 1st half of Quarter 2 for year YYYY
Q2.2 (YYYY) = 2nd half of Quarter 2 for year YYYY
Q3.1 (YYYY) = 1st half of Quarter 3 for year YYYY
Q3.2 (YYYY) = 2nd half of QuarterQ3 for year YYYY
Q4.1 (YYYY) = 1st half of Quarter 4 for year YYYY
Q4.2 (YYYY) = 2nd half of Quarter 4 for year YYYY
Here YYYY depicts the year.
e.g. Q1.2 (2014) depicts the 2nd half of Quarter 1 for year 2014.
The description of these values are explained below.
The table below provides the description about each value:
Quarter Quarter Range Start Date
Q1.1 1 Jan - 15 Feb 1st Jan
Q1.2 16 Feb-31 Mar 16th Feb
Q2.1 1 Apr- 15 May 1st Apr
Q2.2 16 May-30 June 16th May
Q3.1 1 Jul-15 Aug 1th Jul
Q3.2 16 Aug -30 Sep 16th Aug
Q4.1 1 Oct -15 Nov 1st Oct
Q4.2 16 Nov – 31 Dec 16th Nov
The dropdown values in time window needs to be updated as per date entered by the user in the Audit Plan start date and
should display the next four Quarter (each divided in 2 half i.e. Eight values ) along with the year from the selected Audit plan start date.
for eg. If the Plan start date is given as August 10 2013 then the Time window will display the following options:
Q3.2 (2013)
Q 4.1 (2013)
Q 4.2 (2013)
Q 1.1 (2014)
Q1.2 (2014)
Q2.1 (2014)
Q 2.2 (2014)
Q 3.1 (2014)
You can refer to the Table above and look that 10 Aug 2013 falls under the Q3.1 so Time window will display the next next 8 half Quarters ( Total 4 Quarter) till Q 3.1 for the year 2014.Hello,
WITH half_quarters AS(
SELECT ADD_MONTHS(TRUNC(DATE '2013-08-15','Q'), 3*(LEVEL - 1)) hq_start
,1 part
FROM dual
CONNECT BY ROWNUM <= 5
UNION ALL
SELECT ADD_MONTHS(TRUNC(DATE '2013-08-15','Q'), 3*(LEVEL - 1) + 1) + 15 hq_start
,2 part
FROM dual
CONNECT BY ROWNUM <= 5
,ordered_half_quarters AS(
SELECT hq_start
,part
,ROW_NUMBER() OVER (ORDER BY hq_start) r
FROM half_quarters
WHERE hq_start > DATE '2013-08-15'
SELECT 'Q '||TO_CHAR(hq_start,'Q')||'.'||part||' ('||TO_CHAR(hq_start,'YYYY')||')' q
FROM ordered_half_quarters
WHERE r <= 8
ORDER BY r;
Q
Q 3.2 (2013)
Q 4.1 (2013)
Q 4.2 (2013)
Q 1.1 (2014)
Q 1.2 (2014)
Q 2.1 (2014)
Q 2.2 (2014)
Q 3.1 (2014)
half_quarters generates the start dates of every half of a quarter, starting with the begin of the first quarter that contains the sample date.
The next step is to order the dates and to select only those after the sample date.
The last part formats the output and orders the data.
Regards
Marcus -
Hi
How can I to get the max Date in each day in data below , I must to do in unique query
select to_date('1/6/2010 06:29:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:29:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:28:03','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:27:58','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:27:57','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:27:57','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:27:52','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:27:45','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:12:48','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:12:42','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('1/6/2010 06:09:53','dd/mm/yyyy hh24:mi:ss') DATA from dual UNION
select to_date('31/05/2010 06:39:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:38:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:37:03','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:37:02','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:36:57','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:36:56','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:27:52','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:27:45','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:12:48','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:12:42','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union
select to_date('31/05/2010 06:09:53','dd/mm/yyyy hh24:mi:ss') DATA from dual
ORDER BY 1 DESCUsing Oracle 9.2.02
TIAAlso possible if you need all the days bettween your first and last day.
with tab as (
select to_date('1/6/2010 06:29:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:29:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:28:03','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:27:58','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:27:57','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:27:57','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:27:52','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:27:45','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:12:48','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:12:42','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('1/6/2010 06:09:53','dd/mm/yyyy hh24:mi:ss') DATA from dual UNION all
select to_date('31/05/2010 06:39:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:38:04','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:37:03','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:37:02','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:36:57','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:36:56','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:27:52','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:27:45','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:12:48','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:12:43','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:12:42','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:12:41','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('31/05/2010 06:09:53','dd/mm/yyyy hh24:mi:ss') DATA from dual union all
select to_date('28/05/2010 02:09:53','dd/mm/yyyy hh24:mi:ss') DATA from dual
,maxmin as (select trunc(min(data)) mindat, trunc(max(data)) maxdat, trunc(max(data))-trunc(min(data))+1 no_of_days from tab)
,days as (select rownum + (select mm2.mindat from maxmin mm2) - 1 dy
from all_objects ao
where rownum <= (select mm1.no_of_days from maxmin mm1))
select d.dy, (select max(data) from tab where trunc(data) = d.dy) max_time
from days d
dy max_time
28.05.10 00:00:00 28.05.10 02:09:53
29.05.10 00:00:00
30.05.10 00:00:00
31.05.10 00:00:00 31.05.10 06:39:04
01.06.10 00:00:00 01.06.10 06:29:04 -
Repeating events slipped forward one day-version 3.02 Leopard
I use repeating events to list birthdays. Suddenly I found that all my birthday events had slipped forward one day earlier. What causes this? How can I correct it? The events are wrong but iCal registers the correct day of the month and time zone.
If you are using all day events, it might be something to do with the switch to daylight savings time.
You could potentially fix the problem by using a floating time zone rather than a real one for each event.
I assume you know about the option to record birthdays in Address Book and then to show these in a dedicated iCal calendar? -
Week ending date after 365 days in sql
Hi Experts,
I need to find the week ending date after 365 days of the given week start date .
Example : Week start date : 23-Jan -2011 (Sunday)
Desired week end date : 28-Jan-2012 (Saturday)
How to achive this through sql ?
Thanks .Hi,
Check below this may help you, adjust "(t.day_num+1)" as per your requirment.
with t as
(select decode(to_char(trunc(sysdate + 365), 'dy'),'mon',1,
'tue',2,
'wed',3,
'thu',4,
'fri',5,
'sat',6,
'sun',7) day_num
from dual
select to_char(trunc(sysdate + 365)+ (7-(t.day_num+1)),'dd dy-mm-yyyy')
from t ; -
Recordset where date is 90 days or older.
Hello,
I am trying to build a recordset from a MSSQL database of records where c.date is 91 days or older. It's been 3 years since I touched Coldfusion so my code below is a little rusty....
<cfset todayDate = Now()>
<!--- Populate Open Quotes --->
<cfquery name="Quotes" datasource="quote">
SELECT q.qid, q.cdate, q.name, q.region, q.cuid, q.quid, q.status, c.company,
c.sitecity
FROM quote q, customer c
WHERE q.status = 'open' AND q.cuid = c.uniqueid AND q.cdate < (<cfoutput>#todaydate#</cfoutput>-90)
ORDER BY cdate
</cfquery>
Any help on this would be greatly appreciated.....
Thanks In Advance.
GaryThere are a few ways to do it. My preference is to use the DateAdd() function to calculate the date 90 days ago: #DateAdd("d", -90, now())#
Of course that will also include the time as well: 2009-12-21 17:21:00. You can truncate the time (ie convert it to a date only) by using either the CreateODBCDate() function:
WHERE q.cdate < #CreateODBCDate(DateAdd("d", -90, now()))#
... OR by using cfqueryparam with the data type "cf_sql_date"
WHERE q.cdate < <cfqueryparam value="#DateAdd("d", -90, now())#" cfsqltype="cf_sql_date">
Generally cfqueryparam is the better option for databases like MS SQL because a) it uses bind variables to help improve performance b) helps protect against sql injection. It also has some other nice features like the "list" and "null" attributes.
http://www.adobe.com/devnet/coldfusion/articles/sql_injection.html
(<cfoutput>#todaydate#</cfoutput>-90)
BTW: You do not need to use <cfoutput> tags inside a cfquery. There may be exceptions, but generally any #variable# used inside a CF tag will be evaluated automatically (without cfoutput tags).
Maybe you are looking for
-
See topic for problem / question...'
-
Printing symbol in text of smartform
Hi All, I need to write a symbol (tick mark) in text of smartform. Can anyone help me? Thanks, Bipen
-
hello when I run query in bex and sap i have error no application data,I don't have Bi accelator index may it error depents on it ? I want to know if I define bi acceleator this problem solve? or it dosen't depends on it? plz help me
-
I installed Oracle 11gR2 on linux OS.. I login to an instance as a db owner with a 'sqlplus / as sysdba'. but, I do not use that user for admin purposes (dba's have personalized accounts), so I created separate account within a oinstall user group. B
-
LR 4.3 continuously refreshes the image in develop mode
I am using LR 4.3 with Photoshop CS5. I have found that after editing a picture in photoshop (transfer from CR2 to .TIFF file) it correctly transfers back into LR as an updated .TIFF file with all edits from PS. However, on further editing of the pic