Page 1 of 1

SQ01/Infoset Query suppress zeros

PostPosted: Wed Dec 07, 2016 6:57 am
by rpinxt
Can it be done in an easy way?

So when we run the query the output is fine.
Only it also shows lines for which quantities are 0.
Of course the total at the bottom will still be ok, but all these 0 lines are only waste.

Know I can make an extra field which sums the 2 quantity field.
Take that field in the selection screen and when running the report tell it that the new field should not be 0.

But surely there must be a more clever and elegant way?
Some coding or setting maybe in the infoset?
Thanks.

Re: SQ01/Infoset Query suppress zeros

PostPosted: Wed Dec 07, 2016 8:09 am
by Gothmog
In the infoset, in the Extras, in tab Code, add a code section 5 (Record Processing), and check the quantities are not zero.
For example:
Code: Select all
CHECK quantity1 <> 0 OR quantity2 <> 0.

Re: SQ01/Infoset Query suppress zeros

PostPosted: Wed Dec 07, 2016 10:05 am
by rpinxt
Ok, would love to try that.

But what if you not have a section 5....? :shock: :?

I have 1 to 4 and 6 to 13.....wtf...

Re: SQ01/Infoset Query suppress zeros

PostPosted: Wed Dec 07, 2016 10:33 am
by Gothmog
Oh... You're using a logical database, I see.
You could put your code in the GET event of the appropriate node, and use the REJECT [node] instruction to filter out the line.

Re: SQ01/Infoset Query suppress zeros

PostPosted: Wed Dec 07, 2016 10:59 am
by rpinxt
Ok I put the CHECK code in the node for which I took the quantity fields.

But I did not get the part of the reject.

As a second line I put REJECT <nodename> but then you get "xxxx" must be a character-type field error.

Re: SQ01/Infoset Query suppress zeros

PostPosted: Wed Dec 07, 2016 11:15 am
by Gothmog
You need the name of the node between quotes :
Code: Select all
IF quantity1 = 0 AND quantity2 = 0.
  REJECT 'MYNODENAME'.
ENDIF.

Re: SQ01/Infoset Query suppress zeros

PostPosted: Thu Dec 08, 2016 9:22 am
by rpinxt
ahhh I was missing the ' ' around the node name.

Thanks it works perfectly! :)
No more redundant lines in my report.

Re: SQ01/Infoset Query suppress zeros

PostPosted: Tue Feb 21, 2017 5:04 am
by aimeusdietger



It's interesting to see how simple mistakes in coding can bring about multiple errors. I missed = and used - instead and the result was unbelievable.