Here is a data model based solution that may work for you.
LOAD * INLINE [
Date(Date#(Date,'DD-MM-YYYY')) as Date,
addyears(Date(Date#(Date,'DD-MM-YYYY')),-1) as LYDate
//Add fields for Last Year Sales
Date(Date#(Date,'DD-MM-YYYY')) as LYDate,
Sales as LYSales
drop table RawData;
Test.qvw 186.2 K
appreciate your help.
unfotunatly i cannot aggregate ACT LY in the script. It needs to be solved on the chart level.I was thinking of using dayNumberOfYear function in combination with yearStart but i have the leap year issue
DATE(yearStart(TODAY()) + dayNumberOfYear-1)
This works perfect until 28-2 after that it's breaks