Calculate the date diff
Hi, The requirement is to calculate the diff between 2 date fields and display it. I could able to get the difference between the 2 date fields. But now the result column SHOULD DISPLAY the result ONLY if the 2 date fields have the date set ELSE it should be left blank(basically NULL shud be set to the result column in such cases).
The formula which I have used to get the result is :
(NOERR(date1)<>0 AND NOERR(date2)<>0)*(date1-date2).
The above formula works fine and gives the result as desired except that it puts "0" even though the date fields doenst have a value.I have tried to use the ELSE part by giving "1/0" thinking it wud give me "#" but this didnt help me out anyway.
Any inputs on this...
Thanks for the response.
That was an option which I also thought of and I wud use it only as a last rescue and trying if I can get some info to do it otherwise.
The other option which I have in my mind is to just get this diff into the cube and this shud resolve but then again I hv to chg the BW structures and unnecessarily I wud be increasing the load to the cube.
Any other option in Bex ...???
Similar Messages
-
In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms.
How can i do this?Hi,
You can select the Payment Term at PO Header Level.
When you book an invoice, that Payment Term will automatically defaulted to Invoice.
You can define Payment Term in AP.
Payment terms have one or more payment terms lines, each of which creates one scheduled payment. Each payment terms line and each corresponding scheduled payment has a due date or a discount date based on either a specific day of a month, such as the 15th of the month, or a number of days added to your terms date, such as 14 days after the terms date.
Payment Terms (Oracle Payables Help) -
Using Numbers, can I calculate the date that will be eg 45 days ahead of a given date?
Using Numbers, can I calculate the date that will be eg 45 days ahead of a given date?
MWB,
Certainly. Let's say that your given date is in B2. The date 45 days earlier can be found with:
=B2 – 45.
Almost seems too simple.
Jerry -
"D2008178" - FM to calculate the date of the x day in a year
Hi all!
I am looking for a FM to calculate the date of a certain day in the year.
For example which date has the day 178 of the year.
This has nothing to do with the factory calendar!!!
Thanks a lot for your help
CU
PeterHi Peter,
Please check this funtion module "FIMA_DATE_CREATE".
Sample code as follows:
REPORT ztest_vinay.
DATA: w_date TYPE vtbbewe-dvalut.
PARAMETERS: p_date TYPE vtbbewe-dvalut.
CALL FUNCTION 'FIMA_DATE_CREATE'
EXPORTING
i_date = p_date " Here you need to pass first day of the year
i_calendar_days = 178
IMPORTING
e_date = w_date.
WRITE: w_date.
Regards,
Vinay
Edited by: Vinay Kumar Amruth on Feb 18, 2009 2:52 PM
Edited by: Vinay Kumar Amruth on Feb 18, 2009 3:01 PM -
How to calculate the data in bex
Dear all,
i have a service order no and it current active status and it time stamp details in my query
example
sevice orer no posting date name current active status active status date part aging
800000243 15.01.2009 shahina part despatched A 17.01.2007
in my ods i have
sevice orer no posting date name current active status active status date part aging
800000243 15.01.2009 shahina part despatched A 17.01.2007
800000243 15.01.2009 shahina part pending x 16.01.2007
800000243 15.01.2009 shahina part for asp x 17.01.2007
i want to calulate the aging of part pending to part despatched
17.01.2009 - 15-01.2009 = 2 days
i want to display in my bex like this
sevice orer no posting date name current active status active status date part aging
800000243 15.01.2009 shahina part despatched A 17.01.2007 2
( in bex report i want to display only active status )
can any one help me please to solve this issue
Regards
shahinaHi vamsi talluri ,
i working in crm reports ( service ) here i want to calulate the differance between the old status that is inactive status date to part despathed date
sevice orer no posting date name current active status active status date part aging
800000243 15.01.2009 shahina part despatched A 17.01.2007
in my ods i have
sevice orer no posting date name current active status active status date part aging
800000243 15.01.2009 shahina part despatched A 17.01.2007
800000243 15.01.2009 shahina part pending x 16.01.2007
800000243 15.01.2009 shahina part for asp x 13.01.2007
i want to calulate the aging of part pending to part despatched
17.01.2009 - 13-01.2009 = 4 days
i want to display in my bex like this
sevice orer no posting date name current active status active status date part aging
800000243 15.01.2009 shahina part despatched A 17.01.2007 4
in bex i am dispaying only active satus but i want calculate diff bet active status which i am dispalying in the bex analyzer and old status whaer the data are available in sercice order ods
please help me how to perform the calculation
Regards,
shahina..!
( in bex report i want to display only active status )
can any one help me please to solve this issue
Regards
shahina..!
Edited by: Shahina A on Jan 21, 2009 6:13 AM -
Calculate the date interval in days
Hi all!
I need your kind help.
I have an oracle sql table.
here is goes..
TABLENAME: RACE
DATE NAME
11-JAN-12 JAMES
12-JAN-12 JAMES
14-JAN-12 JAMES
17-JAN-12 JAMES
22-JAN-12 JAMES
01-FEB-12 JOHN
11-FEB-12 JOHN
13-FEB-12 JOHN
14-FEB-12 JOHN
28-FEB-12 JOHN
01-MAR-12 JOHN
HOW DO I Calculate the total date interval(difference) for James and John in days?
for example in this case the total is 7 days for James(11-JAN-12 to 12-JAN-12 is 0 days and 12-JAN-12 to 14-JAN-12 is 1 day and 14-JAN-12 to 17-JAN-12 is 2 days) and 24 days for John
The data for the date will be random and can be up to 60 difference dates and names so I will like to calculate for all different names.. Thanks!Can you explain in more detail why James should have 7 days?
Difference in dates can be easily calculated (if you use the DATE datatype, that is) by simply subtracting them.
Example:
SQL> -- generating sample data:
SQL> with race as (
2 select to_date('11-JAN-12', 'dd-mon-yy') dt, 'JAMES' nm from dual union
3 select to_date('12-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
4 select to_date('14-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
5 select to_date('17-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
6 select to_date('22-JAN-12', 'dd-mon-yy'), 'JAMES' from dual union
7 select to_date('01-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
8 select to_date('11-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
9 select to_date('13-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
10 select to_date('14-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
11 select to_date('28-FEB-12', 'dd-mon-yy'), 'JOHN' from dual union
12 select to_date('01-MAR-12', 'dd-mon-yy'), 'JOHN' from dual
13 )
14 --
15 -- actual query:
16 --
17 select max(dt)-min(dt) diff
18 , nm
19 from race
20 group by nm;
DIFF NM
29 JOHN
11 JAMESHowever, that is not your desired resultset. We (at least: I) need a bit more explanation why James should have 7 as date difference...
Also: DATE and NAME ar not suitable as column names. -
How we calculate the date difference between two list in SharePoint 2010
Hi friend's....I have two list first is list1. In this list i have two coulmn start_date and End_date. In second list2 i have two column HolidayName and Holiday_date. Now i want two find the number of day in list1 Excluding Weekend and Holiday_date(that
column from list2). How i will do ..? Please help me dosto..Thanks for reply...
I have done the date difference in list1. But i want to Exclude the Holiday_date form list2.
I have list1 - Start_date , End_date, Number_of_day(Exclude weekend and Holiday_date between Start_date and End_date )
list2 - HolidayName, Holiday_date
Now how i will calculate the Number_of_day in first list. -
Calculate the date difference on essbase 9.3
Hi Everbody,
I want to calculate the difference between 2 date in essbase 9.3. Is any one did this practice ?
I have done this but that is not a better way. so please share your thought with me.
Regards
Vikram SinghHi,
DateDiff function returns the difference (number) between two input dates in terms of the specified date-parts, following a standard Gregorian calendar.
Syntax
DateDiff ( date1, date2, date_part )
date1+ is the number representing the input date between January 1, 1970 and Dec 31, 2037. The number is the number of seconds elapsed since midnight, January 1, 1970. To retrieve this number, use any of the following functions: Today(), TodateEx(), GetFirstDate(), GetLastDate(), DateRoll().
Date-time attribute properties of a member can also be used to retrieve this number. For example,
Product.currentmember.[Intro Date] returns the product introduction date for the current product in context.
[Cola].[Intro Date] returns the product introduction date for Cola.
date2+ A second input date. See date1.
date_part+ Defined time components as per the standard calendar.
DP_YEAR - Year of the input date.
DP_QUARTER - Quarter of the input date.
DP_MONTH - Month of the input date.
DP_WEEK - Week of the input date.
DP_DAY - Day of the input date.
Edited by: Cnee on Jul 13, 2009 3:19 AM
Edited by: Cnee on Jul 13, 2009 3:20 AM -
How do i calculate the dates in this scenario
I have a situation here and i am not able to think through it
there are 4 date columns in a table and i need to do something like below
First Record start date is the start date, and end date is the next start date -1
Next start date is next start date, and end date is the first end date of the record set of the end dates
Next start date pervious end date + 1 and end date is the current end date
Next start date is the current date and next end date is the current end date
for example lets say we have a table like below
CustomerID CustomerType CustomerEffDt CustomerTrmDt CustNationalBgnDt CustNationalEndDt
1 National 2013-08-05 9999-12-31
2010-11-08 2011-11-02
Now my question is, we would have to calculate the customer effective start and begin dates and national begin and end dates based on the above criteria
we would have to create 4 rows based on the above scenario
I am going mad and not able to think through this
Can somebody help me
ThanksDeclare @Example table (CustomerID int, CustomerEffDt date, CustomerTrmDt date, CustNationalBgnDt date, CustNationalEndDt date, otherstuff varchar(99))
insert @Example Select 1, '3/19/2014', '9999-12-31', '3/19/2015', '2/19/2016', 'first'
UNION Select 2, '3/19/2014', '9999-12-31', '4/19/2014', '5/28/2014', 'second'
UNION Select 3, '2013-08-05', '9999-12-31', '2010-11-08', '2011-11-02', 'first example by OP'
Select CustomerID,Num
, case When Num = 1 Then '1/1/1900'
when NUM = 2 then CustNationalBgnDt
when NUM = 3 then DateAdd(day, 1, CustNationalEndDt )
when NUM = 4 then CustomerEffDt End as startdate
, case When NUM = 1 then DateAdd(day, -1, CustNationalBgnDt)
when NUM = 2 then CustNationalEndDt
when NUM = 3 then Dateadd(Day, -1, CustomerEffDt)
when NUM = 4 then CustomerTrmDt End as EndDate
From @EXAMPLE
Cross Apply (Select 1 as Num UNION Select 2 UNION Select 3 UNION Select 4) as Numbers
order by CustomerID, Num
/* --Your result
1 1 1900-01-01 2015-03-18
1 2 2015-03-19 2016-02-19
1 3 2016-02-20 2014-03-18
1 4 2014-03-19 9999-12-31
2 1 1900-01-01 2014-04-18
2 2 2014-04-19 2014-05-28
2 3 2014-05-29 2014-03-18 ---***
2 4 2014-03-19 9999-12-31 --****
3 1 1900-01-01 2010-11-07
3 2 2010-11-08 2011-11-02
3 3 2011-11-03 2013-08-04
3 4 2013-08-05 9999-12-31
CustomerID StartDate EndDate
1 1900-01-01 2014-03-18
1 2014-03-19 2015-03-18
1 2015-03-19 2016-02-19
1 2016-02-20 9999-12-31
2 1900-01-01 2014-03-18
2 2014-03-19 2014-04-18
2 2014-04-19 2014-05-28
2 2014-05-29 9999-12-31
3 1900-01-01 2010-11-07
3 2010-11-08 2011-11-02
3 2011-11-03 2013-08-04
3 2013-08-05 9999-12-31
;with mycte as
select CustomerID, dt,col,row_number() Over(partition by CustomerID Order by dt) rn
,row_number() Over(partition by CustomerID Order by dt DESC) rn2 from @Example
cross apply (
values( CustomerEffDt,'CustomerEffDt'), (CustomerTrmDt,'CustomerTrmDt')
, (CustNationalBgnDt,'CustNationalBgnDt'), (CustNationalEndDt,'CustNationalEndDt'))
d(dt,col)
Select m1.CustomerID,
Case when m1.rn=1 Then '1/1/1900'
When m2.col='CustNationalEndDt' Then dateadd(day,1,m2.dt)
Else m2.dt end as StartDate,
Case
when m1.rn2=1 Then m1.dt
When m1.col='CustNationalEndDt' Then m1.dt
else dateadd(day,-1,m1.dt) End
as EndDate
From mycte m1 LEFT Join mycte m2 on m1.CustomerID=m2.CustomerID AND m1.rn=m2.rn+1
Order by m1.CustomerID, m1.dt -
How to calculate the data as per accounting year
I want to dispaly the result for the accounting year from April to March for any accounting year (Accounting year is from April to March).
I have a table INVOICE.
CREATE TABLE INVOICE
IN_NO NUMBER,
IN_DT DATE,
IN_DETAILS VARCHAR2(20 BYTE)
I want to calculate display the result for accounting year from April 2010 to March 2011, and from April 2011 to MArch 2012.
What statement should i use to filter the data as above ?
Sanjayuser12957777 wrote:
I want to dispaly the result for the accounting year from April to March for any accounting year (Accounting year is from April to March).
I have a table INVOICE.
CREATE TABLE INVOICE
IN_NO NUMBER,
IN_DT DATE,
IN_DETAILS VARCHAR2(20 BYTE)
I want to calculate display the result for accounting year from April 2010 to March 2011, and from April 2011 to MArch 2012.
What statement should i use to filter the data as above ?
Sanjay
You should learn now to use correct tags
select to_char(add_months(in_dt,-3),'YYYY') FISCAL_YEAR FROM INVOICE; -
Calculate the date range from entered date
HI
My requirement is to get the data in a perticular intervals of posting date.
Directly we can create a variable with interval on posting Date to have the required data but Here we need two have two varibles because in one varibale user enters posting date and in second variable user enters any number like 1,2,3....etc
Let's say user enetered posting date as 30.08.2010 in the first variable and number 4 in the second variable.
Finally out put range should be calculted from entred posting date 30.08.2010 date to four days back
i.e output should be appear in the report from 27.08.2010 to 30.08.2010.
My question i can create first avariable on posting Date but where shoud i create the second variable on which field.
Please help me on this..points will be awrded.
Regards,
Siva Thottempudi.R you talking about the below to create new variable on the existing key figure
Selecting Variables
When you select characteristic values in the query definition, you can also select variables instead of fixed values. These act as placeholders and are only filled with fixed values when the query is executed.
When selecting variables, you can also define new variables, change variables, or delete variables. These functions are always available to the right of the selection of the variable type.
Selecting Variables
1. Choose Show ® Variables.
2. Under Type, select the variable type (such as Characteristic Value Variable, Hierarchy Node Variable) from which you want to select the variable.
3. Select one (or, in exceptional cases, more than one) variable from the list of available variables in the left window and add them (using the right arrow) to the right Selection window.
Selecting Variable Value Range Limits
1. Choose Show ® Value Ranges.
2. Select your required operator from the dropdown box. You can choose from the following operators:
○ Between
○ Less Than or Equal to
○ Greater Than or Equal to
○ Less Than
○ Greater Than
3. Select the required value or values for the value range and choose . The input help appears in a new dialog box and displays the selection of variables under Show ® Variables.
4. Under Type, select the variable type (such as Characteristic Value Variable, Hierarchy Node Variable) from which you want to select the variable.
5. Select the required variable and choose OK.
6. For the Between operator, two single values are required for the interval limits; the system automatically displays two dropdown boxes. In this case, repeat steps 3-5.
7. After you have set the value range, choose OK.
8. Add the selection to the right Selection window using the right arrow. -
Formula to calculate the date difference
Hi Experts,
I am having a requirement . where i need to create the query with difference between the two dates. like date1 and date2
Now i have created a formula for this diff =date1 - date 2 now the client want that this operation has to b executed when date2 hold some value r else "diff" column has to b blank.
RegardsKK,
if (date_diff > 0) * date_diff.
it will first check wheather data_diff >0 . Suppose its value is 5.
now after that v r multiplying with date_diff ie 5 then the result will be 25 right ??
--> No, if (date_diff > 0) is boolean operation return "0" or "1" only. if its true then 1 or 0.
So: same example: if (date_diff > 0) * date_diff --> 1*5 = 5.
Hope it Helps
Srini -
How to calculate two date diff?
what is the similar function in BIEE? like datediff = date1 - date2 SQL statment in Oracle db,
i have tried to use minus, it was not works, BIEE does not support minus two date directly?
thanks a lot!
Kaymoyou can use timestampdiff function. The TimestampDiff function returns the total number of specified intervals between two timestamps.
Syntax:
TimestampDiff (interval, timestamp-expression1, timestamp-expression2)
example TimestampDiff (SQL_TSI_DAY, date1, date2) returns the number of days between date1 and date2.
The specified interval. Valid values are:
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR -
I want to calculate the date diff for delivery date(eg;-sep-24 ,2007) and scheduled date(eg:-sep-17,2007)there the result should be 7 but i dont no how to write query can we use routines in this kind of situations...
hai
use replacement path for both dates and create a new formula by subtracting from(delivery date -scheduled date)
below is the best example
http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
chk these links would help u more,
http://help.sap.com/saphelp_nw04/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2c/78a03c1178ad2ce10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/af/809528939d5b4fbff7e16a5bdc0d85/content.htm
http://help.sap.com/search/highlightContent.jsp
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
Maybe you are looking for
-
Apple TV doesn't show any wireless networks
Hi, I was using ATV with my Belkin router for connecting to my home network.Recently, I got timecapsule and setup wireless network which I am able to connect to using iphone and my macbook.I had also setup ATV to connect to wireless network created u
-
My nano generation 6 now stops playing music when the screen goes black
The nano recently started to do something weird. I have been using it for a couple years with no issues. Recently it will stop playing music as soon as the screen goes black (sleep). it never did this before. I have checked the settings, nothing
-
Developing under SDK 3.0
I have installed the latest 10.6 OS (snow leopard, full of bugs, yuck), and have installed the latest SDK for 3.0 but now I find that my 2.1, and 2.2.1 SDK stuff is long one, and I can't seem to install them now the installer won't run. I don't care
-
DW MX - WIN XP - EMAILING PB AVEC LOTUS
Bonjour, J'ai besoin de transferer un email créé à partir de dreamweaver MX à une personne qui doit ensuite le transférer à différents patenaires en passant par lotus. Nous rencontrons plusieurs problèmes : 1- En passant par Lotus toutes les images s
-
I am currently using the WRT54GS. I just set up the wireless security for my wireless network. I am using the WEP security mode with 128 bits 26hex digits for the encryption. I set up a passphrase and generated the keys and am able to access the netw