RedHeadedStepITChild
IS-IT--Management
I've run into a bit of a problem with a report.
I am using CRXIr2 connecting to DB2 (AS400) via OBDC
Two tables:
IIM(item master) :: FSO(shop order)
Link: FSO.SPROD == IIM.IPROD (item number = item number)
Formula to find LabelQty:
RoundUp(TotalQty/QtyPerLabl) TotalQty comes as an entry in the shop order, and QtyPerLabl is a package code, located in the IIM.
Here is a visual of what the report looks like (it will probably get distorted when I post it)
ShopOrd# DateDue Item# ItemDesc TotalQty LabelQty QtyPerLabl
-------- ------- ---- -------- -------- -------- ----------
1234 2/4/08 12 Chair 211 36 6
Notice the last field -- Quantity per Label. We pack 6 chairs to a box. In an order with 211 chairs, that is 35 labels with a qty. of 6 and 1 label showing a qty. of 1, so you can see that this line of data would figure to be wrong. Is there a way to have CR "create" a row when this issue happens, so that it looks something like this:
ShopOrd# DateDue Item# ItemDesc TotalQty LabelQty QtyPerLabl
-------- ------- ---- -------- -------- -------- ----------
1234 2/4/08 12 Chair 211 35 6
1234 2/4/08 12 Chair 211 1 1
I have some psuedo-ideas for formula(s). Bear with me, this is probably 4 formulas all condensed into one IF/THEN/ELSE statement, and might be part of my problem...having everything all condensed in my head. But, at any rate, here goes.
IF totalQty/packCode = Integer THEN
labelQty = totalQty/packCode AND
qtyPerLabl = packCode
ELSE
IF totalQty/packCode = in[decimal remainder] THEN
labelQty = (RoundUp(totalQty/packCode))-1 AND
qtyPerLabl = packCode AND
remainingLabl = totalQty -(qtyPerLabl * labelQty)
I think the above will solve the issue to come up with the correct per label quantities. However, I am not 100% sure how to do it in CR syntax.
Also, when dividing out the totalQnty/packCode = Integer, I abviously wouldn't need another record showing the one last remaining label. However, when it results in an decimal, I will need to show a record pointing out one more label and the quantity of product on that label.
I would appreciate any help very much! I hope at least 1/2 of this made some sort of sense of what I am trying to accomplish...if its even possible.
Thanks!
Jason
I am using CRXIr2 connecting to DB2 (AS400) via OBDC
Two tables:
IIM(item master) :: FSO(shop order)
Link: FSO.SPROD == IIM.IPROD (item number = item number)
Formula to find LabelQty:
RoundUp(TotalQty/QtyPerLabl) TotalQty comes as an entry in the shop order, and QtyPerLabl is a package code, located in the IIM.
Here is a visual of what the report looks like (it will probably get distorted when I post it)
ShopOrd# DateDue Item# ItemDesc TotalQty LabelQty QtyPerLabl
-------- ------- ---- -------- -------- -------- ----------
1234 2/4/08 12 Chair 211 36 6
Notice the last field -- Quantity per Label. We pack 6 chairs to a box. In an order with 211 chairs, that is 35 labels with a qty. of 6 and 1 label showing a qty. of 1, so you can see that this line of data would figure to be wrong. Is there a way to have CR "create" a row when this issue happens, so that it looks something like this:
ShopOrd# DateDue Item# ItemDesc TotalQty LabelQty QtyPerLabl
-------- ------- ---- -------- -------- -------- ----------
1234 2/4/08 12 Chair 211 35 6
1234 2/4/08 12 Chair 211 1 1
I have some psuedo-ideas for formula(s). Bear with me, this is probably 4 formulas all condensed into one IF/THEN/ELSE statement, and might be part of my problem...having everything all condensed in my head. But, at any rate, here goes.
IF totalQty/packCode = Integer THEN
labelQty = totalQty/packCode AND
qtyPerLabl = packCode
ELSE
IF totalQty/packCode = in[decimal remainder] THEN
labelQty = (RoundUp(totalQty/packCode))-1 AND
qtyPerLabl = packCode AND
remainingLabl = totalQty -(qtyPerLabl * labelQty)
I think the above will solve the issue to come up with the correct per label quantities. However, I am not 100% sure how to do it in CR syntax.
Also, when dividing out the totalQnty/packCode = Integer, I abviously wouldn't need another record showing the one last remaining label. However, when it results in an decimal, I will need to show a record pointing out one more label and the quantity of product on that label.
I would appreciate any help very much! I hope at least 1/2 of this made some sort of sense of what I am trying to accomplish...if its even possible.
Thanks!
Jason