New to Dataiku DSS? Try out our NEW Quick Start Programs today and get onboarded on the product in just one hour! Let's go

How to create Quarter column using Processors?

Solved!
aad34210
Level 3
How to create Quarter column using Processors?

Hi. 

I want to create Quarter column using Processors but I can't create it.
I have below date and year/month/day column and I want add Quarter column.
==[Sample data]==

Date                year      month     day     Quarter (Expected)
2020/04/01    2020        4          1        1Q
2020/07/01    2020        7          1        2Q
2020/10/01    2020        10          1        3Q
2021/01/01    2021        01          1        4Q ....
==[Sample data]==

Could you please tell me how can I create Quarter column?

Best regards.
Thank you.

0 Kudos
1 Solution
Tuong-Vi
Neuron
Neuron

Hello,

I'm not sure to understand what "processors" means, but I think you can use in prepare recipie the Formula option with if...then statement to create Quarter column (if 1<month<=4 then "1Q" else if.......x3) with month is an integer ?

View solution in original post

2 Replies
Tuong-Vi
Neuron
Neuron

Hello,

I'm not sure to understand what "processors" means, but I think you can use in prepare recipie the Formula option with if...then statement to create Quarter column (if 1<month<=4 then "1Q" else if.......x3) with month is an integer ?

View solution in original post

aad34210
Level 3
Author

Hi @Tuong-Vi san

Thank you for your prompt reply.

I tried to use IF statement in Formula function from Processors library, and I can successfully create each Quarter value.

if(date_month>=4 && date_month<=6,"1Q",
if(date_month>=7 && date_month<=9,"2Q",
if(date_month>=10 && date_month<=12,"3Q","4Q")))

Yes. I created date_month as integer.
Also "processors" means "Processors library".

Thank you very much for your support!

0 Kudos
A banner prompting to get Dataiku DSS