Formula variable - Maximum Date in result output

Hello Guys,
Scenario -
Data in Cube
*Reseller      Sales Date*
RS1          01.01.2010
RS1          01.01.2011
RS1          01.01.2012
RS2          01.01.2008
RS2          01.01.2009
RS2          01.01.2010
Required Output - Display one record for each Reseller with recent Date.
*Reseller      Sales Date*
RS1          01.01.2012
RS2          01.01.2010
What I did till now --->
Created a Formula and included a Formula Variable (replacement Path ref char - Sales Date) hence I got the date as keyfigure.
Reseller      Sales Date     Sales Date Formula
*RS1          01.01.2010     201,00,101*
*RS1          01.01.2011     201,10,101*
*RS1          01.01.2012     201,20,101*
*RS2          01.01.2008     200,80,101*
*RS2          01.01.2009     200,90,101*
*RS2          01.01.2010     201,00,101*
For the Sales Date Formula (Calculation tab - Calculate result as Maximum) to display the result as maximum.
The issue is that when I remove the Sales Date from Drilldown the Sales Date Formula display X. I was expecting the result row to be displayed i.e  the maximum value for RS1 and RS2.
Can you guide where I am going wrong... or any other method to achieve the above output is appreciated.
-Amit

Hi,
Through replacement path you can achieve this.
On row side put *Reseller.
on Column side create a formula(and  on Aggregation Tab: Exception Aggregation: Last Value, Reference Characteristics: Sales Date)
and there create formula variable and use replacement path.
Details
Type of variable: Formula
Processing By: Replacement Path
Reference Characteristics: Sales Date
Replace variable with: InfoObject
Replace With: Key
Dimension: Date

Similar Messages

  • Formula variable for dates

    Hi gurus,
    I am trying to fill a formula variable of type date via manual entry, but I cannot find which is the correct way to do it. I can introduce any other type of data (amount, prices...) via manual entry but I can´t do the same with dates. Any help about this??
    Thanx.

    Hi Ortiz,
    You can do it like this:
    1. Create one variable based on any date field.
    2. In you query In column create 1 selection, restrict any key figure with this variable (created above). In display property set Hide.
    3. Create 1 formula variable with processing type customer exit and choose dimension as date.
    4. Now in CMOD, write the below code for your formula variable:
    Suppose the source variable name is ZDATE1,
    Forumla var name is ZFinal_date
    Code it like this:
    when 'ZFinal_date'.
    READ TABLE i_t_var_range INTO wa_value WITH KEY vnam = 'ZDATE1'.
            wa_range-low    = wa_value-low.
            wa_range-opt    = 'EQ'.
            wa_range-sign   = 'I'.
            APPEND wa_range TO e_t_range.
    Now u will get the date inputed value in your formula cariable.
    5. Create 1 CKF and do the subtraction in there:
    if ur key figure name is KF1 then type forumal as:
    KF1 - ZFinal_date.
    Hopefully u wil get the desired output.
    Thanks
    Dipika

  • Formula variable for date calculations with date-characteristics (2004s)

    Hi SDN,
    I'd like to calculate the number of days between to date-characteristics. In 3.5, I was used to create 2 formula variables of the type 'replacement path', with 'date' as the dimension indicator. In my formula, I used the 'proces value as date' function for each variable, and I could perform calculations with them.
    I'm trying to do the same in 2004s. However, I can't create replacement path's with 'date' as a dimension indicator. So I use 'number' instead, but it doesn't work: my query shows 'x'.
    I can use the variables that I created using the 3.5 query designer as a workaround. But I hope there is a better solution.
    If other people experience the same problem, please respond. Then I know it's probably a bug.
    Kind regards,
    Daniel

    Daniel,
    Try to look at the formula variables defined before the upgrade and see what is different to the newly defined. I am guessing just the terminology used is different.
    If not the date value might be blank or something for one of the f-variables used. Try to display the formula variable values as KF in the query results and check what it is showing.
    I hope this helps.
    -Bala

  • Formula variable using date char - unable to use conditions

    Hello Experts,
    I am sure I am making a silly mistake here - but after spending lot of time I am unable to rectify this - please help if you can:
    I basically want the report to show only latest employee actions for a selected period (usually month).
    1. I am using formula variable that is based on 0CALDAY and defined as number.
    2. A calculated keyfigure uses this formula variable. Both calculated keyfigure and CALDAY char are included in the report / navigation.
    3. There is a condition defined using calculated keyfigure. No matter what logic I use, I just cannot use calculated keyfigure to filter records on the report. My original idea was to use Top N - 1 with char combination as 'Employee' to get me the latest employee records for each employee.
    Can anyone help spot where I am going wrong?
    Thanks.

    I haven't looked at that, but as a first guess idea- why not use the picker to get a date, then save it as a number of seconds from a given date?
    See:
    dateWithTimeIntervalSince1970:
    Creates and returns an NSDate object set to the given number of seconds from the first instant of 1 January 1970, GMT.
    + (id)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds
    Or you could store it as a string, but I think the number would be easier.

  • Formula variable for date in report

    Hi All,
    I have to display the last date value of a particular date in the report.
    For a better understanding,
    I have Customer, Equipment, Service date, Amount
    In the report, I have to display
    Customer, Equipment, Last Service date, Last Service Amount.
    I have created a formula variable (Formula variable for Service date) for Service date with Replacement path.
    Replace Variable with Infoobject, Replace with Key, Dimension dates.
    And in Key figures, I have created a formula (Last Service date) with Last value in the Aggregation using the "Formula variable for Service date".
    The Last Service date is displayed as 'X' in the report since the Service date is not in the row. I cannot have the service date in the row either (not even by hiding the display).
    Kindly tell me how to rectify this problem.
    Thanks and Regards
    Adhira Anand.

    The X is appearing because, with the drill downs you have added, you have more than 1 date value to choose from when you attempt to aggregate.
    Have you tried using APD instead of exception aggregation?
    Have you built the exception aggregation calculated key figure globally or just locally (i.e. as a structure element)? It must be built globally to work properly.

  • Condition formula variable on date key figure

    Hello, I would be grateful for any help on this
    I want to have a condition that has a user input formula variable
    But the Key Figure on which I want to base the condition is a Date
    And when you create the formula variable it allows only the following Dimensions :
    Amount
    Number
    Price
    Quantity
    ie Date is not one of the allowable Dimensions - is there any way round this apart from an Exit variable ?
    thanks
    Jon

    Hi,
    You have to create a formula variable with replacement path based on the date you want.
    so that you can get the date for calculation.so you can apply condition.
    check the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/03/6ba03cc24efd1de10000000a114084/content.htm
    Regards,
    Ranganath

  • Formula Variable for Date/year not possible

    Hi, I have a query where I want to create a formula variable for a year that I can use in a user exit to populate other variables.  When I go to create a formula variable there is not option for a date or year variable.  I only see Amount; Quantity; Price; Number.  Is it possible just to create a formula variable for a year input without having a year time characteristic in the query?
    Thanks!

    I just ended up creating a Formual Variable as a number.  Thank You

  • Formula Variable: Current Date

    Can somebody let me know the SAP Delievered Current Date Formula Variable Name.
    Cheers!!
    Amit
    9990800302

    Hi.......
    As already said....you can use 0F_ADAY.....
    Usually global variables (as formula) are available for every query (and not specifically to a single provider)...in addition, you can find all the formulas when you build a new object (new formula) in your query (you can choose from formula hierarchy)...
    Check this..........
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/324de5a1-0201-0010-dc9a-a093cde87bb5
    Customer Exit.......
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
    Regards,
    Debjani.........
    Edited by: Debjani  Mukherjee on Oct 29, 2008 4:47 PM

  • Is it possible to use charecterestic used in formula variable

    Got a boolean logic in a formula of the  structure in BEx, i could create a formula variable for date , it works .However, i have to bring payment method into the logic ,( e.g.. if the payment method is 'C'-weekly then late payment logic is different then if it is not weekly) , Any idea how to achieve this in BEx.

    You could create a key figure that always displays a fixed value example 1.
    You then restrict this individual key figure to payment method C.
    The key figure is now only 1 for payment method C.
    In your calculation you now say: if key figure = 1 then ... else ...
    If statements are not directly possible, you can only do if statemements indirectly by a similar formula:
    (key figure = 1) * value
    if key figure is one -> result of (key figure = 1) is 1
    1 multiplied by value = value
    if key figure is not one -> result of (key figure = 1) is 0
    0 multiplied by value = 0
    You now have an indirect if clause.
    Please assign points if this solved your problem,
    Best Regards,
    Filip

  • Calculated Key figure and formula variable issue - Urgent

    Hi,
    I have created a formula variable on dates. When I run this locally it returns results. Now I have created a calculated key figure on this formula variable. It is not returning any results. Any idea on why this is happening.
    Thanks,
    Kal

    Hi Kal,
    Can you paste your Formula & Calculated Keyfigure calculation.
    If possible give information on ur formula variable ( processing by , charactesristic , replace variable with ( if it is replacement path ) , Dimension id )
    Regards,
    SRIKANTH

  • Date formula variable in BEx output

    Dear All,
    In Bex , I made a formula variable F_CURDATE and used it in formula. I fill it with current date
    l_s_range-low = sy-datum.
    My value in BEx comes 201,40,604. This is 04 Jun 2014.
    Why isn't it coming in date format. I then, used data function [date]'process value as date. The output shows value X.
    How can I show  date in date format in BEx?
    Regards,
    cleo

    Hi Cleo,
    The bit l_s_range-low = sy-datum must be coming from the customer exit code, right?
    And should this code not be used for populating a cust exit variable? How do you populate sy-datum to a formula variable in the query? Pls correct me if i m missing something in your question.
    However if it is a formula variable on 0CALDAY, there are standard SAP variables giving current date.
    Can you not use them in your query as per your requirement?
    Regards,
    Srilakshmi B

  • Date Difference between to date formula variable

    Hi Expert,
                    I have create two formula variable one for Document Date and another one for Goods reciept date
    and through formula variable I am subtracting these two formula variable and getting the no. of days between
    document date and GR date.
    This Shows me the correct value for one document date because i am filtering my query according to document
    date,
    while i am giving the date range for document date is shows me incorrect result. bucause document date formula
    variable contains only one date.
    Eg. i am giving the document date range like 01.02.2010 - 28.02.2010.
          In document date formula variable it contains only 01.02..2010 and GR date formula variable it contain correct
    value, thats why the date difference is incorrect because those PO which has PO date like 12.02.2010 for that Doc
    formula variable bring the same date like 01.02.2010.
    Please tell me the solution
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                     Actually i have created two formula variable on for PO date and another for GR date
    and i've restrict the query through PO date.
    while i am taking the single PO date in Selection parameter it showing me correct difference
    eg: Selection Parameter for PO: 01.01.2010
    But while i am taking the date interval for PO date
    eg: 01.01.2010-30.01.2010
    PO No: XXXXX123 , Doc date: 01.01.2010 GR date: 7.01.2010 then date difference is : 6
    PO No: XXXXX432, Doc date: 03.01.2010 GR date: 8.01.2010 then date difference is : 7 but it is 5
    Thanks and Regards
    Lalit Kumar

  • BW - problem with formula variable (date format)

    Hi,
    (sorry if I'm using different term than yours.. this is my 2nd query.. still new with BW)
    I need to create 1 query: Support Message Aging Report.
    Basically it will have 5 columns: Not Due, 0 Day, 1 Day, 2-10 Days, >10 Days.
    and 1 input selection is: key date.
    the formula is: number of aging day = key date - due date.
    I have no issue on the 1st and 2nd column. For that I just create 1 customer exit.
    My problem is on how to separate the over due support message by day (due date < key date).
    I tried create 2 formula variable for key date and due date. Then from these 2 vars, I can get the number of days.
    Problem comes when the calculation is cross month/year. I suspect maybe because the return from the formula var is in number format and not date... yyyymmdd. Then, I change the dimensions from number to date.. it is working for key date.. dd.mm.yyyy.
    but for the due date, I got problem... it keeps give me warning saying: value 'D' invalid for property dimension of element etc.///
    below are details for both formula variable.. please advice which area should I fix or maybe you can suggest any good idea for my query.. thanks so much
    1. ZKEYDATE - customer exit (value  input data) - dimensions date - NO ISSUE (OUTPUT: dd.mm.yyyy)
    2. ZDUEDATE - replacement path (ref char ZBW02C08) - replacement rule: infoobject, key - dimension date - GOT WARNING...
    ZBW02C08: contains due date and the type is date: yyyymmdd

    If I were you, I'd try two things:
    best way - have the infoprovider changed to have a new key figure for the number of days difference
    - to do this with formulae (especially crossing months and years - what about leap years) is hard to maintain and develop
    other way - make a virtual key figure - i did this once but I forget how exactly. There's a userexit or BADI somewhere which can be used for this.
    Either of these ways allows the calculation to be done in ABAP itself where date1 - date2 gives you the number of days difference.
    By the way though, this is in the wrong forum. I'd bet if this was in a BI forum, you'd have an answer already.

  • Aggregrating Results of Formula Variable

    Hello All,
      I have created a key figure using a formula variable to subtract 2 dates in BEx 3.5 front end.  The formula works great as long as I have the 2 dates in my drilldown...if I  don't, I get an x as the result.  I want to show the average of this formula on a monthly basis without showing the details of the dates.
    Any Ideas??
    Thanks!!
    Tina.

    Hi Brock,
    Its possible, but I haven't tried as requirements didn't imply.
    More simpler idea is why don't you use a flat file loading through the IP to Info providers?
    Or even more better option is why don't you adapt to Virtual Info providers?
    For your suggested custom table using custom transaction, we can surely make it. Its possible in SE93. Try this transaction code. It must definitely help.
    Thanks,
    Arun Bala G
    Edited by: Arun Bala G on Jan 11, 2010 2:16 PM

  • Bex : Get KF result in a formula variable

    Hi,
    I'd like to get the global result of a Key Figure into a formula variable but i see no way to do it...
    This is to use this variable in an exception so as to color the individual results in comparison with the result caught in the variable...
    if u have any idea.
    Thanks.

    Hi,
    Try using SUMCT, SUMGT,SUMRT which are there in data functions in query designer.
    You need to first create formula and then use SUMCT,SUMGT, SUMRT.
    Hope it helps.
    Praveen Tati

Maybe you are looking for

  • Can I recover iWeb files from MobileMe?

    Migration Assistant hasn't been very good to me over the years and when I moved from my old iMac to my Intel iMac I had to do all the transferring of files by hand - painful... and not so effective as it turns out. Somehow I lost the base files (not

  • Error in the programme

    Could you please tell me what is the error in below programme? I tried to compile this without importing javax.swing.JOptionPane. /** This application programme displays Welcome to Java! * in a message dialog box. //import javax.swing.JOptionPane; pu

  • I have downloaded itunes 64bit but when I open it, it says I am not connected to the internet

    I downloaded itunes 64bit for windows and it downloaded sucessfully.  However, when I try to do anything like connecting to the store, I get a message that I am not connected to the internet.  Can someone help me with this problem?

  • Retreiving a vector....

    Hi All, I am trying to display all objects from a vector. My program seems to be adding elements no problem but when I try retrieve them I am getting the memory address. I am creating a new object each time but it still doesnt seem to retrieve the co

  • Model Class Assignment & Polling in BPEL

    Hi, We are currently stuggling with the following issues:- BPEL We are need to know, how to assign the elements of soap body to a model class and then that model class to session bean in bpel flow, visa-versa. Polling We are using 'Oracle Bpel Manage