Skip to Content
author's profile photo Former Member
Former Member

Calculate no days from two dates

Hi,

i want to create a calculated keyfigure to display no of days from two keyfigures ( A & B).

I am using the formula as CKF = b-a ( No of days)

If the value of a keyfigure is zero then system is displaying some odd number. Is there any better way to calculate difference between two numbers.

Regards,

Reddy.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2009 at 09:47 AM

    Hi,

    Say you have two date ranges From_date and To_date. now if both the values are noo zero then the formula (To_date - From_date) would work fine..but if one of the values is zero then you will have to decide upon some value to build the formula.

    1. if To_dtae = 0

    you can take the system date in that case. or the report execution date as To-date and build the formula using some boolean operatos.

    2. if From_date = 0

    here you need to decide the start date as some value of your interest say 01.01.2008 or depending on the transactions of the business data some value.(if you dont have the range value you cannot calculate the days).Apply the boolean operators and calculate the value for days.

    Bhavna.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2009 at 02:36 PM

    Dates are calculated as no of days from a particular date (for SAP it is 01/01/1000 I think).

    If one of the dates in calculation comes as zero, the result is going to be a large no (see above).

    You may want to put a boolean multiplier to your formula to take care of situations where one date is zero. (What really do you want to see in say '20090812 minus zero'? You need to decide that and formulate accordingly.)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.