DataBrewery / cubes

[NOT MAINTAINED] Light-weight Python OLAP framework for multi-dimensional data analysis
http://cubes.databrewery.org
Other
1.49k stars 314 forks source link

Extracting the week from a date in Oracle #438

Open pablolmedorado opened 7 years ago

pablolmedorado commented 7 years ago

Hello everyone;

I use Oracle as backend and I'm having problems when I try to extract the week from a datetime field.

I tried using "extract" in the mapping configuration but it seems that Oracle does not allow it (I can do it with day, month, year, hour, minute and second). Https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions050.htm

I read that it is possible to do so using TO_NUMBER(TO_CHAR(_datetimefield, 'ww')) and I thought I would use the "function" field instead of "extract", but the syntax of the "function" field does not allow it.

Any ideas? Thanks in advance!