Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
amber2000
Creator
Creator

Can't get Prior Year (YTD) to work

Hello everybody,

I've read a lot about YTD, MTD  and I'm trying to implement this in my report.

I have 2 years of data(from jan 2014 untill now 2015)

In my KPI meter I want to show the sum of a value from today (05/08/2015) untill last year (05/08/2014)

YTD MaxDate is working great 😉

YTD PriorYearDate gives me 0's and shows no value at all.

Am I doing something wrong?

I attach my report so everyone can see what I mean.

Can anybody help me out please???

Kind regards,

Ambertje

1 Solution

Accepted Solutions
kavita25
Partner - Specialist
Partner - Specialist

Check the attached qvw

View solution in original post

17 Replies
antoniotiman
Master III
Master III

Hi,

Your variable vPriorYearDate has format ' DD MMM YYY'

Calendar_Day has Fromat 'YYYYMMDD'

Change format of variable 'YYYYMMDD'

Regards

amber2000
Creator
Creator
Author

Hi Antonio

You are so wright, I've adjusted the format of  vPriorYearDate to 'YYYYMMDD'.

So now I see data for every month of 2014 and the total of 2014,  but 0's for 2015.

There must be another mistake somewhere.

kind regards,

Ambertje

qlikmsg4u
Specialist
Specialist

try this expression and let us know

=Sum({$<Year=,Month=,Day=,Calendar_Day={'<=$(vPriorYearDate)'},MonthYear=,Bex_Action_Type ={FREINTE}>}[Bex_Value]) - sum({$<Year=,Month=,Day=,Calendar_Day={'<=$(vPriorYearDate)'},MonthYear=,[Litige voor KDC]={Ja}>}Waarde) + sum({$<Year=,Month=,Day=,Calendar_Day={'<=$(vPriorYearDate)'},MonthYear=>}[Bex_Shipped_Value]*'0,02%')

amber2000
Creator
Creator
Author

Hello KN,

I already tried this out and this gives me the total for the 2 years toghether.

Also I get a value for MonthYear '-' (no month indication)

Kind regards,

Ambertje

kavita25
Partner - Specialist
Partner - Specialist

Hi,

What is your expected result where values are showing 0?

antoniotiman
Master III
Master III

I don't see 0 for 2015.

Can You post any screenshot ?

maximiliano_vel
Partner - Creator III
Partner - Creator III

I took the liberty to make some changes in your date fields, please check, the 0 values that appear in the column YTD Prior is because the values are accumulating from Jan.01/2014 to Aug.03/2014 (your max date in the data is Aug.03/2015). In the column YTD 2015 the 0 values is because your accumulating values from Jan.01/2015 to Aug.03/2014

Please see attached file

Regars

amber2000
Creator
Creator
Author

Hi Maximiliano,

The data is'nt correct anymore:

Jan 2014 should be -44.801, in your example it is -51.961

Also the values are only filled from jan 2014 untill aug 2014 (jan 2015 - aug 2015 has no values)

Kind regards,

Ambertje

amber2000
Creator
Creator
Author

YTD_result.png
This screenshot is what the data should look like.

The result for 1 year (from aug-14 until jul-15) is 142.452

Kind regards,

Ambertje