Check out the first Dataiku 8 Deep Dive focusing on Productivity on October 29th Read More

Assign values based on scenarios

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.

Thanks for your help!

0 Kudos
1 Reply
Dataiker
Dataiker

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