The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Converting Numerical Date back to Date Format
Hello community! Sorry for bothering with my Newbie-Question!
My problem:
I have missing values for a certain date attribute -Date1- that I want to fill up. It's actually quite easy, because I have two other attributes that will help me calculate the missing values. So there's a numeric attribute like -DaysUntil- and the other Date -Date2-. I have Date2 and -DaysUntil-, so
Date2 - DaysUntil
would give me my Date1 that I need.
As I said, -DaysUntil- is numeric, like 10 for example, and Date2 a date value. I can't calculate with those formats, so I already used the Date to Numeric Operator to get a numeric value for my Date2. I used day in the epoch. So now what I can do is to just substract the numeric values like given above, but that leaves me with a numeric value (day in epoch) for my Date1. (I need Date1 as a Date format though)
The Numeric to Date Operator doesn't work for this kind of 'back conversion'.
So how do I get my Date1 as a Date format value now?
Or should I use a different Operator for calculation in the first place?
Thank you so much for your answers!
Tagged:
0
Answers
You should be able to use a single operator to solve this problem. I used generate attributes with the following formula: if(missing([Date1]), date_add([Date2],-[DaysUntil],DATE_UNIT_DAY,"UTC"), [Date1])
I've also attached an example process. Any questions, please let me know.
Best,
Roland