Discussion Board for collaboration on QlikView Scripting.
I have a requirement like to compare current year date and last year same date sales.
And i have a data like this below.
But the output i needed was like in this format.
Current year was the actual sales in that date.And the previous year was same date last year's data .
If the date is 1/3/2015,then it should populate 1/3/2014 data in the Previous year column.
Can any one help me on this above requirement.Thanks in Advance
If date is your dimension
then for Current Year
for Previous Year
I suggest that you upload a sample qvw file with the relevant data loaded (or the source data in a file) for more specific help.
Do you want to do this calculation during load or in the front end?
Date(Date#(Date,'D/M/YYYY')) as Date,
Mapping Load Date as MapDate, Sales as MapSales Resident Sales;
ApplyMap('Map_Sales',AddYears(Date,-1),0) as PreYearSales
Drop Table Sales;
Try this script
Date(Date) AS Date,
LEFT JOIN (Data)
AddYears(Date, 1) AS Date,
Sales AS PreviousYearSales
WHERE Year(Date) < Year(Today());