Hi! Is it possible to set a range in a flowfield(sum) depending on the contents of a flowfilter? What I try to do is the following: I have a flow filter called “Clientcode”. I am using a flowfilter here because the needed clientcode can change from time to time. I also have two flowfields. In one flowfield I want to calculate the sum of a field in another tabel with a filter on clientcode (from the flowfilter). So I want to filter the table with the flow filter. That’s OK, it works fine. In the other flowfiled I want to calculate the sum of al the fields in the other table that have another clientcode (all execept the one given in the flowfilter). This does not work! In code it would be: the first: SETRANGE(X,value), or SETFILTER(x,’=%1’,value) The second would be: SETFILTER(x,’<>%1’,value); In short: How can I implement this lasr filter in a flowfield when I want to use a flowfilter as value? Anolis Sittard Netherlands
I doubt that’s possible, but then you need to look for alternative solutions. Do you manage the FlowFilter yourself in code, or is it controlled by the user from Shift+F7? If you control it in code, you could create a second flowfilter you assign like this: SETFILTER(ClientCode,’VIP0007’); SETFILTER(NotClientCode,‘<>’+GETFILTER(ClientCode)) Then in the other flowfield you need to set a checkmark in ValueIsFilter. (Not tested, but should work?) Otherwise you simple instead of showing ClientSum and OthersSum you could show Sum and HereofClientSum. Hard for me to say if it an option in your case. Regards Peter Edited by - pdj on 2001 Oct 20 12:45:25
Hi, A workaround might be to make the second flowfilter WITHOUT a clientfilter, so all … of all clients are counted. In the form, report or whatever you fill the Source expression with ‘Flowfilter client - Flowfilter all clients’. Mazzel.
Hmmm… Very strange requirements, but… Create function in table which returns desired value: Table: “Some Main Table” named as “MainTable” FlowFilter: “Client Filter” FlowField: Amount —START----- Function “GetValueExceptFilter() : Decimal” //Function is based on current record //Locals: MainTable1 (another instance of “Some Main Table”) MainTable1.COPY(Rec); MainTable1.SETFILTER(“Client Filter”, ‘<>’ + GETFILTER(“Client Filter”)); MainTable1.CALCSUMS(Amount); EXIT(MainTable1.Amount); —END----- In any form/report place control with “Source Expression” “GetValueExceptFilter()” Business Applications Programmer Sertified Navision Developer SIA “Sintegra” Latvia
Just a comment: If the field is made as a Function (as suggested by Alexei) or as a calculating SourceExpression (suggested by Andre) you lose the possibility for the user to set a filter on the field. Regards Peter Edited by - pdj on 2001 Oct 20 12:45:04