Duplicate Data

jpachut

New Member
Can someone please help me??? I cannot figure out what is wrong I have tired using the <= and I am still getting duplicate data in my report. I am currently using QAD version SP7 on eB server. Progress v 9.1c.

I only want the report to bring in the part data from my forecast budget file only, I do have to get the part description from the pt_mstr table and the work center from the ro_det table.

I tried it this way and this is where I got my duplicate data from.

[FONT=r_ansi]for each ff_mstr where ff_id = fcstid and ff_year = fcyear,[/FONT]
[FONT=r_ansi]each pt_mstr where pt_part = ff_part no-lock,[/FONT]
[FONT=r_ansi]each ro_det where ro_routing = ff_part no-lock[/FONT]
[FONT=r_ansi][FONT=r_ansi]break[/FONT]
[FONT=r_ansi]by ro_wkctr[/FONT]
[FONT=r_ansi]by ff_part:[/FONT]

I tried it this way and I got nothing...
for each ff_mstr where (ff_id >= fcstid and ff_id <= fcstid1)
and (ff_year >= fcyear and ff_year <= fcyear1)
no-lock,
each ro_det where
(ro_routing >= ff_part and ro_routing <= ff_part1) no-lock,
each pt_mstr where
(pt_part = ff_part and pt_part <= ff_part1) no-lock
[FONT=r_ansi]break[/FONT]
[FONT=r_ansi]by ro_wkctr[/FONT]
[FONT=r_ansi]by ff_part:[/FONT]

[FONT=r_ansi]Can someone please tell me the what I am missing here. HELP PLEASE!!![/FONT]

I am currently [/FONT]
 

WillieG

New Member
I avoid using:
"For each .....,
each .....,
each..."
it is very slow and you could get duplicate data, when some of your data is not as it is supposed to be.
But you lose your abillity to sort on different fields in different tables if you don't use it.
What I suggest you do is to define a temp-table (tff_mstr) like your table ff_mstr and add fields ro_wkctr & pt_desc (or whatever your parts description field is called) to this temp-table then first populate your temp-table and then do your report with the temp-table.
/* populate temp-table */
for each ff_mstr where ff_id = fcstid and ff_year = fcyear no-lock:
find first pt_mstr where pt_part = ff_part no-lock no-error.
find first ro_det where ro_routing = ff_part no-lock no-error.
create tff_mstr.
Assign tff_mstr.ff_id = ff_mstr.ff_id
tff_mstr.ff_year = ff_mstr.ff_year
tff_mstr.ff_part = ff_mstr.ff_part
......(all the fields in ff_mstr = fields in tff_mstr)
tff_mstr.ro_wkctr = if available ro_det then ro_det.ro_wkctr
else "" (or 0 depend on what field type ro_wkctr is)
tff_mstr.pt_desc = if available pt_mstr then pt_mstr.pt_desc
else "No Description".
end.

/* do your reporting with the temp-table */
for each tff_mstr break by tff_mstr.ro_wkctr
by tff_mstr.ff_part:

I hope this can help.:)
 
Top