|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Invoice merge grouping items on same order number with NEXTIF skipping every other order
Hi. New here and out of my league. Watched many videos and tried Paul's excellent tutorials in the sticky and searched here. I've even looked at the many to one plugin and solutions that use "DATABASE", but perhaps I am close since it works other than skipping ever other new order number.
I have a CSV file that comes to me in a format like this: Code:
Order ID First Name Last Name Shipping Total Order Total Product Title 444453 Jack Smith 6.2 91.2 Motor Board 444453 Motor Board 444453 WiFi Board 444453 Expander Board 444454 John Doe 4.99 44.89 Motor Board 444455 Bob Bobbly 13.64 95.44 Motor Board 444456 Shawn Payton 5.64 83.44 Motor Board The table in the Word Invoice would obviously group all the things by order ID and put them in the appropriate cells, total things, and then merge into their "individual documents". Order 1 (444453) merges and puts each record in the correct line item for it's document, but then it skips the next order number, does the next one correctly, skips the next one, and so on. The "NEXTIF" sections in the table look like this (simplified without some totaling fields): Code:
{ MERGEFIELD Model_Number} { MERGEFIELD Product_Title } {SET ID1 "{MERGEFIELD Order_ID}" The next row in the table has: { NEXTIF{ MERGEFIELD Order_ID } = { ID1 }}{SET ID2"{MERGEFIELD Order_ID}"}{IF ID1 = ID2 "{MERGEFIELD Quantity}" ""} I am thinking I need to reset ID1 or ID2 somewhere possibly? I have attached small, simplified demo versions of the CSV data file (as a text file since this forum won't accept CSV files) and the Word mailmerge template. I think it is just a "letter", not a "directory", but still trying to learn what the difference is and if it is important since I think it is working except for my logic flow. Thank you! Last edited by FlightRisk; 01-02-2024 at 07:51 AM. Reason: trying to get table entries to line up |
#2
|
||||
|
||||
Save your data as Excel format and modify your document so that it has only one table and Merge Many To One will handle this merge.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Quote:
|
Tags |
invoice, merge, nextif |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I paste items in the order they were copied, not the order the are listed? | manish500 | Word | 6 | 07-25-2018 12:07 AM |
count a number of cells based on the beginning of a order number | Kubi | Excel | 2 | 08-06-2017 08:54 PM |
How do you place a list of items in alph order | cinque8 | Word | 2 | 08-13-2016 02:23 PM |
How do I change the page number order? | officeboy09 | Excel | 4 | 10-30-2013 08:11 PM |
chronological order number needs to be changed as ndash | sajeev | Word | 0 | 09-15-2010 07:10 AM |