Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 

compare sales current vs previous


I have a database that has the sales of the stores by hour every day for the years 2012 and 2013.

How can i have in a chart a current sale date or a period with the previous sale date in the same weekday with set analysis.

For example i have the sales of the date 23/10/2013 which is wednesday how can i bring in a chart the sales of 24/10/2012   

which is also wednesday. Also how can i compare the month and the week and the year to date in a chart by selection.

Thank you in advance.

3 Replies
Creator III
Creator III

Try this

Atual state => Sum(Sales)

Previous state => Sum({<Year={'$(=(Year - 1))'}>} Sales)


Marco i want by selecting the 23/10/2013 automatically to bring me the 24/10/2012 and the sales of that day in a chart.

I don't know if i can convert the date to 20131023 and 201201024 and subtract 345 days and compare the weekdays.

But what can i do when the selection is the month or the week.

Is any set analysis that automatically give me the result of the previous sales by selecting only the current date or the month or the month and the week ?

Creator III
Creator III


Use the AddYears(DATE, -1)

Previous state => Sum({<DATE={'$(=AddYears(DATE, - 1))'}>} Sales)

If you attach a sample file, I can better understand what you need.