Updating a variable from a dataset

akember182 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 2

Hello I have a dataset with only 1 row (but will change depending on other inputs) and I want to use it to update a global variable. I know I can use a python function in a scenario for this but can't quite work it out.

I have a dataset (my_dataset) that looks like this

Code. Year

122. 2021

I want to extract the 2021 figure and save it as a variable.

I know I can use code in a scenario along these lines

import dataiku

from dataiku.scenario import Scenario
scenario = Scenario()


df_data = df_data['Year']


But I can't quite seem to get it working, any advice?

Operating system used: Mac OS



Setup Info
      Help me…