🎉 🎉 RAPIDMINER 9.10 IS OUT!!! 🎉🎉

Download the latest version helping analytics teams accelerate time-to-value for streaming and IIOT use cases.


Nominal to Date

felix_wfelix_w Member Posts: 61 Contributor II
edited September 2019 in Help

Dear Rapidminer Community


I am struggling again with some Nominal to Date conversions and I hope you can help me. I am extracting with an "extract macro" a date value and I am getting a nominal value. Now I want to convert this nominal value from the macro again back to a date value.


The nominal format is:

May 22, 2016


How can I convert this into date format? All I get is: "Cannot parse date" and I have tried already plenty of options.


Any help would be greatly appreciated!


Best regards



Best Answer

  • yyhuangyyhuang Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 351  RM Data Scientist
    Solution Accepted

    Hi @felix_w,


    You may have at least 2 ways to convert nominal string to a date by a customized date format.


    My example process attached here. Be careful that no quotes on the date string of the macro variable.



    <?xml version="1.0" encoding="UTF-8"?><process version="8.1.001">
    <operator activated="true" class="process" compatibility="8.1.001" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="set_macro" compatibility="8.1.001" expanded="true" height="68" name="Set Macro" width="90" x="380" y="34">
    <parameter key="macro" value="someDate"/>
    <parameter key="value" value="May 22, 2016"/>
    <operator activated="true" class="generate_macro" compatibility="8.1.001" expanded="true" height="68" name="Generate Macro, method2" width="90" x="514" y="136">
    <list key="function_descriptions">
    <parameter key="nominalDate" value="date_parse_custom(%{someDate},&quot;MMM dd, yyyy&quot;,&quot;en&quot;)"/>
    <operator activated="true" breakpoints="after" class="generate_data_user_specification" compatibility="8.1.001" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="514" y="34">
    <list key="attribute_values">
    <parameter key="someDate" value="%{someDate}"/>
    <list key="set_additional_roles"/>
    <operator activated="true" class="nominal_to_date" compatibility="8.1.001" expanded="true" height="82" name="Nominal2Date, method1" width="90" x="648" y="34">
    <parameter key="attribute_name" value="someDate"/>
    <parameter key="date_format" value="MMM dd, yyyy"/>
    <parameter key="keep_old_attribute" value="true"/>
    <connect from_op="Generate Data by User Specification" from_port="output" to_op="Nominal2Date, method1" to_port="example set input"/>
    <connect from_op="Nominal2Date, method1" from_port="example set output" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>




  • felix_wfelix_w Member Posts: 61 Contributor II

    @: yyhuang thank you so much!! Now it finally works! :D 


    I still have one question though: Why does "MMM dd, yyyy" work for a date like this: "May 22, 2016"? I don't understand why those 3 "MMM" work, I thought for a month I would always write a double M ("MM").. which was also my mistake because I tried many variances of "MM dd,yyyy and nothing worked. 



  • yyhuangyyhuang Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 351  RM Data Scientist

    Hi @felix_w,


    Hope these links could help you understand better about the date formats.




    Inside rapidminer, you can also have a quick reference list from "nominal to date" operator.


    Some standard date formats are listed there






  • felix_wfelix_w Member Posts: 61 Contributor II

    That's really helpful! Now I get, it's simply because my date (May) has 3 letters, that is why I need three M's (MMM), right?! Would have been quite streight forward.. 

Sign In or Register to comment.