I need to do the following:
In this example, the data is bad but we need to account for it as best we can.
The ofe_hourmeter1 is like the odometer in your car. There is no way that your odometer reading on 2/25 can be greater than your odometer reading on 2/28.
We are doing calculations on beginning hour meter read and ending hour meter read so the calculation in the report is 5317 – 5319 = -2.
So, I think the answer is to show the result of the calculation only if it is a positive number. If it is a negative number, then the difference will be 0.
This is the formula I have so far:
IF COUNT ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})> 1
THEN MAXIMUM ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})
- MINIMUM ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})
ELSE
IF COUNT ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber}) = 1
THEN {work_order_test;1.Meter}
ELSE
SUM ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})
Now I know I have to put another grouping with the invoice date and a if statement in there to get the max date ( if ?p_Periodto (my invoice end date) > ?p-Periodfrom (my invoice begindate))>0 then do the above with an invoice grouping. I am having a hard time getting the grouping and the date part to work. The meter needs to be in the invoice grouping also; it is in another group equipment. I also have to account for duplicate dates - the I have to take the first of the dup date if the meter is the same and then do my formula above with in the invoice grouping.
INV DATE INVOICE# METER
1/31/2013 SH300014981 2287
1/31/2013 SH300014997 2287
1/31/2013 SH300014998 1919
3/14/2013 SH300015449 2420
I need to get the difference of the meter where the bottom date (3/14/2013) is greater than the previous date (1/31/2013), and grabing the max meter of the 1/31/2013 date - do the calculation if the result is > 0 the the result, if it is <= 0 then the meter is to be 0.
I hope I explained this well enough - it's confusing to me also! I need this soon - I have been working on it all week with no luck.
In this example, the data is bad but we need to account for it as best we can.
The ofe_hourmeter1 is like the odometer in your car. There is no way that your odometer reading on 2/25 can be greater than your odometer reading on 2/28.
We are doing calculations on beginning hour meter read and ending hour meter read so the calculation in the report is 5317 – 5319 = -2.
So, I think the answer is to show the result of the calculation only if it is a positive number. If it is a negative number, then the difference will be 0.
This is the formula I have so far:
IF COUNT ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})> 1
THEN MAXIMUM ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})
- MINIMUM ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})
ELSE
IF COUNT ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber}) = 1
THEN {work_order_test;1.Meter}
ELSE
SUM ({work_order_test;1.Meter}, {work_order_test;1.EquipNumber})
Now I know I have to put another grouping with the invoice date and a if statement in there to get the max date ( if ?p_Periodto (my invoice end date) > ?p-Periodfrom (my invoice begindate))>0 then do the above with an invoice grouping. I am having a hard time getting the grouping and the date part to work. The meter needs to be in the invoice grouping also; it is in another group equipment. I also have to account for duplicate dates - the I have to take the first of the dup date if the meter is the same and then do my formula above with in the invoice grouping.
INV DATE INVOICE# METER
1/31/2013 SH300014981 2287
1/31/2013 SH300014997 2287
1/31/2013 SH300014998 1919
3/14/2013 SH300015449 2420
I need to get the difference of the meter where the bottom date (3/14/2013) is greater than the previous date (1/31/2013), and grabing the max meter of the 1/31/2013 date - do the calculation if the result is > 0 the the result, if it is <= 0 then the meter is to be 0.
I hope I explained this well enough - it's confusing to me also! I need this soon - I have been working on it all week with no luck.