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.  data types in CSV input

    Employee
    Posted 08-04-2010 01:56

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

    Originally posted by: eman

    How to maintain or change the data types of the fields of i/p
    all coulmns imported are converted to string


  • 2.  RE: data types in CSV input

    Employee
    Posted 08-13-2010 11:30

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

    Originally posted by: rboccuzzi

    It depends on how you are inputing your data...if you are pulling from a database, where the data is already typed, it should maintain the type from there. If you are pulling from a text file, such as a csv delimited file for example, it is correct that you will be bringing in the data as string...

    You can then use other nodes, such as the Data Analyzer, to discover the data types for you, or a filter node and BRAINscript functions such as date, time, int and double to change the types for each field. When converting after you have imported all the data, it gives you the ability to see the data, and deal with the exceptions properly. Sometimes data might have dates in some rows, but other numerical values in other rows, all in the same column, for example. You can look at the functions isDate, isTime, isDigit, etc. as some that can help test the data if you would rather not have the Data Analyzer do the work for you.


    Cheers
    Rich


  • 3.  RE: data types in CSV input

    Employee
    Posted 02-06-2012 09:57

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

    Originally posted by: rbeliz000

    I need to change the output of sort node data field from double to string. Any suggestions on the simplest way to accomplish this?

    I need two different sort output formats to match so that I can use an input for a subsequest x-ref.

    Any help would be appreciated.

    thanks,

    RB


  • 4.  RE: data types in CSV input

    Employee
    Posted 02-06-2012 11:25

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

    Originally posted by: timonk

    RB,

    You cannot modify the data type output of a generic sort node. You'll have to follow it with a filter node and do your data type updates there.

    You can use expressions to modify how it is sorted, however. For example you can have a String field, and then sort it by:

    int(fieldname)

    To sort the field AS a different type, but the output will still be the original type.

    Is there a particular reason you want to change the type inside the sort? Or are you just trying to save on graph size.

    Regard,
    Timon Koufopoulos
    MDS Lavastorm Support.


  • 5.  RE: data types in CSV input

    Employee
    Posted 02-06-2012 11:51

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

    Originally posted by: rbeliz000

    Timonk,
    thanks for your help.
    I had no paticular reason for doing in the sort note.

    the filter option seems to have done the trick. i used the following
    syntax to convert the data type, and then ran it through a sort node.

    >>>>>>>>>

    TRN_MT_MN = TRN_MT_MN.str()

    emit *
    override emit TRN_MT_MN as TRN_MT_MN

    >>>>>>>>>>

    again many thanks.

    RB