Ignore if double... how is it?
julkifli33
Member Posts: 1,100
i have data like this
200,201,202,203,200,201,204
200 and 201 is double
so the data is become 200,201,202,203,204
ignore if it's double
my code
200,201,202,203,200,201,204
200 and 201 is double
so the data is become 200,201,202,203,204
ignore if it's double
my code
REPEAT
ItemVar := ItemVar + "No." +'|';
UNTIL NEXT = 0;
can someone add something? 0
Comments
-
I usually do the following: find a table with a primary key of integer or code (table integer for instance), declare it as temporary, loop through the data and do an if tmprec.INSERT THEN; This leaves a temp record variable with only unique values that I can use to loop.
But I don't use it to build a text filter. When I need something similar I use either mark or (mainly) temporary records. But it's your choice from that point on.
Hope it helps.0 -
this is not the key field
i want to cacth "item no." from item ledger entry table
but i want to do grouping...
so it is not double...0 -
What I suggested is a way to store the unique values. What you do with them is your choice. I don't understand grouping. If it is for a report you can select a key that starts with item no. and use group sections. If it is for a code part you can loop through the records and for each new record compare the field you want with the previous value. What are you trying to achieve exactly?0
-
because i never use temporary table
so i create variable text = 1024
and then i can filter the table using that variable
but it is lack of length in my case...because there are double entry for filtering
so i think... if it is not double... it can be okay
it is like if you want to filter data using 200|201|202
something like that0 -
julkifli33 wrote:this is not the key field
but i want to do grouping...
crazy.....
how can u grouping until key is not defined for that field?0 -
vijay_g wrote:julkifli33 wrote:this is not the key field
but i want to do grouping...
crazy.....
how can u grouping until key is not defined for that field?
it is only for the filtering.....
item table = 200,201,202,203,204....
item ledger entry table = 200,201,200,200,201,203,202,203,200....
may be transaction like that
so i want filtering by group from item ledger entry table to item table0 -
then what's problem?
either you can insert in temp table or in text var.0 -
vijay_g wrote:then what's problem?
either you can insert in temp table or in text var.
REPEAT
ItemTemp."No." := "No.";
ItemTemp.SETRANGE("No.");
IF NOT FIND('-') THEN
ItemVar := ItemVar + ItemTemp."No." +'|';
UNTIL NEXT = 0;
MESSAGE('%1',ItemVar);
still double
do you know what i mistaken?0 -
because you don't insert your not found record into the temporary table
REPEAT ItemTemp."No." := "No."; ItemTemp.SETRANGE("No."); IF itemtemp.isempty THEN begin ItemVar := ItemVar + ItemTemp."No." +'|'; itemtemp.insert; end; UNTIL NEXT = 0; MESSAGE('%1',ItemVar);0 -
What I would do is:
REPEAT ItemTemp."No." := "No."; ItemTemp.SETRANGE("No."); IF itemtemp.isempty THEN begin IF ItemVar = '' THEN ItemVar := ItemTemp."No." ELSE ItemVar := ItemVar +'|' + ItemTemp."No."; itemtemp.insert; end; UNTIL NEXT = 0; MESSAGE('%1',ItemVar);
To avoid having to trim the last '|' .
But I strongly believe that building a filter like this should be avoided. It is very easy to get text overflow errors. If you investigate the usage of temporary tables I think you will find better solutions.0 -
julkifli33 wrote:this is not the key field
i want to cacth "item no." from item ledger entry table
but i want to do grouping...
so it is not double...
I think the first step is to work out what you want. Your FIRST post should contain all the important information. If it doesn't then you just waste other peoples time when they try to help you. Try again and post EVERYTHING, if the information is confidential and top secret, then forums are not the place to ask for help.David Singleton0 -
Hi, why not using the MARK(TRUE) feature on the item table for every found Item? After the loop you can filter on only the marked ones and do what ever you want with these marked Item Records (another loop, building a filter, modifying something).0
-
The problem is that the OP is not really sure what the customer requirement is. Or at least if he does, he is not able to clearly express the requirement. Thus any replies can not really help.
First step is to understand the need and clearly document it.
THEN try and solve it. Here again we have a business requirement turning into a code issue.David Singleton0 -
Yes David, you have made your point already. There is no need to repeat yourself.David Singleton wrote:The problem is that the OP is not really sure what the customer requirement is. Or at least if he does, he is not able to clearly express the requirement. Thus any replies can not really help.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Luc Van Dyck wrote:
Yes David, you have made your point already. There is no need to repeat yourself.David Singleton wrote:The problem is that the OP is not really sure what the customer requirement is. Or at least if he does, he is not able to clearly express the requirement. Thus any replies can not really help.
I know. ](*,) ](*,) ](*,) ](*,) ](*,)
Maybe 3 months was not a long enough break for me to learn.
:-#David Singleton0
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

