Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on October 17, 2022 3:15PM
Likes: 0
Replies: 4
Hi Dataiku community,
I am attaching a dataset in an email notification after scenario ends as an excel file.
In the email body, how can I use a value of a column (which is date)? There are many records in the dataset but the value of one column is the same across the table and showing a date.
Thanks
Hi @pafj
,
There may be a few ways to do this; I've created a custom python step in a scenario that converts a dataset into a data frame, converts a timestamp to a string and replaces the current variable "date" with the first value in column "time_start". Note, you will need to create the global variable in your project first and the script below will update it.
import dataiku from dataiku import pandasutils as pdu import pandas as pd client = dataiku.api_client() project = client.get_project("project-key") mydataset = dataiku.Dataset("dataset") df = mydataset.get_dataframe() df['time_start'] = df['time_start'].astype(str) var = df['time_start'][0] #the variable must be created first variables = project.get_variables() variables["standard"]["date"] = var project.set_variables(variables)
Please let me know if you have any questions.
Thanks,
Jordan
Hi @JordanB
Thank you for taking the time and replying to my question.
I am pretty new to dataiku and I was wondering if you could direct me how to create a Global Variable in my project?
Thanks
Hi @pafj
while you wait for Jordan's reply here are a few resources to get you started:
I hope this helps!
Hi @pafj
,
Corey has provided the documentation. You can navigate to your project variables from within the project menu. Variables should be in json format (as shown below).
Please let us know if you have any further questions.
Thanks!