Hi, can you confirm that i understand correctly following:
1. Table1 definition:
field1
field2
field3
field4
key: (field2, field3) sumindexfield: field4
2. Code to calculate field4 total sum:
setcurrentKey( field2, field3 )
setfilter( field1, value1)
setfilter( field2, value2)
calcsums( field4 )
message( Table1.field4 )
Does this code outputs correct Table1.field4 total sum?
The key of the sumindex field didn't get filters on field3, and "field1" which is outside of the key got also a filter. Does it return correct sum for me?
0
Comments
Nav return good sum, only in case when Field1 is in PrimaryKey of that table, in other case Nav give You error that You use wrong key for calcsum.
Regards
Yes it does. I made an simple example to check it, when I saw JedrzejT answer:
Inserted data:
No1 No2 No3 Value
1 1 1 100,00
2 12 10 100,00
3 3 3 100,00
100 1 1 1 000,00
Returned Value:
200
Have a good day...