Two datasets format in one

Karl68

New Member
Hello,

one problem solved and find the next one, i hope a small issue.

Now i have for one bill two datasets or different tax like this

for tax1 the datasets for tax2 and tax3 are zero
billnumber, price for tax1, price for tax2, price for tax3, tax1, tax2, tax3

for tax2 the datasets for tax1 and tax3 are zero
billnumber, price for tax1, price for tax2, price for tax3, tax1, tax2, tax3

for tax3 the datasets for tax1 and tax2 are zero
billnumber, price for tax1, price for tax2, price for tax3, tax1, tax2, tax3

How bring it together to one dataset?

regards

Karl
 
You haven't mentioned what version of Progress you're running so I'll assume version 9.

Code:
define temp-table ttTax
  field billNum as integer
  field t1Price as decimal
  field t1Amount as decimal
  field t2Price as decimal
  field t2Amount as decimal
  field t3Price as decimal
  field t4Amount as decimal
.

for each taxBill no-lock:

  find tax1Bill where tax1Bill.billNum = taxBill.billNum no-error.
  if available tax1Bill then
    do:
      create ttTax.
      assign
        ttTax.billNum = taxBill.billNum
        ttTax.t1Price = tax1Bill.price
        ttTax.t1Amount = tax1Bill.amount
      .
    end.

  find tax2Bill where tax2Bill.billNum = taxBill.billNum no-error.
  if available tax2Bill then
    do:
      create ttTax.
      assign
        ttTax.billNum = taxBill.billNum
        ttTax.t2Price = tax2Bill.price
        ttTax.t2Amount = tax2Bill.amount
      .
    end.

  find tax3Bill where tax3Bill.billNum = taxBill.billNum no-error.
  if available tax3Bill then
    do:
      create ttTax.
      assign
        ttTax.billNum = taxBill.billNum
        ttTax.t3Price = tax3Bill.price
        ttTax.t3Amount = tax3Bill.amount
      .
    end.
 
end.

If you're running version 10 look in the manuals for "ProDataSet".

You might also want to invest in a training class.
 
Back
Top