Categories
- All Categories
- Oracle Analytics Learning Hub
- 27 Oracle Analytics Sharing Center
- 18 Oracle Analytics Lounge
- 236 Oracle Analytics News
- 45 Oracle Analytics Videos
- 16K Oracle Analytics Forums
- 6.2K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 87 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
OBIEE - day of year to date - cannot figure out!
hello all - hoping someone here has tried this and can offer some help.
i am trying to do the following in OBIEE:
select cast(DATEADD(Day,cast(substring('19087',3,3) as int),DATEADD(year,concat('20',left('19087',2))-1900,0)) as date) as mdt
what this does in SQL is takes the year, left 2 digits, and the DAY of the year, 087, and turns it in to 2019-03-29
i CANNOT figure this out...at all in OBIEE.
can anyone help?
thank you!
Answers
-
Something like this: TIMESTAMPADD(SQL_TSI_DAY, CAST(RIGHT('19087', 3) as INT), TO_DATETIME('20' || LEFT('19087', 2) || '-01-01', 'yyyy-mm-dd'))
But ideally you must have a proper time dimension giving you various formats representing the dates based on your needs.
0 -
thank you so much for your reply Gianni!!
when trying to use this in my Column Formula window i am receiving an error:
Formula syntax is invalid.
[nQSError: 10058] A general error has occurred. Please have your System Administrator look at the log for more details on this error. (HY000)
[nQSError: 43113] Message returned from OBIS. Please have your System Administrator look at the log for more details on this error. (HY000)
[nQSError: 27042] Function TO_DATE is not defined by administrator. Please have your System Administrator look at the log for more details on this error. (HY000)
SQL Issued: SELECT TO_DATE('20' || LEFT('19087',2) || '-01-01','yyyy-mm-dd') FROM "tblS"
i'm guessing this is something i will have to ask the admin about??
0 -
-
Sorry bout that - turns out there was some bad data i had to "CASE WHEN" around.
your code worked perfectly.
thank you
0
