Basic 102 course > chapter "Hands-On: Group the Data > new file has wrong columns type

titouan3412 Registered Posts: 8 ✭✭✭✭

Hello, on basic 102 course, chapter "Hands-On: Group the Data" ( I have a problem with columns' type.

All columns of initial orders_prepared dataset have a right type.
After applying a group recipe, the storage type of columns in the “Per field aggregations” is now different. For example I have a string type for order_date field and a min function is not applicable.
How to solve it please?

Thanks a lot.


Best Answers

  • ATsao
    ATsao Dataiker Alumni, Registered Posts: 139 ✭✭✭✭✭✭✭✭
    Answer ✓

    Hi titouan3412,

    Your first screenshot confirms that your order_date column is actually being stored as a string, not a date type. You can tell because the "first" value says string, which corresponds to the actual storage type of the column in your dataset, while the "second" value refers to the meaning of the column. More information about the differences between storage type and meanings can be found in our documentation here:

    I would recommend following the steps laid out in the "prepare your data" section of the Academy tutorial to parse the date (as a new column), delete the original order_date column, and rename the new order_date_parsed column. You can find the instructions here:

    Afterwards, your order_date column should have the storage type and meaning as both "date". Please see the following screenshot for what this should look like.

    order_date stored as date type.png

    Once the column is actually being stored as a date (and not a string), you should be able to properly use the "min" and other aggregation functions with it in your Group recipe. Please give this a try and let me know if you still end up facing issues!



  • titouan3412
    titouan3412 Registered Posts: 8 ✭✭✭✭
    Answer ✓

    Hi Andrew,

    thanks for your answer. Effectively I missed step to modify the order_data column 's type in a previous course.


Setup Info
      Help me…