De-Duplicating Detail Using Sort Keys
At times you'll find you need your NPR report to use a segment with multiples; but not print the multiples.
Lets say you are using the following index for the BAR.PAT.bar.acct detail segment:
bar.acct.insurance.index ?BZIN[ggm,bzIO,bz]
ggm = insurance, bzIO = insurance.order, bz = account
?BZIN["ABC",1,ACCT1]
?BZIN["DEF",2,ACCT1]
?BZIN["JIK",3,ACCT1]
?BZIN["LMN",4,ACCT1]
You want to only print accounts for a particular list of insurance mnemonics.
1^/INSURANCE.LIST["ABC"],
1^/INSURANCE.LIST["DEF"],
1^/INSURANCE.LIST["JIK"],
1^/INSURANCE.LIST["LMN"],
Your select is insurance LI /INSURANCE.LIST.
Your report's output will have more than one account's detail due to the index having some accounts associated with more than one insurance.
To prevent duplicates, I like to set a sort KEY Header on NPR Page 2 for account or whatever, I'm trying to deduplicate. This puts an HKx line on the report picture. Since I don't actually want a blank line on my report every time the sort changes; I use the following LC line attribute on the HKx:
LC=/DONE[@account]+1^/DONE[@account],""
That "" or nil as it is called keeps the line from printing. While the /DONE[@account]+1^/DONE[@account] part tallies up the times we've processed the account.
Next you'll want a LC attribute on your detail line(s):
LC=IF{/DONE[@account]>1 "";1}
The purpose of a line check is to print report lines based on a condition. Our condition is /DONE[@account] less than 1. In plain english, if we've seen the account once before don't print it.

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home