Now() function for recipe
![Vin](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar4.png)
Hi,
I've tried to use now() function inside a recipe.
The idea was to be able to identify each run by its timestamp.
Now I realize inside a run now() can take several values, particularly considering it takes milliseconds or something.
Is there a way to have a single now() value for each recipe run, like now() in SQL.
(I'd use SQL recipe but at the moment I'm not allowed in that particular infrastructure).
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,876 Neuron
What exactly are you trying to achieve? What's the requirement/goal?
-
tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,598 Neuron
Welcome to the Dataiku Community.
I'm not is a place to look at this in detail. Here are a few random ideas.
You might look at saving a now() as a local project variable and then re-using that previously saved variable for each row. Or see if there is already a variable that contains a run time for the recipe. This might be done as part of a senario.
Another thing you might try is to do some rounding of the data and time. Such that you get one value but the values would be different each time. This latter approach might be a good minimal viable option.
Or if you data is stored in a SQL database use an actual SQL recipe to get the behavior you are accustomed to.
I think in this case I might use the latter approach using a SQL recipie.