- Posts: 109
Add import data
- JD Cox
- Topic Author
- Offline
- User
Less
More
3 years 1 month ago #3661
by JD Cox
Add import data - Post(3661) was created by JD Cox
I'm trying to add a line of data to an order when the piece count is greater then one (1)
In the attached there are four steps:
Step 1 - Copy the file to memory
Step 2 - Add item Z if item C or X are on the order
Step 3 - Count the total pieces on each order after step 2 items are added
Step 4 - Add item Y to an order if the piece count is greater then 1
My problem is with Step 4. When the condition is met it's adding Y after every line on the order.
I understand why it's doing that but I can't figure out how to only add one line when the condition is met.
Thanks, JD
In the attached there are four steps:
Step 1 - Copy the file to memory
Step 2 - Add item Z if item C or X are on the order
Step 3 - Count the total pieces on each order after step 2 items are added
Step 4 - Add item Y to an order if the piece count is greater then 1
My problem is with Step 4. When the condition is met it's adding Y after every line on the order.
I understand why it's doing that but I can't figure out how to only add one line when the condition is met.
Thanks, JD
Attachments:
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
3 years 1 month ago #3662
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Add import data - Post(3662)
Hi JD,
The reason why is, you read the InMemory Adapter Table SKU_ADD row by row and import each line/row to a new InMemory Table COUNT_ADD. For every line you check whether the pieces count is greater than 1. If yes you add for every row one additional row.
I´ve modified your definition, see attachment. Here I added to more steps, your original steps 4 has been disabled.
Step 5) Read InMemory Table SKU_ADD ordered and group this dataset by field S_Customer. Filter all rows with pieces count less than one. Add one new row to the same InMemory Table SKU_ADD.
Step 6) Output the InMemory Table SKU_ADD order by the fileds S_Order and S_Customer to a CSV text file .
The reason why is, you read the InMemory Adapter Table SKU_ADD row by row and import each line/row to a new InMemory Table COUNT_ADD. For every line you check whether the pieces count is greater than 1. If yes you add for every row one additional row.
I´ve modified your definition, see attachment. Here I added to more steps, your original steps 4 has been disabled.
Step 5) Read InMemory Table SKU_ADD ordered and group this dataset by field S_Customer. Filter all rows with pieces count less than one. Add one new row to the same InMemory Table SKU_ADD.
Step 6) Output the InMemory Table SKU_ADD order by the fileds S_Order and S_Customer to a CSV text file .
Best wishes
Robert Stark
Please Log in or Create an account to join the conversation.
- JD Cox
- Topic Author
- Offline
- User
Less
More
- Posts: 109
3 years 1 month ago #3663
by JD Cox
Replied by JD Cox on topic Add import data - Post(3663)
Thanks Robert
I wasn't aware I could write more data to the InMemory table. That works great.
Thanks again, JD
I wasn't aware I could write more data to the InMemory table. That works great.
Thanks again, JD
Please Log in or Create an account to join the conversation.
Time to create page: 0.270 seconds