Qlik Community

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

Re: YTD

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,
Sales
Inline
[
Date,       Sales
01/01/2014, 100
10/01/2014, 1000
04/02/2014, 500
03/03/2014, 1200
15/03/2014, 130
25/03/2014, 200
01/04/2014, 180
21/04/2014, 300
15/05/2014, 200
20/05/2014, 100
11/06/2014, 400
12/07/2014, 220
20/07/2014, 450
01/08/2014, 600
15/08/2014, 200
17/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

Re: YTD

thx

Re: YTD

Hi,

Can you close this thread by selecting appropriate answers

Regards

ASHFAQ

Highlighted
Partner
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.