LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  sequencing in a group

    Employee
    Posted 06-17-2015 01:27

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

    Originally posted by: Varsha.Pindola

    Morning

    I wonder if you can help, attached is the data file,I�m working with and from the data, I need a line per handset as shown in output.txt


    Code used to create the sequencing don�t work as expected, don�t reset when the product name and bonus changes. PLEASE can you help.


    if firstInGroup
    then {
    SeqNum = 1
    PrevBonus = PromotionBonus
    PrevProdName = 'Product Name'
    }
    else if (PromotionBonus == PrevBonus and 'Product Name' == PrevProdName )
    then {SeqNum = SeqNum + 1
    PrevBonus = PromotionBonus
    PrevProdName = 'Product Name'
    }
    else SeqNum = 1

    emit *, SeqNum,
    strcat('Connection Month','Product Name',PromotionBonus) as xx


    Kind regards

    Varsha
    Attachments:
    data.txt
    output.txt


  • 2.  RE: sequencing in a group

    Employee
    Posted 06-17-2015 08:03

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

    Originally posted by: ryeh

    Hi, Varsha. I understand what you're asking, but I think there's a different way to tackle this. It seems that on days where there is a promotion bonus, there are actually two records for that date. So maybe another way to do this is to group by product, and then assign an unique sequence number per date. Does that work?
    Attachments:
    seqNum.brg