Count lines that duplicated line
darmaa
Member Posts: 65
Hello All,
I need to count lines of duplicated some entries as one line grouping by ID. It is additional customized table. Please see attached file. This report cant to use any grouping. So I need to use filter. Please any solution
My filter cannot unique line:
Entry.SETFILTER("Number",'91.7');
IF Entry.FIND('-') THEN REPEAT
Numbers[1]:=Entry.COUNT(); //Numbers[1]+=1;
UNTIL Entry.NEXT=0;
I need to count lines of duplicated some entries as one line grouping by ID. It is additional customized table. Please see attached file. This report cant to use any grouping. So I need to use filter. Please any solution
My filter cannot unique line:
Entry.SETFILTER("Number",'91.7');
IF Entry.FIND('-') THEN REPEAT
Numbers[1]:=Entry.COUNT(); //Numbers[1]+=1;
UNTIL Entry.NEXT=0;
0
Comments
-
Hmm, I am not sure I know what you are trying to do...
Are you trying to count the number a lines with 'aaaaa' and the number of lines with 'bbbbb'? Or are you trying to count the number of lines with a certain Number, like 91.7?0 -
I`m trying to count 'aaaa' and 'bbbb' lines0
-
darmaa wrote:I`m trying to count 'aaaa' and 'bbbb' lines
Use proper temporary Instance of a table and count the number as below :TempInstance.DELETEALL; // Mark Record Variable Instance Temporary in its property windows IF YourMainTable.FINDSET THEN BEGIN REPEAT TempInstance.RESET; TempInstance.SETRANGE("No.",YourMainTable.ID); IF NOT TempInstance.FINDFIRST THEN BEGIN TempInstance."No." :=YourMainTable.ID; // ID Saved in No. column TempInstance."Unit Price" :=1; //Number Saves in Unit Price Column TempInstance.INSERT; END ELSE BEGIN IF TempInstance.GET(YourMainTable.ID) THEN BEGIN TempInstance."Unit Price" :=TempInstance."Unit Price"+1; //Number incremented if duplicate ID Found TempInstance.MODIFY; END; END; UNTIL YourMainTable.NEXT =0 END; TempInstance.RESET; IF TempInstance.FINDSET THEN REPEAT MESSAGE('ID :- %1\ Number :- %2',TempInstance."No.",TempInstance."Unit Price"); UNTIL TempInstance.NEXT =0;Now or Never0 -
Thanks, navuser1
It is solved.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
