mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 07:36:54 +01:00
knowledge(performance): grouped query (Count + ColumnFilter = HAVING) for distinct values and duplicates (#215)
Adds use-grouped-query-for-distinct-values-and-duplicates with good/bad samples, a worklist cue in al-performance-review, and registration in the performance review-fixtures override. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ef121b38d7
commit
4405c97c57
5 changed files with 110 additions and 1 deletions
|
|
@ -0,0 +1,21 @@
|
|||
codeunit 50572 "Customer Name Audit"
|
||||
{
|
||||
// The outer loop is unfiltered: one extra filtered Count() per customer.
|
||||
// The question is about the whole table, not about any single row.
|
||||
procedure HasDuplicateCustomerNames(): Boolean
|
||||
var
|
||||
Customer: Record Customer;
|
||||
OtherCustomer: Record Customer;
|
||||
begin
|
||||
Customer.SetLoadFields(Name);
|
||||
if Customer.FindSet() then
|
||||
repeat
|
||||
if Customer.Name <> '' then begin
|
||||
OtherCustomer.SetRange(Name, Customer.Name);
|
||||
if OtherCustomer.Count() > 1 then
|
||||
exit(true);
|
||||
end;
|
||||
until Customer.Next() = 0;
|
||||
exit(false);
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue