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.  Replicate if function from excel

    Employee
    Posted 01-26-2012 04:48

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

    Originally posted by: epetrou

    Hello all again,

    im sorry for asking for your help again but it seems my company has not been using this incredibly useful program as much as it should and im working to change that. After solving my previous problems i managed to automate many functions from excel .However i encountered a problem when trying to do if function from multiple columns .What i mean :

    I have one column which has month(App_Month) on it( 11,12,etc) ,and another column with Numbers(MSISDN) on it of the same length(6934600400 for example).
    First im using the sort node to categorise my data like this App_Month,MSISDN,reverse(App_Date_Time_V) whereas App_date_Time_v is date and time created by me in the format i want . Now i want to find the unique MSISDN but i also want to keep the other results .To be more spesific i want to name in a new column the Unique MSISDNS with the number 1 and the other results as the number 0 .
    I have used the agg node with emit * where firstInGroup ,which shows me the unique i want , but it doesnt keep the other results.


    Can you help me find a way to solve this problem ?

    Thanx in advance


  • 2.  RE: Replicate if function from excel

    Employee
    Posted 01-26-2012 05:12

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

    Originally posted by: Tim Meagher

    Hey,

    I've attached an example graph which I think does what you want to do.
    If you are just wanting unique MSISDN, then you should be sorting, and agg'ing on the MSISDN.

    If you want unique per MSISDN & date etc, then you should sort & agg on MSISDN and the additional fields.

    In any case, I might have misinterpreted the requirements slightly, but I think the graph does what you want.

    The first agg node will output the all of the first-encountered unique values to the first output pin. Any duplicates on MSISDN will be output to the second output pin.

    The other option, follows more closely your description, and outputs all records to the one output pin, but includes an identifier (1 or 0) which specifies whether or not the MSISDN was the first found value or not.

    I just thought it could be useful to point out the first option which would allow splitting the unique & duplicate data (on MSISDN) into 2 streams.

    Tim.
    Attachments:
    example.brg


  • 3.  RE: Replicate if function from excel

    Employee
    Posted 01-26-2012 05:53

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

    Originally posted by: epetrou

    At this point i want the second agg .But now that i think about it i can use the first way too ,its simpler and easier for my co-workers to maintain because the sorts change every few months.

    Thanx a lot


  • 4.  RE: Replicate if function from excel

    Employee
    Posted 01-26-2012 06:06

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

    Originally posted by: Tim Meagher

    No worries.

    By the way, if you are worried about maintenance and re-use, you should consider using the library features within the LAE.

    You could simply place the sort & agg node in a composite in the library view.
    Then, declare a parameter on the composite for the sort & agg expression.

    If the sort changes, then you only need to modify this in one place.

    I've attached an example of how to do this.
    I've changed the icon of the composite node in the library, and marked the "DefaultAction" parameter to "Edit" & hidden the "DefaultAction" and "DisplayImage" parameter on the composite in the library as well.

    This then just makes it appear to anyone using it as if it is a normal library node. You can then group sets of these nodes together into groups in library graphs & just include them for use in any graphs you want.

    Not sure if you aware already of all of this functionality, but since you mentioned maintenance issues, I thought it would be worth pointing out.

    Tim.
    Attachments:
    example.brg