Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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

Re: year to date,quarter to date and month to date

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

Re: year to date,quarter to date and month to date

hi..what is Dyear and Ayear in this

Not applicable

Re: year to date,quarter to date and month to date

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
Honored Contributor II

Re: year to date,quarter to date and month to date

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

Re: year to date,quarter to date and month to date

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

rustyfishbones
Honored Contributor II

Re: year to date,quarter to date and month to date

try this for YTD and let me know if that works

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

Re: year to date,quarter to date and month to date

no its still not working..result is zero again

rustyfishbones
Honored Contributor II

Re: year to date,quarter to date and month to date

try this

YTD this Year

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

YTD last Year

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

Re: year to date,quarter to date and month to date

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.