Date Calculated Field

Hello,

I am trying to calculate quarters from a date field. in a normal SQL statement, I would use Case statement bucketing months in 4 buckets to generate Q1,Q2,Q3,Q4.
How would one do that in Dremio Query generator?

Is there a way generate a date dimension in Dremio?

Thank you.
Nabil

Dremio supports the CASE statement, but you can also use the EXTRACT function to get the quarter directly:

SELECT EXTRACT(QUARTER FROM d) FROM (VALUES(DATE '2017-09-01')) FOO(d)

Hi Laurent.

Thanks for getting me going. I used EXTRACT(QUARTER FROM DateField) in inline query.

Thanks,
Nabil