discrete attribute that indicates the age

hehee
New Altair Community Member
Hello! My query is .. How can I get to the following: "Generate a new discrete attribute that indicates the age of the people as of August 8, 1934 " The above, taking into account that: DOB are represented in the table as: August 18, 1990 Help pls
Tagged:
0
Answers
-
Hi
<div><?xml version="1.0" encoding="UTF-8"?><process version="9.6.000"></div><div> <context></div><div> <input/></div><div> <output/></div><div> <macros/></div><div> </context></div><div> <operator activated="true" class="process" compatibility="9.4.000" expanded="true" name="Process" origin="GENERATED_TUTORIAL"></div><div> <parameter key="logverbosity" value="init"/></div><div> <parameter key="random_seed" value="2001"/></div><div> <parameter key="send_mail" value="never"/></div><div> <parameter key="notification_email" value=""/></div><div> <parameter key="process_duration_for_mail" value="30"/></div><div> <parameter key="encoding" value="SYSTEM"/></div><div> <process expanded="true"></div><div> <operator activated="true" class="retrieve" compatibility="9.6.000" expanded="true" height="68" name="Retrieve Age" width="90" x="45" y="136"></div><div> <parameter key="repository_entry" value="../data/Age"/></div><div> </operator></div><div> <operator activated="true" class="generate_attributes" compatibility="9.6.000" expanded="true" height="82" name="Generate Attributes (2)" width="90" x="179" y="136"></div><div> <list key="function_descriptions"></div><div> <parameter key="DiscreteAgeDividedbyDay" value="date_diff(date_parse("8/8/1934"),DOB)/8.64e+7/365"/></div><div> </list></div><div> <parameter key="keep_all" value="true"/></div><div> </operator></div><div> <connect from_op="Retrieve Age" from_port="output" to_op="Generate Attributes (2)" to_port="example set input"/></div><div> <connect from_op="Generate Attributes (2)" from_port="example set output" to_port="result 1"/></div><div> <portSpacing port="source_input 1" spacing="0"/></div><div> <portSpacing port="sink_result 1" spacing="0"/></div><div> <portSpacing port="sink_result 2" spacing="0"/></div><div> <background height="232" location="//Samples/Tutorials/Data Handling/05/tutorial5" width="1502" x="26" y="47"/></div><div> </process></div><div> </operator></div><div></process></div>
The sample data i used isName DOB Albert 11/8/1990 John 11/4/1991 Carin 12/3/1992 Hulk 9/4/1992 0 -
Use the "date_diff" function within Generate Attributes and that should give you what you need.
0