# New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

## YTD

In my table month range is 01,02,03,04,05,..............

if I select 04,

how can i get YTD ? that means jan to apr value.

11 Replies
Contributor II

## Re: YTD

Hi,

Check this

YTQ, QTD, MTD and WTD

Regards

ASHFAQ

Not applicable

## Re: YTD

hi Ashfaq,

i can't identify solution from this. please post me an example.

thx

Rgds

Chandana

## Re: YTD

One of the good example from Manish Kachhia

```Consider that you have below dummy data….

Load Date(Date) as Date,Month(Date) as Month,'Q'&Ceil(Month(Date)/3) as Quarter,SalesInline[Date,       Sales01/01/2014, 10010/01/2014, 100004/02/2014, 50003/03/2014, 120015/03/2014, 13025/03/2014, 20001/04/2014, 18021/04/2014, 30015/05/2014, 20020/05/2014, 10011/06/2014, 40012/07/2014, 22020/07/2014, 45001/08/2014, 60015/08/2014, 20017/08/2014, 220 25/08/2014, 10000];

SUM({<Date = , Month =, Quarter = >}Sales)
will give you Total Sales 16000

SUM({<Date = , Month =, Quarter = , Date = {">=\$(=YearStart(Today()))<=\$(=Today())"}>}Sales)will give you Total Sales For Current Year to Date

SUM({<Date = , Month =, Quarter = , Date = {">=\$(=MonthStart(Today()))<=\$(=Today())"}>}Sales)will give you Total Sales for Current Quarter to Date

SUM({<Date = , Month =, Quarter = ,Date = {">=\$(=QuarterStart(Today()))<=\$(=Today())"}>}Sales)Will give you Total Sales For Current Month to Date

The above YTD, QTD and MTD irrespective of Date, Month and Quarter selection as these fields are already bypassed…

```

Quoted from HERE

Regards

ASHFAQ

Not applicable

## Re: YTD

For my example , I have month like 1,2,3,4,5,6,7,8,9,10,11,12

Then how can I do this

## Re: YTD

Concept will be same.

You just need to fine week code

Regards

ASHFAQ

Not applicable

thx

Hi,

Regards

ASHFAQ

Highlighted
Partner

## Re: YTD

Hi, you could construct an expression using Yearstart(), Getfieldsselections() and Max() functions.

But I'm sure best practice would be to teach your users how to select a range...

regards,

M.