Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

year to date,quarter to date and month to date

how can i find sum of sales over year to date,quarter to date and month to date after picking any saledate..pls provide the steps.

16 Replies
Not applicable
Author

Hi Monica,

here it is

sum( if (DYear=AYear and DMonth<=AMonth, amt))

in this example your table "ADates" is not link to the model

best reagrds

chris

Not applicable
Author

hi..what is Dyear and Ayear in this

Not applicable
Author

This is an example you have to set according to your own script

Let us say  your Sales table contains dates infos like DYear, Dmonth, DWeek....

and a table for Dates which contains AYear, AMonth, AWeek and so on. This table is not attached to the model. So you can compare the Sales dates according the dates you selected in table Dates

I hope it's clearer.

best regards

chris

rustyfishbones
Master II
Master II

Try these

YTD

SUM(

{<Date = {">=$(=DATE(FLOOR(YEARSTART($1))))<$(=DATE(FLOOR($1)))"}>}Sales)

QTD

SUM({<

Date = {">=$(=DATE(FLOOR(QUARTERSTART($1))))<$(=DATE(FLOOR($1)))"}

>}Sales)

MTD

SUM){<

Date = {">=$(=DATE(FLOOR(MONTHSTART($1))))<$(=DATE(FLOOR($1)))"}

>}Sales)

Not applicable
Author

Thnx alan, bt its not working..no data comin.

rustyfishbones
Master II
Master II

try this for YTD and let me know if that works

sum({$<Year = {$(=only(Year))}, Month = {"<=$(=max(Month))"}>} Sales)
Not applicable
Author

no its still not working..result is zero again

rustyfishbones
Master II
Master II

try this

YTD this Year

SUM({<Year={$(=MAX(TOTAL Year))}>}Sales)

YTD last Year

SUM({<Year={$(=MAX(TOTAL Year)-1)}>}Sales)
lakhansajwan
Contributor III
Contributor III

that is i want to select one date and depending on that it will show me the sales for the that selected date from the starting of that year .

I want this for any particaular date when it is selected.............

Plz tell me if any one knows it.