Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Syntax for OIBEE sysdate function

Posted on 2014-12-02
6
Medium Priority
?
422 Views
Last Modified: 2014-12-04
I am using the Oracle BI Administration Tool  to create a business (BMM) model.
I want to create a logical column that calculates age based on the SYSDATE function.
Is the SYSDATE function available in the Oracle BI Admin tool or do I have to create a variable?

I tried the synatx below but I got an error:
SUM(CASE WHEN floor(MONTHS_BETWEEN(sysdate, enrol.student_dob)/12) < 15 THEN 1 ELSE 0 END)
0
Comment
Question by:mariita
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 15

Expert Comment

by:Haris Djulic
ID: 40476755
Hi,

There is currentdate variabke which you can use instead of sysdate.
0
 

Author Comment

by:mariita
ID: 40476913
When I use current_date, I get the following error message:
[nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] .

Here is the SQL statement that I am using:
SUM(CASE WHEN floor(MONTHS_BETWEEN(current_date, "Enrolment - College"."F College Enrolment"."Student DOB"   )/12) < 15 THEN 1 ELSE 0 END)
0
 

Author Comment

by:mariita
ID: 40477128
I partly solved the problem. It turns out OBIEE doesn't support MONTHS_BETWEEN, so I had to use the TimeStampDiff function. I am no longer getting an error message, but I am also not getting the same output as the original SQL.

Original SQL:

SUM(CASE WHEN floor(MONTHS_BETWEEN(sysdate, enrol.student_dob)/12) < 15 THEN 1 ELSE 0 END)


Option #1:

SUM(CASE WHEN TimeStampDiff(SQL_TSI_year, "Enrolment - College"."F College Enrolment"."Student DOB", current_date) < 15 THEN 1 ELSE 0 END)

Option #2:

SUM(CASE WHEN (TimeStampDiff(SQL_TSI_month, "Enrolment - College"."F College Enrolment"."Student DOB", current_date)) / 12 < 15 THEN 1 ELSE 0 END)
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:mariita
ID: 40480787
I've requested that this question be closed as follows:

Accepted answer: 0 points for mariita's comment #a40477128

for the following reason:

This did work after all.
0
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 2000 total points
ID: 40480269
Hi,

so my post did not answer your original question ?

Is the SYSDATE function available in the Oracle BI Admin tool or do I have to create a variable?
0
 

Author Closing Comment

by:mariita
ID: 40480788
It did answer the question, thanks! I also needed to use the TimeStampDiff function.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question