Operators for Attribute transformations and date-type attributes

MartinKoch
MartinKoch New Altair Community Member
edited November 5 in Community Q&A
Hi,

I have a data set with let's say two attributes of type "date". Now I want to generate a new one like "if the difference between the date values is larger then 2 days set the value of the new attribute to 1 otherwise to 0".

I already found that date values are stored as number internally but I'm pretty lost right now about how to use date values or comparisons of them with operator like "Generate Attributes".

I would be really thankful if somebody can help me or tell me where I can get some informations about it.

Greetings
Martin
Tagged:

Answers

  • steffen
    steffen New Altair Community Member
    Hello Martin

    As far as I see:
    The problem is that the date-values are stored internally as milliseconds since the dawn of time (1.1.1970) according to javas Date-Specification.  Since "Generate Attributes" does not provide functions for that, I suggest to convert the date-attributes with the operator "Date 2 Numerical". Afterwards using "Generate Attributes" should be a piece of cake ;).

    Hint: You could use "Generate Copy" to keep the old attributes.

    hope this was helpful,

    steffen
  • MartinKoch
    MartinKoch New Altair Community Member
    Hello steffen

    Thank you for your post. It's sometimes the simplest solutions which one does not see right away.

    I think I'll do it your way for now.

    Thanks again,
    Martin