Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Hi M@dhu,
Do u have any QVW file, if u have post it?
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, 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
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
Arvind 64 explaind about PYTD with example code.
Hi Dinesh,
No I don't have any QVW..
Thanks,
Madhu
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
Hi Habib Shaik,
Thanks for your reply. Can you also help me with the YOY expressions.
Thanks,
M@dhu
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