Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a date field which has data like Jan-15,Feb-15,Mar-15,........ Dec-15,Jan-16,Feb-16,.....Dec-16 and so on
I have calculated Quarter using below expression
'Q' & Ceil(Month(Date)/3) & '-' & Right(Year(Date),2)) as Date
How to calculate QTD and YTD in script same way?
You can use the QV date functions InQuarterToDate() and InYearToDate() to flag your Date values. Then group by these flags to aggregate the facts, or use the flag in the frontend to filter the records.
Hi Uday
Is your Calendar actually at date or month level?
if(if(Month(date(Floor(Date)))<=3,(Year(date(Floor(Date)))-1)&'-'&(Year(date(Floor(Date)))),(Year(date(Floor(Date))))&'-'&(Year(date(Floor(Date)))+1))=if(Month(((today())))<=3,(Year(((today())))-1)&'-'&(Year(((today())))),(Year(((today()))))&'-'&(Year(((today())))+1)),1,0) as YTD_Flag,
Try this for YTD in Script
'Q' & (ceil(WildMatch(month(Date),'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar')/3)) as QTD
Try this for QTD in Script
Hope this will helps u...!!!
Regards,
Mohammad
see these as well:
Current and Previous YEAR MTD, QTD and YTD
Previous YTQ, QTD, MTD and WTD
Hope this will help!!
Hi all,
The date is at month level.
I have to show month, quarter, QTD and YTD all in same field like this
I have calculated Quarter using months, now i want QTD and YTD for the current year.
So how to get it and append that QTD and YTD to date field as shown below in table
This is a pivot table so i have dragged the date field horizontally in the table.
Dim1 | YTD | QTD | Q4-15 | Dec-15 | Nov-15 | Oct-15 | Q3-15 | Sep-15 | Aug-15 | Jul-15 | Q2-15 | Jun-15 | May-15 | Apr-15 | Q1-15 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | 10 | 01 | 10 | 4 | 5 | 6 | 5 | 6 | 5 | 6 | 5 | 6 | 5 | 6 | 56 |
B | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 |
C | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 |