on 09-27-2013 2:57 PM
Hi all,
How can I calculate YTD from Sybase IQ, In BO I am trying to calculate this :
I have code for oracle , Please help
I need the below as date because in BO , I will pull the start date as this object and end date the user will enter,
SUM
(
CASE WHEN (Sometable.Fact_Date) between TRUNC (sysdate , 'yyyy') and sysdate
THEN FactTable.Measure
END
)
I’m not clear about your question, but if you what a sum for
a fact mesure for the YTD, you only need
select sum (fact_mesure)
from DBA.fact_table
where year(fact_date) = year(getdate())
Hope this help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In Business Objects, I have a date filter with Start date and End date.
Based on the End date , the start date should start 01/01/XXXX.
XXXX is the Year of the end date.
Below is something I did for First of the quarter, I need the same way for the Year.
I added the below code for Start date and End date will prompt for the user.
cast( ( CASE WHEN QUARTER(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)=1 THEN trim(Convert(varchar(20),Year(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE))) + '-01-01'
WHEN QUARTER(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)=2 THEN trim(Convert(varchar(20),Year(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)) ) + '-04-01'
WHEN QUARTER(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)=3 THEN trim(Convert(varchar(20),Year(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)) ) + '-07-01'
WHEN QUARTER(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)=4 THEN trim(Convert(varchar(20),Year(RGH.FACTPAYROLL_V.PAYROLLPAIDDATE)) ) + '-10-01'
END
) as date)
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.