Calculate the age in bex
Dear all,
What i need is to calculate the age of an equipment, i have date of birth, in report i need to create a formula and subtract date of birth from sy-datum , however i do not know how to define sy-datum in bex variable or formula variable..
Any help?
Thanks
Hi,
For this First you need to create a Replacement path variable for your characteristic Date(If your Date is a key figure no need of creating this).
Then search for the standard SAP provided formula variable for current calendar day. once you have found this.
Create a Formula and in your formula use the formula "Date of Birth - Current Calendar Day" this will give you age in no.of days.
You would need to divide this by a number based on your requirement to get age in months or years.
Hope this helps,
Regards,
Rk.
Similar Messages
-
hi i am a computer science student new to java i have got this method to calculate the age
public void calculateAge(Date DateOfBirth)
String DateInText="12-12-1223";
try
Calendar birth = new GregorianCalendar();
Calendar today = new GregorianCalendar();
int age = 0;
int factor = 0; //to correctly calculate age when birthday has not been yet celebrated
Date birthDate = new SimpleDateFormat("dd-MM-yyyy").parse(DateInText);
Date currentDate = new Date(); //current date
birth.setTime(birthDate);
today.setTime(currentDate);
// check if birthday has been celebrated this year
if((today.get(Calendar.DAY_OF_YEAR)) > (birth.get(Calendar.DAY_OF_YEAR)-1))
factor = -1; //birthday not celebrated
age = today.get(Calendar.YEAR) - birth.get(Calendar.YEAR) + factor;
catch (ParseException e)
{ System.out.println("Given date: "+DateInText+ " not in expected format (Please enter a DD-MM-YYYY date)"); }
}the only problem is that I would like to get the date of birth from a screen input
could you help me please?
thanks very muchhi ,
try this code
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;
public class DateHelp {
/** Creates a new instance of DateHelp */
public DateHelp() {
ht.put("1","31");
ht.put("2","28");
ht.put("3","31");
ht.put("4","30");
ht.put("5","31");
ht.put("6","30");
ht.put("7","31");
ht.put("8","31");
ht.put("9","30");
ht.put("10","31");
ht.put("11","30");
ht.put("12","31");
Hashtable ht=new Hashtable();
static boolean flag=false;
String retdate="";
public String getInput()
try {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Your Birth Date(dd-mm-yyyy):");
String retd=br.readLine();
String retdsplit[]=retd.split("-");
if(retdsplit.length<3)
System.out.println("Invalid Format");
getInput();
try {
int year=Integer.parseInt(retdsplit[2]);
if(year%4!=0)
ht.put("2","29");
int date=Integer.parseInt(retdsplit[0]);
int mon=Integer.parseInt(retdsplit[1]);
String str=(String)ht.get(retdsplit[1]);
if(str==null)
System.out.println("Invalid Month ");
getInput();
else
if(Integer.parseInt(str)>=date)
flag=true;
retdate=retd;
else
System.out.println("Invalid Date");
getInput();
} catch (NumberFormatException ex) {
System.out.println("Invalid Number Format");
getInput();
} catch (IOException ex) {
ex.printStackTrace();
finally
if(flag)
return retdate;
else
return "";
public static void main(String args[])
DateHelp dh=new DateHelp();
dh.getInput();
System.out.println("here:"+dh.retdate);
} -
How do i calculate the age given the dob?
How do i calculate the age given the dob?
Date dateOfBirth = yourObject.getDateOfBirth();
float ageInMillis = System.currentTimeMillis() - dateOfBirth.getTime(); -
How do I calculate the age given the year of birth?
How do I calculate the age given the year of birth?
Get the current year using the getYear() method. Subtract the year of birth from the current year. The age is calculated.
d. -
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 -
Hi
I am new to Java, and i am having some problems with calculating some ones age .
Now the user will enter Today_date and then he will enter his birth_date
So how can I calculate his age
Thanks for the help
DadoHere is a very siple one:
import javax.swing.JOptionPane;
public class Age {
public static void main( String args[] )
String birth, present, birthday;
int birthnum, presentnum, age;
birth = JOptionPane.showInputDialog( "What year where you born in?" );
present = JOptionPane.showInputDialog( "What year is it now?" );
birthday = JOptionPane.showInputDialog( "Type 1 if your birthday has "
+ "gone, else type 0" );
birthnum = Integer.parseInt( birth );
presentnum = Integer.parseInt( present );
if ( birthday.equals("1") )
age = ( presentnum - birthnum );
else
age = ( presentnum - birthnum ) - 1;
JOptionPane.showMessageDialog( null, "Your age is: " + age );
System.exit(0);
} -
How do you calculate the age of a query?
Hi,
We are trying to determine how old a query is? Do one of the statistical cubes/queries contain the age or created on date of a query?
Thanks for you help. Points will be rewarded for the correct answer.
Thanks,
MikeHi rathi/mike,
check these tables RSRREPDIR,RSZCOMPDIR.
Cheers
RK -
Hi
How can I add 2 new metadata-fields to every photo in iPhoto ?
The new fields should state the age of my kids in years and months based on the date that they were born and the date that photo is taken.
Exampel:
My son is born 01.01.2010
My daughter is born 01.01.2012
Photo taken by data
Aage of son
Aage of daughter
01.07.2011
1 year 6 month
not born yet
01.01.2014
4 year 0 month
2 year 0 month
I would like to be able to search by kids age and get the info displayed when doing slideshows.
How to do this in iPhoto ?
Any alternatives to accomplish the same ?
Kind regardsIt can't be done with iPhoto. There are some DAM (digital asset management) applications that can write to other IPTC fields that iPhoto can't read. One such app is Media Pro 1.
However you would have to calculate the age for each date and add it to one of the fields. There are online age calculators that can do that for you: Age Calculators
If you go thru that much trouble then use iPhoto, make the calculations and add the age to the Description field. Then you can use Smart Albums to search for 1year 6 month text.
OT -
How to calculate the duration/age of a work request.
I need to calculate the actual resolution time in 'Days:Hours:Minutes' format, for the work requests which are being worked upon by the engineers working in my team. I am using MS-Excel (MS-Office 2013) for reporting. The tool from which I am exporting
the details shows the Open and Resolved time as MM/DD/YYYY HH:MM:SS (3/20/2015 10:32:16 AM). I am sure this is one of the thing which is not that difficult and many reporting people are doing this. Thanks in advance for the assistance.
Regards, Ankit AroraLet's say that the Open date/time is in A2 and the Resolved date/time in B2.
The formula for the resolution time is =B2-A2
Format the cell with the formula with the custom number format d:hh:mm
This will work as long as the number of days is at most 31.
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
Hi All
I have calculated aging in Bex using formula variable. It is working fine but i observed that the characteristic expire date has to be part of the query for the age to be calculated. Even if it is in free characteristic it doesnot calculate age, it has to be in Rows. Now the problem is that i require an aggregate (average) number of days for particular region and country.
This is not happening if i donot want to include the expire date in rows. Can anyone please suggest a solution to this ?
RegardsHi
Cell editor is not working. I will elaborate on the variables a bit for better understanding
I have 2 variables
1) replacement variable for expire date
2) customer exit variable for current dae
I have created a formula to subtract current date and expire date to get age.
Now the replacement path variab;e is populated only when the original characteristic is part of ROW else it is showing 'X'.
Need to know if there is any way to avoid this? or is there some other method to perform the same.
Regards
Preethi -
I want to calculate age of Order based on Order create date. I am having order create date as key figure date in Order cube. Age is calculated at runtime as (Last day of month) - Order create Date. For Example.
If ORder 'A' is created in 10/01/2004 and if query is executed at 12/31/2004 then Query should produce output as follows:
Order Number Month Age
A 10/2004 31 Days
A 11/2004 61 Days
A 12/2004 92 Days
In my infocube I've only one record for this order with Order number and Order create date. How to produce above mentioned o/p from this.
Thanks,
MilindHi Milind,
if you are looking for a web solution, use a table interface to create a new column for the age. You can calculate the value for the order age with the table interface, too. An advantage of this table interface solution is, that you can concatenate your unit [days] into the output range, like "31 Days".
For BEx Analyzer, you can create a VBA macro to get the same advantage...
rgds Jens -
How to calculate the days between last movement of material till today date
Hello Experts,
Could someone help me please?
I have a key figure in the InfoCube 0IC_C03 witch contain the last date of movement of material.
(it is a key figure created in format date and contain the max value).
How can I to calculate the number of days between this date (last movement), till today date (system date).
I need to show:
material........last movement.....days without movements.
xxxxxxxxxxx.....dd/mm/yyyy..........9999
Im trying to do this calculation in bex using variable formula but it doesn't work becouse current date (customer exit) brings sy-datum in format yyyymmdd and the kf-last-mov is in format number (I dont know what kind of number)
Thanks in advance,
Points are assured.
Regards,
Silvio Meurer.
Message was edited by:
Silvio MeurerHi Parth,
Here we are using the version 7.0 and SP 10, I'm afraid I could not understand you. I Can't find the function DATE_DIFF (Where is it?)
I'm using the formula and it doesn't work. Coud you see the result is:
last movement date Today date result
02.04.2007 20.070.625 19.337.856
18.05.2007 20.070.625 19.337.810
the "today date" is from customer exit and the result is a strange number to me.
Could you help me? -
How to include the Age and Age operator in Dashboard prompts
I wouild like to create two new dashboard prompts 'Age' and 'Age Operator' both as drop downs.
The 'Age' prompt should have the values from 1-100 as dropdown for the users to select from.
The 'Age Operator' should have the values <, <=, >, >=, = as dropdown for the users to select.
I have PERS_DOB column in Person table. I do not have any operator values stored in any tables.
How can I create these two dashboard prompts so that the user can select the values from the
dropdown list and filter the results against.
For example:
User select Age 20 from Age dropdown prompt and '<' from the Age operator prompt the results
should filter based on the above and should get us the records for the people whose
Age is less than 20.
I appreciate any help on this.
Thanks.You could try this:
1) For the "age operator" prompt, use words to describe the operators (e.g., "less than" rather than the symbol <=, etc.). (I'll assume you know how to build the prompt using CASE statements and UNION. It's pretty straightforward.)
2) Build 5 small reports, one for each operator, that only returns a row when the particular operator is selected in the prompt. Each of these reports will be in the guided navigation of a separate section.
3) Now, build 5 versions of your report with a filter on the "Age" prompt, one report that calculates the 5 different permutations of the age chosen (i.e., less than prompt, less than or equal to prompt, etc.) and put each report in the guided navigation section that corresponds to the applicable small report you built in step 2. So, for example, for the section that returns a row when "less than" is chosen, put the report that filters for "age less than 'age prompt'."
So here is how it works: When the user selects an age and operator, only the section that corresponds to the operator selected will display because of the guided navigation. The other 4 sections will not show, because the small report in the guided navigation part of the section will return no rows. -
How to calculate Last year in BEx Report
Hi Experts
I have a requirement to create report in BEx --> report output will be Amount, Diff in percentage(Plan-Actual),Last year
My question how we calculate the Last year and actual minus plan difference in percentageHi,
Make use of % functions in query designer to get the desired result.Please search on forum lot of examples will be there.
Hope it helps.
Regards,
AL
Edited by: AL1112 on Mar 7, 2011 4:56 PM -
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 ...???
Maybe you are looking for
-
Creating a custom dictionary for Acrobat and Reader.
I want to create a custom dictionary to be used by all of our users when they access a "forms document" through Adobe Reader/Acrobat. Here are some of the issues: The default dictionary name under Custom Dictionaries has a .clam extension. Is there a
-
I try opening Itunes, and a message pops up saying that Itunes has encountered an error and needs to close. This is about a minute after I try to open. Itunes shows on the processes for about twenty seconds before the message pops up. What can I do?
-
SAP Implementation @ Indonesia
Hi Friends, We have to do an Implementation @ Indonesia.With regard to the pricing procedure, as you all are awere that SAP will provide each country separate standard pricing procedure. For Indonesia SAP not provided standard pricing procedure.
-
When logging in to hotmail, a new window opens and the bookmarks toolbar disappears.
Using Firefox 8.0.1 on an iMac. When I open Firefox, the bookmarks toolbar is fine, but when I login to Hotmail, it opens a new window and the toolbar disappears. Under the View menu, the bookmarks toolbar is still checked but the toolbar isn't there
-
[SOLVED]Dependency cycle detected
Just activated the multilib repositories. After that i tried to to install Infinality Bundle for 32-bit but confronted with a dependency cycle warning. What is this?: # pacman -S infinality-bundle-multilib :: There are 3 members in group infinality-b