Can anyone help me troubleshoot a problem I'm seeing with an array calculation?
I'm using CR9 PRO hitting an Access Database and looking at 4 time fields.
All formulas are evaluated at the Details level. I have 3 equations that calculate the time gap between the bench mark AO Time field which appears in each gap equation, and one of the other 3 time fields in each respective equation. Therefore I end up with 3 gap calculations for each record: @STgap, @MTgap, @TTgap. An example formula would be: @STgap = timevalue((...ST_Time)-(...AO_Time)) The underlying database does not have time stamps for each column on every record, but there will always be a result for at least one of these 3 formulas. I placed all 3 of these values into the details section and each formula is calculating correctly.
Next, I'm trying to use an array to capture the value of each of these 3 gaps, and determine the largest time gap among these results, FOR EACH RECORD.
Here is my Array:
//@TradeGap
local timevar stg := {@STgap};
local timevar mtg := {@MTgap};
local timevar ttg := {@TTgap};
local timevar array TradeGap := [ttg,stg,mtg];
maximum(TradeGap)
I used "local" variables so would reset values when they went to the next record of data. My array is working properly when I only include 2 of the 3 gap (MTG and STG) formulas, but fails when I include the TTG variable. What happens on the screen is that I always get the correct answer for a larger time gap between MT or ST, but when TTgap is the largest value, then all my result fields are blank.
Please tell me I'm doing something bone-headed or typed something wrong.
Thanks!
I'm using CR9 PRO hitting an Access Database and looking at 4 time fields.
All formulas are evaluated at the Details level. I have 3 equations that calculate the time gap between the bench mark AO Time field which appears in each gap equation, and one of the other 3 time fields in each respective equation. Therefore I end up with 3 gap calculations for each record: @STgap, @MTgap, @TTgap. An example formula would be: @STgap = timevalue((...ST_Time)-(...AO_Time)) The underlying database does not have time stamps for each column on every record, but there will always be a result for at least one of these 3 formulas. I placed all 3 of these values into the details section and each formula is calculating correctly.
Next, I'm trying to use an array to capture the value of each of these 3 gaps, and determine the largest time gap among these results, FOR EACH RECORD.
Here is my Array:
//@TradeGap
local timevar stg := {@STgap};
local timevar mtg := {@MTgap};
local timevar ttg := {@TTgap};
local timevar array TradeGap := [ttg,stg,mtg];
maximum(TradeGap)
I used "local" variables so would reset values when they went to the next record of data. My array is working properly when I only include 2 of the 3 gap (MTG and STG) formulas, but fails when I include the TTG variable. What happens on the screen is that I always get the correct answer for a larger time gap between MT or ST, but when TTgap is the largest value, then all my result fields are blank.
Please tell me I'm doing something bone-headed or typed something wrong.
Thanks!