Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabu
Contributor III
Contributor III

What is difference between YTD, PYTD and YOY,

Hi QV Experts,

Can any one help me with what is YTD, PYTD and why we use this. How to write those expressions in front end and in back end.

Also I went to what is the difference between YOY and YTD.

What exactly mean by YOY and YTD. Can any one tell me the expressions for that.

thanks,

M@dhu

1 Solution

Accepted Solutions
Not applicable

May be you can try as below three expression with 2014-2013, 2013-2012, 2012-2011 as labels accordingly for below expression:

=((sum({$<Year = {$(=max(Year))}>}Sales) - sum({$<Year ={$(=max(Year)-1)}>}Sales))/ sum({$<Year = {$(=max(Year)-1)}>}Sales)) * 100


=((sum({$<Year = {$(=max(Year)-1)}>}Sales) - sum({$<Year ={$(=max(Year)-2)}>}Sales))/ sum({$<Year = {$(=max(Year)-2)}>}Sales)) * 100


=((sum({$<Year = {$(=max(Year)-2)}>}Sales) - sum({$<Year ={$(=max(Year)-3)}>}Sales))/ sum({$<Year = {$(=max(Year)-3)}>}Sales)) * 100

View solution in original post

11 Replies
dineshm030
Creator III
Creator III

Hi M@dhu,

Do u have any QVW file, if u have post it?

MK_QSL
MVP
MVP

YTD = Year To Date

For Current Year... Data From 01/01/2016 to 24/11/2016 (Today's Date)

PYTD = Previous Year To Date

For Current Year... Date From 01/01/2015 to 24/11/2015 (Last Years' Today's date)

For YOY check this blog..

Year-over-Year Comparisons

Not applicable

Year, Quarter, Month and Week To Date are the common analysis that I seen many applications. I will share the expression to do here

First to do this your data model should have the DateField in number format by applying floor

Similar to this

Floor(DateField) AS DateNum //it will gives you one whole number to represent date

YTD - Year To Date

A date should be selected and it will look for the Starting date of the year to the selected date.

Ex: date selected is 21-03-2014 then YTD is 01-01-2014 to 21-03-2014

Expression would be

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(YearStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

QTD- Quarter to Date

In the place of year use Quarter

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(YearStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

MTD- Month to Date

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

WTD- Month to Date

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(WeekStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

if you want you can set a variable value as 'Year', 'Month', 'Quarter', 'Week', lets say vToDate and go with single chart and single expression

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num($(=vToDate& 'Start(Max(DateNum))')))<=$(=Max(DateNum))"}>} Sales)

Will keep your expression simple

ramasaisaksoft

Hi Madhu,

YOY- ex:-overall sales from current year to previous year.

https://community.qlik.com/blogs/qlikviewdesignblog/2014/03/03/ytd

Set Analysis for certain Point in Time

For PYTD

YTD &amp; PYTD as Selection?

Arvind 64 explaind about PYTD with example code.

madhubabu
Contributor III
Contributor III
Author

Hi Dinesh,

No I don't have any QVW..

Thanks,

Madhu

madhubabu
Contributor III
Contributor III
Author

Hi Manish,

Thanks for your quick reply.

How to define the expressions in front end and back end for YTD, PYTD, MTD,PMTD,QTD,PQTD

Thanks,

M@dhu

madhubabu
Contributor III
Contributor III
Author

Hi Habib Shaik,

Thanks for your reply. Can you also help me with the YOY expressions.

Thanks,

M@dhu

madhubabu
Contributor III
Contributor III
Author

Hi Rama Sai,

Thanks for the reply.

I have gone through that link but not able to understand can any one simplify that.

Thanks,

M@dhu