cancel
Showing results for 
Search instead for 
Did you mean: 

If Else Condition in Query

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

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

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

Thanks

Former Member
0 Kudos

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.

Pravender
Active Contributor
0 Kudos

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).