LAE

 View Only
  • 1.  How to Tag Detail Records with Sub Header Details

    Employee
    Posted 03-19-2020 16:15

    Hi All,

    I really need your help with a tricky file I need to transform.

    I have one single csv file that has lots of data records which is broken up by sub headers.  There is nothing that links the data records to the sub headers apart from the order of the records. I've attached a dumb down version i am working with. However I need to tag the detail records with the sub header above them.

    I am hoping that someone can help me with this!

     

    Example Input Data:

    ID,Type,Date

    SH,Fruit Box,24/03/2020

    SB,Apple,24/03/2020

    SB,Grapes,24/03/2020

    SH,Candy Box,24/03/2020

    SB,Lolly Pop,24/03/2020

    SB,M&M,24/03/2020

     

    Example Output Data:

    SB,Apple,24/03/2020,Fruit Box

    SB,Grapes,24/03/2020,Fruit Box

    SB,Lolly Pop,24/03/2020,Candy Box

    SB,M&M,24/03/2020,Candy Box

     



  • 2.  RE: How to Tag Detail Records with Sub Header Details

    Employee
    Posted 03-19-2020 18:07

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

    I think the key here is to identify the data in groups so that from there you can use the functions firstInGroup (or lastInGroup if the order was reversed) to identify the sub type. Here's an attempt at it that hopefully can help you.

     

    Attached files

    SubType.brg

     



  • 3.  RE: How to Tag Detail Records with Sub Header Details

    Employee
    Posted 03-19-2020 18:31

    Hi Gerry,

    Thank You very much for your quick response.

    It has done the trick!!

    Here I was looking at different accelerators and didn't think I could just use a standard filter and Agg node.

    Do you know of anywhere I can get some sort of reference when it comes to BRAINScripts?

    Thanks again



  • 4.  RE: How to Tag Detail Records with Sub Header Details

    Employee
    Posted 03-20-2020 08:55

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

    The old community is accessible, albeit as read only. There is a wealth of information on it related to LAE and BRAINScript. Your only real source of BRAINScript help outside of that is the help files in LAE itself (Help menu -> BRAINScript Help). If you highlight some BRAINScript function and hit f1 the help will bring you to the help specific to that function which is a nice feature.

     

    The old forum is accessible here.