Skip to Content
0
Former Member
Jan 16, 2008 at 02:26 PM

How to put this condition in Query

33 Views

Dear experts,

I have a scenario where in the calculation should be dynamic between key figures in query

For example i have a

Target Cost and Actualcost1, Actualcost2, Actualcost3

i need to findout the variance between the Target and Actual

but the catch is that i need to findout the variance with the latest actual cost

1. ) Target cost = 100

Actual cost1=10, Acutal cost2=0, actual cost3=0

then the formula should be Actual cost1-target cost

2. )But if

Target cost =100

Actual cost1=10, Actual cost2=5, Actual cost3=0

then the formula should be Actual cost2- Target cost

3. Target cost =100

Actual cost1=10, Actual cost2 = 5, Actual cost3= 15

then the formula should be Actual Cost3-Target cost

How to achieve this

Thanks and regards

Neel