Hello All,
I have been stuck on this issue for quite sometime now, so it would be really great if someone could help me with this.
What I'm trying to achieve is a bit hard to explain so please have a look at the sample input and desired output below.
Sample Input:
| Period | Line Description |
| May | xyz |
| May | xyz |
| May | abc |
| May | abc |
| May | abc |
| May | yyy |
| May | yyy |
| June | xyz |
| June | xyz |
| June | abc |
| June | bbb |
| June | xxx |
What I'm trying to do is to split this into multiple sheets in the output file based on the "period" column. I have done this using the output tool "Change file/table name" option and then I chose the period as the field. This is working fine, however I need to limit the number of rows per each sheet, for the sake of the example lets say that the number of rows allowed in each sheet is 4. The extra twist that I need to make sure is implemented is that rows with the same line description need to also be on the same sheet. Please have a look at the desired output below:
Output - Sheet 1:
| Period | Line Description |
| May | xyz |
| May | xyz |
| May | yyy |
| May | yyy |
Output - Sheet 2:
| Period | Line Description |
| May | abc |
| May | abc |
| May | abc |
line description 'abc' is on another sheet because it has 3 rows and cant be shared with any other line description because 'xyz' & 'yyy' each have 2 rows, therefore it will exceed the limit of rows per sheet which is 4 rows.
Output - Sheet 3:
| Period | Line Description |
| June | xyz |
| June | xyz |
| June | abc |
| June | bbb |
Output - Sheet 4:
| Period | Line Description |
| June | xxx |
In the case of June , it does not matter which line description gets distributed to a different sheet alone as long as its not "xyz" (except of the two xyz line items are together within the same sheet).
I know this is a bit tricky and I might have not explained it very well. Please let me know if you have any questions.