COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: inu on 20 Mar 2014 01:19:29 AM

Title: how to know the today's hired employee name
Post by: inu on 20 Mar 2014 01:19:29 AM
HI
How can i get the names of employees who have been hired today itself.

Please give the syntax. i m new to cognos and database

Regards
Inam
Title: Re: how to know the today's hired employee name
Post by: CognosPaul on 20 Mar 2014 02:04:01 AM
Inam,

There is no way for anyone to answer this effectively. We are not familiar with your system. Looking at your latest post, I see that you're using Oracle. Apart from that, there is no way for me to know how your database contains this information. Is there an employee table? Is there a separate employee history table? Is it a slowly changing? Is there an ETL process that populates those tables? Are you referencing these tables in your framework model? Have you contacted the framework modeler?

Before continuing, I strongly recommend reading tutorials on PL/SQL (a good one here (http://plsql-tutorial.com/)) and paying for Cognos training. A basic understanding of SQL is absolutely essential if you are planning on working with Report Studio. I also recommend having your company arrange an internal training for the framework model.
Title: Re: how to know the today's hired employee name
Post by: nblank on 20 Mar 2014 02:16:38 AM
For a solution I can imagine there is a table in the database containing your employee's contracts.

EMP DATE_START      DATE_END
1      01-01-2014      null
2      01-04-2013      31-12-2013
3      01-01-2014      31-03-2014

So if you ask for the number of employee's today (20-03-2014):

with emp as  (
select 1 EMP , to_date('01-01-2014','dd-mm-yyyy') date_start     , null                                                     date_end  from dual union
select 2        , to_date('01-04-2013','dd-mm-yyyy')                       , to_date('31-12-2013','dd-mm-yyyy')                    from dual  union
select 3        , to_date('01-01-2014','dd-mm-yyyy')                       , to_date('31-03-2014','dd-mm-yyyy')                    from dual   
)
select count(distinct EMP) nbr_of_emp from emp where SYSDATE between DATE_START and nvl(DATE_END , (SYSDATE + 1))

The result = 2