In Alpha 5 V8 (Build 1965, System addins, Build 3156)I am using the previous() function in a report, based on a primary index in a calc field. Here is what I have in my report for this function:
unit1use = unit1-previous("unit1")
I have also used
unit1use = unit1-(previous("unit1"))
just in case there is an ordering (parsing) issue in the function.
where unit1use is a calculated field in the report, unit1 is the current value, and I need the difference between the two (current value is guaranteed to be larger than the previous record value for unit1).
The primary key is numeric (integer) and is used as the primary index.
When I allow the report to use/select all records, the previous () function works correctly (i.e., first to last record), all calc unit1use values in the report are correct. However, if I select (based on a key/primary index), say two records that are in sequence (primary key values selected are 244, 245, and in logical sequence), the values are incorrect. The calc actually produces the value of the field in previous record, not the difference between the field in the two records.
This function worked as expected in Alpha 5 V1, but doesn't appear to work as expected in the above scenario.
I intend to try this also in Alpha 5 V9, but need it to work in V8 (or find out if I am not using the function correctly, or not setting some conditions required.
Any suggestions or similar experiences would be appreciated.
Thanks,
Richard
Additional Info: I should have mentioned that I'm using this within a Set, and that the index (according to the documentation) should be using the primary index by default.
unit1use = unit1-previous("unit1")
I have also used
unit1use = unit1-(previous("unit1"))
just in case there is an ordering (parsing) issue in the function.
where unit1use is a calculated field in the report, unit1 is the current value, and I need the difference between the two (current value is guaranteed to be larger than the previous record value for unit1).
The primary key is numeric (integer) and is used as the primary index.
When I allow the report to use/select all records, the previous () function works correctly (i.e., first to last record), all calc unit1use values in the report are correct. However, if I select (based on a key/primary index), say two records that are in sequence (primary key values selected are 244, 245, and in logical sequence), the values are incorrect. The calc actually produces the value of the field in previous record, not the difference between the field in the two records.
This function worked as expected in Alpha 5 V1, but doesn't appear to work as expected in the above scenario.
I intend to try this also in Alpha 5 V9, but need it to work in V8 (or find out if I am not using the function correctly, or not setting some conditions required.
Any suggestions or similar experiences would be appreciated.
Thanks,
Richard
Additional Info: I should have mentioned that I'm using this within a Set, and that the index (according to the documentation) should be using the primary index by default.
Comment