How to calculate Age in the RPD level

I want to create a logical column say 'Age' in the repository. I have the PERS_DOB in the PERSON dimension.
From this I wrote a query to get the age from the PERSON dimension as below.
I am wondering if I can create a logical column in the rpd using the sql or is there any way where I can get the age of the persons calculated as a logical layer in the repository.
select pers_dob, round (((trunc(sysdate)-trunc(pers_dob))/365), 0) from w_pers_d
Thanks in advance.

I have created a repository variable 'currentdate' (to get the sysdate) in the rpd and created a new logical column AGE and in the expression builder I used the below and got the syntax error.
***round((currentdate-trunc("Program Info b".."Program Info b"."W_PGAD_PR_PERS_D"."PERS_DOB" )/365),0)***
***[nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] .***
I thought functions round, trunc are not supported in OBIEE expression builder and tried the below and got a different syntax error.
*[nQSError: 27009] Unresolved identifier: "currentdate".*
Have anyone tried this successfully.
Please let me know.
Thanks/

Similar Messages

  • ABAP-HR MODULE(HOW TO CALCULATE AGE & YEARS OF SERVICE)

    HI,
    HOW TO CALCULATE AGE & YEARS OF SERVICE means for example
    I AM USING PNPCE LDB.
    (1) whose age is greater than 52.833 years with 7.833 years of service, with annual rate of pay $170,000 or more, or
    (2) age plus employment service is 65 or more, with annual rate of pay of $ 170,000 or more.
    Note that the $ 170,000 parameter would be a variable that could change annually when this report would be generated. In the past, age and service value were determined as of the run date. The determination date would also be a variable that would change when the report would be generated.
    Thanks&Regards
    Rahul.

    Hi Rahul,
    This is the 2nd warning !!! Please... use the correct or most appropriate forum.
    The ABAP Objects Forum should be used for: ABAP Object definition and implementation including encapsulation, interfaces and inheritance in ABAP Objects.
    This thread will be moved from to .
    You're asking this question in two thread, so the duplicated thread will be deleted.
    Please have a look at [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.
    Also read this thread Welcome and Rules of Engagement.
    Greetings,
    Marcelo Ramos

  • How to Calculate AGE by getting difference between two Date Fields

    HI Gems
    I need to calculate AGE from getting difference from two date fields. But when i am trying to wrte fromula as Current date - date1(some date field) then it is showing error.
    How can i get values.
    Thanks
    Manu

    You already asked this question:
    How to calculate AGE from two different date fields

  • How to calculate age in oracle

    Hi,
    T was trying do calculate age as on todays date in ORACLE but after a lot of brain storming i didn't get it.
    Kindly tell me how to calculate age as in years month days.
    For ex.. My DOB- 02-feb-1984 so my age should get as 27 Years 2 months 8 days
    How to do it.
    I tried this
    select
    TRUNC( months_between( sysdate, TO_DATE('02-02-1984','DD-MM-YYYY') )/12 ) Year,
    TRUNC( mod(months_between( sysdate, TO_DATE('02-02-1984','DD-MM-YYYY') ),12) ) Month,
    mod(months_between( sysdate, TO_DATE('02-02-1984','DD-MM-YYYY') ),12) /30 Days
    from dual
    but days are not calculating correctly...
    RGds,
    PC

    sorry..i didn't chck your query..it is right but give wrong answer..
    WITH got_months AS
         SELECT     TO_DATE('02-02-1984','DD-MM-YYYY')
         ,     FLOOR (MONTHS_BETWEEN (SYSDATE, TO_DATE('02-02-1984','DD-MM-YYYY')))     AS months
         FROM     dual
    SELECT     TO_DATE('02-02-1984','DD-MM-YYYY')
    ,     TO_CHAR (FLOOR (months / 12))     || ' years, '     ||
         TO_CHAR (MOD (months, 12))      || ' months, '     ||
         TO_CHAR ( CEIL ( SYSDATE
              - ADD_MONTHS ( TO_DATE('02-02-1984','DD-MM-YYYY')
                        , months
              )               || ' days'
    FROM got_months
    o/p
         TO_DATE('02-02-1984','DD-MM-YY     TO_CHAR(FLOOR(MONTHS/12))||'YE
    1     2/2/1984     27 years, 7 months, 9 days
    1 day more..1     it sud be.. 2/2/1984     27 years, 7 months, 8 days
    if i make correction with add_months like below..
    WITH got_months AS
         SELECT     TO_DATE('02-02-1984','DD-MM-YYYY')
         ,     FLOOR (MONTHS_BETWEEN (SYSDATE, TO_DATE('02-02-1984','DD-MM-YYYY')))     AS months
         FROM     dual
    SELECT     TO_DATE('02-02-1984','DD-MM-YYYY')
    ,     TO_CHAR (FLOOR (months / 12))     || ' years, '     ||
         TO_CHAR (MOD (months, 12))      || ' months, '     ||
         TO_CHAR ( CEIL ( SYSDATE
              - ADD_MONTHS ( TO_DATE('02-02-1984','DD-MM-YYYY')
                        , months
                        )-1
              )               || ' days'
    FROM got_months
    then o/p is..
         TO_DATE('02-02-1984','DD-MM-YY     TO_CHAR(FLOOR(MONTHS/12))||'YE
    1     2/2/1984     27 years, 7 months, 8 days
    correct but cdnt understand why sud -1?

  • How do I permanently set the zoom level? I am sick of hacing to "ctrl +" on every page!!

    How do I permanently set the zoom level? I am sick of hacing to "ctrl +" on every page!! It is a HUGE waste of time. If I can't do it, then no more FF.

    The Firefox [https://support.mozilla.com/en-US/kb/Page+Zoom Page Zoom] feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox, as with some other browsers.
    Try the Default FullZoom Level extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

  • How to calculate AGE from two different date fields

    hi
    I need to calculate AGE from two different date fields.
    Can some help me how to do, when i try to do substraction formula it is showing error.
    Thank You
    Manu

    Manu wrote:
    Hi
    Both fields are in date format only, i need to calculate no . of days between two different dates
    Thanks
    ManuThe reason for the question about the format of the column is because the simplest solution only works on DATE columns. Others have mentioned this here, but if you want the difference between two date fields, you can use this formula:
    TIMESTAMPDIFF(SQL_TSI_DAY, date_column1, date_column2)
    The above being said, you still didn't tell me what you did, or what error message you received. So again, if the above formula didn't work, what did you do? Where did you put the formula? What was the exact syntax you used? What was the error message you got?
    Please don't make us work more than we need to. Answer all the questions in your next post. Thanks.

  • How to calculate age in SQL?

    I have a table with DATE as one of the column.
    How do I calculate age?
    Thanks in advance
    -Shilpa

    michaels2 wrote:
    TryWell it still leaves leap year question open. If person was born on February 29, how old is that person on February 28 of a non-leap year? Your code considers it imcomplete year:
    SQL> var dob varchar2(20)
    SQL> exec :dob := '19960229';
    PL/SQL procedure successfully completed.
    SQL> select trunc ( (to_number (to_char (to_date('20090228','yyyymmdd'), 'yyyymmdd'))
      2                  - to_number (to_char(to_date(:dob, 'yyyymmdd'),'yyyymmdd'))
      3                  )
      4                / 10000)
      5            as "Age of Child"
      6    from dual
      7  /
    Age of Child
              12SY.

  • How to calculate Age in BEx query

    Hi,
    I need to calculate age in years based on person's date of birth and the key date that user of the report will enter.
    So, basically in my query I already have date of birth characteristic from 0PERSON InfoObject. I created ZAGE key figure and added it to the query that I would like to populate with person's age.
    So I know I have to enter some code in CMOD for calculated key figure ZAGE to get calculated based on birthdate and key date that user enters. Can somebody help with the code?
    thanks

    Hi,
    The variable should be in "Date" dimension. I have missed one important information in earlier mail.
    The processing type of the variable (user entry date) should be of "Customer Exit' and dimension (in last tab) should be "Date".
    By selecting this dimension, the variable input help screen also appears in calendar format to help user to select date instead of writing it in variable input.
    No need to write any custom code for this variable. We are selecting the "Customer exit" processing type to get Date dimension. In Normal user entry variables we can't get date & time dimension.
    "Ready for Input" should be selected so that user can enter date.
    I hope you can solve your issue now.
    Thanks for your feedback.
    Regards,
    Arun Thangaraj.
    Edited by: Arun  Thangaraj on Oct 8, 2008 8:48 AM

  • How to calculate sum of the fields in adobeforms

    Hello Experts
    can  i know how to calculate sum of fields in the adobe form.  I have few fields to be summed in total field.
    Regards

    Hello Surendra,
         Suppose you are having 4 fields and the 4th field is the TOTAL field.
         Write the below Javascript on the Initialize event of TOTAL field as shown below.
    Remember that if you use just "+" sign without Number() or ParseInt() function it acts like String Concatenation.
    this.rawvalue = Number( this.parent.field1.rawvalue ) +
                          Number( this.parent.field2.rawvalue ) +
                          Number( this.parent.field3.rawvalue ) ;
    You can also write is as shown below.
    this.rawvalue = parseInt( this.parent.field1.rawvalue ) +
                             parseInt( this.parent.field2.rawvalue ) +
                             parseInt( this.parent.field3.rawvalue ) ;

  • How can I turn off the ink level monitor on a HP Photosmart 7520?

    I have put new cartredges in my printer and it shows the ink levels are low. Can i go into settings and turn that off? If so how?

    Hey @NEVER-SATISFIED ,
    Thank you for taking the time to post on the HP Forums today! Hope you enjoy the experience.
    No you are not able to turn of the ink levels notifications, however; if you have just purchased new ink and it shows that the ink levels are low you can call HP Technical Support.
    If you are in Canada or US call 800 474 6836, or you can Contact HP Worldwide.
    HP printers generally have a 1 year warranty from their purchase date, you can verify the warranty using the following link if you would like; warranty check.
    I hope this helps. Let me know.
    I worked for HP.

  • How to add tabs in the top level navigation

    Hi,
    We are using EP 6.0 sp2 and patch 39, kindly suggest how to add additional tabs to the existing tabs on the top level navigation.
    Swetha

    Hi Swetha,
    Please have a look on following links,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cc/1f6f3ee3c33f7ce10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4e/3e703e632c7937e10000000a114084/frameset.htm
    Regards,
    Vishal

  • SSRS - How to calculate porcent on the same fields

    Hi,
    I have a problem with my Report 
    I have a table like this:
    Description | Mounth
    [Description] | Sum(Valeur
    Pourcent | WHAT I NEED
    When i execute this on my web portal, i have this result:
    Description | January | February | March ...
    Desc 1        | 400       |   500       |   700 ...
    Desc 2        | 325      |   452        | 658
    Porcent       |              |                |
    I don't now how to calculate %. 
    For January i want to do 474/413, for february 1534/1457.
    But i dont know what i need to do in my tablix, in the cell "[WHAT I NEED]" to do this...
    Can you help me.
    SOrry for my bad english.
    Thanks for your help.
    Flo

    Hi sbenett,
    According to your description, you have  two rows in your matrix. Now you want the value in the second row divide the value in the first row. Right?
    In this scenario, since you only have tow rows in your matrix, we just need use the last value divide the previous values in the column group. So we can insert a row outside of group (row group), try the following expression in the cell: =last(Fields!column.Value)/first(Fields!column.Value)
    We have test this scenario in our local environment. Here are screenshots for your reference:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to hide Age in the Event Text of Reminder of Dates iview of MSS

    Hi All,
    Could you any one let me know the process or steps to hide the age in the event text of the iview Reminder of dates.
    Currently along with Date of Birth the age is shown in with in brackets.
    I want to hide the age which is shown. I belive this has to be done using SPRO configs, but not sure of exact steps.
    Any help is really appreciated
    Thanks
    San

    No one else has this problem or knows of a solution? *weeps quietly*

  • How to enable Rosetta at the system level using the command line?

    I need to find a way to enable Rosetta at the system level (e.g. all users) using the command line. When Rosetta is enabled, the following entry is created in ~/Library/Preferences/com.apple.LaunchServices (run defaults read com.apple.LaunchServices)
    LSPrefsFatApplications = {
    "com.apple.Safari" = (
    <00000000 009a0003 00010000 c323458f 0000482b 00000000 00000023 0000727b 0000c2b0 8b4e0000 00000920 fffe0000 00000000 0000ffff ffff0001 00040000 0023000e 0016000a 00530061 00660061 00720069 002e0061 00700070 000f0014 00090053 00650072 00760065 00720020 00480044 00120017 4170706c 69636174 696f6e73 2f536166 6172692e 61707000 00130001 2f00ffff 0000>
    Does anyone know what the data shown here is? It doesn't change when Rosetta is turned off and then back on. It also doesn't change between user accounts (e.g. joe's com.apple.LaunchServices.plist has the same value as jane's).
    Will it be possible to run defaults in a way that makes this change work for all users of the computer?

    I am asking about the option to run in non-interactive modeIt cannot be done. Check "Oracle® Applications Maintenance Utilities Release 11i (11.5.10.2)" manual for more details.

  • ALV Tree - how to put checkbox on the node level?

    Hello everyone!
    I have an AlvTree and I have special column named SEL. That column contains checkboxes. I want to put additional checkboxes at the node level, I need them to create select all option.
    In other words I must somehow create something similar to do_sum option. DO_SUM works for numeric columns, the sum of all rows in current node appears at the top level. So I must do the same but checkbox.
    Are there any ideas?
    Here is my code of creating the tree.
    DATA: g_tree9001 type ref to cl_gui_alv_tree_simple.
    " Here I fill fieldcat...
    create object g_tree9001
          EXPORTING
            i_parent                    = g_doc_cont
            i_node_selection_mode       = cl_gui_column_tree=>node_sel_mode_single
            i_item_selection            = 'X'
            i_no_html_header            = 'X'
            i_no_toolbar                = ''.
    call method g_tree9001->set_table_for_first_display
          EXPORTING
            i_save              = 'A'
            is_variant          = ls_variant
          CHANGING
            it_sort             = gt_sort9001
            it_outtab           = gt_tree9001
            it_fieldcatalog     = gt_treefcat9001.
    My output table gt_tree9001 has sthe following structure:
    BUKRS, KTEXT, SEL, SWERK.
    My sort table gt_sort9001 has 2 rows. Sorting by BUKRS and KTEXT.
    My tree looks like this:
    BUKRS/KTEXT  --- SEL --- SWERK
    +bukrs1 ------------------------------
      -- ktext1 ---  X --- swerk1
      -- ktext2 ---  X --- swerk2
    +bukrs2 ------------------------------
      -- ktext3 ---  X --- swerk3
    I want to get:
    BUKRS/KTEXT  --- SEL --- SWERK
    +bukrs1 ----------X----------------
      -- ktext1 ---  X --- swerk1
      -- ktext2 ---  X --- swerk2
    +bukrs2 ----------X----------------
      -- ktext3 ---  X --- swerk3
    Appreciate any help!

    Hi ,
    Check the below threads, it may give some idea to get check box in the node .
    [LINK1|Check box on left navigation of ALV tree;
    [LINK2|Checkbox ALV Tree CL_GUI_ALV_TREE;
    Regards,
    Saravana.S

Maybe you are looking for

  • Issue with building solution file using devenv.exe

    Hi, I am facing an issue while building my solution file (developed in Visual Studio 2010) using devenv.exe from command line. The error is as below. C:\Code\trunnk\common\Controller\Controller.vcxproj : error  : The expression "[System.IO.Path]::Com

  • Different versions of 10.5.4

    This may seem silly what is the difference in 10.5.4 update and the 10.5.4 combo update other than the size of the file. JJ

  • Third-Party Wireless-G Adapter w/10.4.2?

    Any good recommendations? As noted in a different thread I picked up a Belkin 7000, but I cannot get it to be recognized as an Airport card (Belkin says they do not support Tiger at all, but I've read reports from people who say they've gotten it to

  • Unzip (a zip file that has pdf files and a csv)

    Here is my requirement: Receive a zip file (that contains PDF files and a CSV file) in BizTalk Each record in CSV has a field which identifies the PDF files (by pdf file name) associated with it     For Example - record id on each row in CSV file ide

  • Purchasing After Effects

    I have a Mac OSX 10.5.8 and I am having trouble finding the right version of AE to purchase.  The latest version of After Effects is not compatible with my system and I am unable to find earlier versions to purchase.  Can someone please help?  Do I n