LAE

 View Only
  • 1.  Output to multiple, then to excel

    Employee
    Posted 04-30-2019 06:12

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: darrenhoggard

    Hi,
    I have data that I want to split by a combination of 4 columns: Franchise/Partner/BP/Type, but I do not know in advance what will be in these columns
    e.g.
    franchise1, Partner1, BP1, Type1 has 10 records
    franchise2, Partner1, BP1, Type1 has 20 records
    etc

    there are 2 franchises, 100 partners, multiple bp, and 5 types, so any combination of these are possible.

    How would i achieve this, and is it possible to then export each of these to excel using the 4 columns as a filename i.e. franchise1_partner1_bp1_type1.xlsx

    many thanks
    d.


  • 2.  RE: Output to multiple, then to excel

    Employee
    Posted 04-30-2019 07:24

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: gmullin

    You'll have to make use of 2 things:

    1. The Do While node to cycle through each set of data you want in an individual Excel file. Write the data out to some common name, let's say temp.xlsx, then you will rename the file to something more useful on each iteration (point 2).
    2. Each time you write out the file "temp.xslx", you will want to clock it to a Filter node and make use of the moveFile() command to rename the file to something like the filename you mentioned above.


  • 3.  RE: Output to multiple, then to excel

    Employee
    Posted 05-01-2019 01:59

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: darrenhoggard

    Ok, so I have done the following:
    Summary of the the 4 fields, this creates 8 records, so therefore i need to loop through the main data 8 times.
    this goes into the do while loop as initial input
    output to loop goes to a filter where first exec - this then goes into a x-ref with the main data which matches on the 4 keys and outputs to excel
    the output to loop also goes to another filter where not first exec - so there will now be 7 records - how do i tell the loop to stop when there are no records left?


  • 4.  RE: Output to multiple, then to excel

    Employee
    Posted 05-01-2019 04:36

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: darrenhoggard

    No worries got it working, the not first exec seems to work as the input for the next loop, which reduces each time, just had to put a timer on the excel output to stop the loop from starting until it had finished the current loop.