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

If Else Condition in Query

Hi,

I am trying to use the following condition in my Query:

If Planned Hours = 0 ; Over Time = 0

Else OverTime = Actual Hours - Planned Hours.

Please advice on how can I acheive this using the formula in Query.

Thanks

Deepthi

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2009 at 02:35 AM

    Hi Again,

    You can create a formula for over time as below

    Lets say the names of Planned hours - Ph, Over time - Ot, Actual Hours - Ah

    Ot formula definition is

    (Ph==0)0 + (Ph>0)(Ah-Ph).

    And on this formula you can then define exception aggregation in the aggregation tab.

    Exeption aggregation 'SUM' and reference characteristic ' 0CALDAY '.

    Hope it helps,

    Best regards,

    Sunmit.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi

      You can make conditional calculations using Boolean operators An expression in the form

      IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form

      <Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>

      In ur case,

      (Planned hour == 0) * 0 + NOT (Planned hour == 0) * (Actual Hours - Planned Hours).

  • author's profile photo Former Member
    Former Member
    Posted on May 26, 2009 at 07:18 AM

    HI,

    Try this way....In The formula for Over time....

    (Planned Hours=0)*0 + (Actual Hours - Planned Hours)

    Thanks

    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.