Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
what is the script to get YTD (Year Till Date)?
YTD 13-14
YTD 12-13 and so on
e.g As today is 11 Dec,
YTD 12-13 means (01 April 12) to (11 Dec 13)
YTD 13-14 means( 01 April 13) to (11 Dec 14)
pick data for this time interval
Hi Tyagi,
YTD can be calculated in different way, depend about your data model.
Usually I use set analysis with a field date.
An example in attachment
Regards
Luca Jonathan Panetta
if you want calculate YTD sales then use the YeartoDate function to create the YTD flag
YeartoDate( DateField , 0 ,4) AS YTDFlag
Thanks Panetta,
Its very helpful answer.
On Fri, Dec 12, 2014 at 8:08 PM, Panetta Luca Jonathan <
also check inyeartodate
Hi,
Try like this
=Sum({<YearDimension=, QuarterDimension=, MonthDimension=, DateDimension={'>=$(=YearStart(Today(), 0, 4))<=$(=Today())'}>} Sales)
The above expression will you the Sales for the YTD.
Note: Replace YearDimension, QuarterDimension, MonthDimension and DateDimension with your actual dimension names.
Regards,
Jagan.
Hi dathu,
Thanks for you answer.
But I have no idea, How to use flag
Hi,
If you need in script then try like this
Data:
LOAD
*,
If(YearToDate(DateDimension, 0, 4), 1, 0) AS YTDFlag
FROM DataSource;
Hope this helps you.
Regards,
Jagan.