I am trying to bring different data on to a report, such as Hires, Transfers and Terms. I tried to replicate this SQL into a object called HIRES to start with, and this is what I have.
case
when ACTIONDIM.ACTION = 'HIR'
then sum(EMPLOYEETRANSACTIONFACT.factcount)
else 0
end as Hired
from EMPLOYEETRANSACTIONFACT
join ACTIONDIM
on EMPLOYEETRANSACTIONFACT.actionkey = ACTIONDIM.actionkey
and (EMPLOYEETRANSACTIONFACT.txneffectivedate >= '01-MAY-2005'
and EMPLOYEETRANSACTIONFACT.txneffectivedate <= '31-MAY-2005')
group by EMPLOYEETRANSACTIONFACT.departmentid, ACTIONDIM.action
end
I get "SQL not properly ended. " What am I doing wrong? Should I separate this into different objects or something like that?
We cannot have GROUP BY as part of the Object… That will be generated by Businessobjects based on the Dimensions and Measures used for a report…
So to go with your object definition of Hired then it should look something like this with the joins being done at the Universe Level and if needed you can add Predefined condition for constraining any dates…
SUM(
CASE
WHEN ACTIONDIM.ACTION = 'HIR'
THEN
EMPLOYEETRANSACTIONFACT.factcount
ELSE
0
END
)