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,47 @@
|
|||
// One row per customer name that occurs more than once.
|
||||
// Name is a plain column, so it is the grouping key; the ColumnFilter on the
|
||||
// Count column is applied after grouping (HAVING COUNT(*) > 1).
|
||||
query 50570 "Duplicate Customer Names"
|
||||
{
|
||||
QueryType = Normal;
|
||||
|
||||
elements
|
||||
{
|
||||
dataitem(Customer; Customer)
|
||||
{
|
||||
column(Name; Name)
|
||||
{
|
||||
ColumnFilter = Name = filter(<> '');
|
||||
}
|
||||
column(NameCount)
|
||||
{
|
||||
Method = Count;
|
||||
ColumnFilter = NameCount = filter(> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
codeunit 50571 "Customer Name Review"
|
||||
{
|
||||
procedure HasDuplicateCustomerNames(): Boolean
|
||||
var
|
||||
DuplicateCustomerNames: Query "Duplicate Customer Names";
|
||||
Found: Boolean;
|
||||
begin
|
||||
DuplicateCustomerNames.Open();
|
||||
Found := DuplicateCustomerNames.Read();
|
||||
DuplicateCustomerNames.Close();
|
||||
exit(Found);
|
||||
end;
|
||||
|
||||
procedure GetDuplicateCustomerNames(var DuplicateNames: List of [Text])
|
||||
var
|
||||
DuplicateCustomerNames: Query "Duplicate Customer Names";
|
||||
begin
|
||||
DuplicateCustomerNames.Open();
|
||||
while DuplicateCustomerNames.Read() do
|
||||
DuplicateNames.Add(DuplicateCustomerNames.Name);
|
||||
DuplicateCustomerNames.Close();
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue