Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku!

# Assign values based on scenarios

Solved!
Level 1
###### Assign values based on scenarios

Hello,

Following situation: I have ten columns (two for each weekday). For every weekday I have the information of an absolute and a relative number.

What I want to do: Assign the weekday based on the highest relative number for each row. But if there are two or more columns with the same relative number, assign the weekday with the highest absolute number. If this is also equal for two or more columns, pick one of those days randomly.

I know that I can cover the first condition with an if-formula but have no clue how to incorporate the second condition.

1 Solution
Dataiker Alumni

Hi,

What you describe is a good use case for using Python. You will be able to formulate your logic with more functionalities.

We have recently written a useful guide to Python in Dataiku which you can find here: https://academy.dataiku.com/latest/tutorial/python/index.html

Hope it helps,

Alex