Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Michael.Slowey@lavastorm.Hi All,
For a long time many of the customers I have engaged with have asked is it possible to create multiple output files from one data source dynamically, without having to explicitly define the outputs.
NB This following example is specific to the desktop version of LAE, this issue can be solved using the Execute BRX Node on the server Version
So for example we have a set of results that are defined by "Region" eg North, South, East, West. In the past we have had to define four outputs for each one of these regions. If a new region suddenly appeard, eg. Central, the graph would have to be changed to cope with the extra output.
We now have a solution to this problem due to the introduction of the Do While and Do While Conditional nodes. The Do While nodes execute user defined BrainScript and passes the result to an optional sub-graph, looping while the specified condition is met.
I have developed three nodes to show how we can achieve Dynamic outputs. Both nodes will output multiple excel spreadsheets base on the parameters entered;
Node 1 (Output To Multiple Excel Files By Record Count) accepts a value determining the number of files the user wishes to output. The node calulates the total number of records and then determines how many records should be allotted to each of the output files. The output file names will be based on the Root File Name parameter, with a file number appended to the file name
For a file containing 1000 records (such as seen in the attached graph) and a user specified Root File Name of c:\files\customer_data.xlsx, and a number of files specified as 10,
10 files will be out put with the file names ranging from c:\files\customer_data_1.xlsx to c:\files\customer_data_10.xlsx each containing 100 records.
Node 2 (Output To Multiple Excel Files By Group) accepts a Group (one or more field(s)) that the files should be segmented by. The output files will be based on the Root File Name parameter, with the values of the group fields appended to the file name.
eg for data to be grouped by "Region" eg North, South, East, West, 4 files will be output with the filenames c:\files\customer_data_North.xlsx, c:\files\customer_data_South.xlsx etc. each containing the records pertaining to that particular region.
Node 3 is Node 2 but with emailing capabilities. Each group must have an associated valid email address, as can be seen in the static data node
These nodes are a work in progress please feel free to put them through there paces and suggest any additional functionality you believe may be useful.
Attachments:
Create Multiple Files From Single Input.brg