I could use some help on following code
Need a list of items where the (max stock - stock)<0
I tried =NL("Rijen";"Item";;"Max stock";"NF(;""Max stock"")-NF(;""Stock"")<0)")but something is wrong
thanks for any help
6 comments
-
Jet Reports Historic Posts Hi Jan,
The problem with your filter (other than having an extra ")" after the 0) is that your formula is going to return TRUE or FALSE and it's going to compare that to the value of the filter field (Max stock in this case) which is never going to match. So it might be better to change it to a calculated filter field like this:=NL("Rijen";"Item";;"IF(NF(;""Max stock"")-NF(;""Stock"")<0;""1"";""0"")","1")
This calculated filter should return "1" if your formula is true and "0" otherwise. Then the filter value is "1" so it should keep the records you want. Does this help?
Regards,
Hughes -
Jet Reports Historic Posts Hughes,
For now I get an error in the formula :(=NL("Rijen";"artikel";;"IF(NF(;""Maximale voorraad"")-NF(;""Voorraad"")<0;""1"";""0"")";"1")
I have update the code to reflect the Dutch -
Jet Reports Historic Posts Hi Jan,
What error you getting? What happens when you do Jet -> Debug?
Regards,
Hughes -
Jet Reports Historic Posts I think Jan gets an Invalid field error. At least, that's what I got when I tried the function. Adding an "=" in front of the IF solved the issue for me.
=NL("Rijen";"artikel";;"=IF(NF(;""Maximale voorraad"")-NF(;""Voorraad"")<0;""1"";""0"")";"1") -
Jet Reports Historic Posts Oops, that is my bad. Calculated filters and filter fields always have to start with an =. That is what Jet uses to know whether something needs to be calculated. That was just me being sloppy. Sorry about that!
Regards,
Hughes -
Jet Reports Historic Posts Hans was correct!
this will bring my Jet skills to the nex level ;)