LAE

 View Only
  • 1.  Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 12-04-2014 11:36

    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


  • 2.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 07-27-2015 00:51

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

    Originally posted by: gabygyy

    hi,

    can please provide the library also because when i 'm opening the graph in the composite some nodes are not valid - for eg do while node
    thx


  • 3.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 07-27-2015 08:08

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

    Originally posted by: ryeh

    Are you on 5.0? The 'Do While' node was introduced in 5.1 (part of the core library).


  • 4.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 07-27-2015 22:00

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

    Originally posted by: gabygyy

    i'm using 4.6.1, this is the reason for node mising.
    thx


  • 5.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 05-10-2019 09:52

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

    Originally posted by: StaticFX

    Old thread - bumping with questions!

    Can this be converted to work with a multi tab excel? the excel in the attached grp seems to be custom?

    Im looking at the code (and being new) I dont understand it lol
    Id LOVE to figure out how this works!


  • 6.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 05-10-2019 11:33

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

    Originally posted by: stonysmith

    In a word, yes, but.. it's going to take some work to accomplish it.

    Inside of that loop, the node "Select Records For File" probably needs to change to using the LOOKUP node against each of your input streams to select the proper output records, and then feed those multiple streams into the (tabs) of the ExcelOutput.
    It can be done, but as I said, it's going to take some work.


  • 7.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Employee
    Posted 05-10-2019 11:54

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

    Originally posted by: StaticFX

    ok, let me know when you have finished it...

    lol


    im first trying to just isolate the ability to pass in a variable from the data...


  • 8.  RE: Dynamic Outputs (Creating multiple dynamic output files from one data source)

    Posted 06-02-2021 09:30

    fyi all - I was able to import the brg file into D3S but first had to open the file in a text editor and change the BRGVersion:5 to BRGVersion:6. Once update the "RootFileName" path location to my c drive it works