5 Replies Latest reply: Sep 30, 2015 11:35 AM by mani ram

# Chart that shows current year and (current - 1) week

Hi, QlikView

I have data set that shows sales number and date when they happen.

I want to make a chart what shows sales numbers for each day in the last week (current - 1) and only current year.

I will explain better. So today is 30.09.2015 which is week 40 in the year 2015.

I want the sales number to show week 39 in the year 2015.

I used this formula: =sum({<Year={\$(=year(today()))}, Week={\$(=week(today()))}>} Sales)

to show sales number for current week and current week.

What can I do to get week 39 in the year 2015

 Day Year Week YrWk Sales 1.1.2013 2013 1 2013-1 150.000 10.1.2013 2013 2 2013-2 320.000 19.1.2013 2013 3 2013-3 272.246 28.1.2013 2013 5 2013-5 610.481 6.2.2013 2013 6 2013-6 248.498
• ###### Re: Chart that shows current year and (current - 1) week

try this

=sum({<Year={"\$(=max(Year))"}, Week={"\$(=max(Week)-1)"}>} Sales)

• ###### Re: Chart that shows current year and (current - 1) week

hi, Kush141087

This formula does not work. The chart gives me this text: "No data to display"

Can you make it work in the Sales data per day.qvw

• ###### Re: Chart that shows current year and (current - 1) week

The formula of Ioannis is right, you just do not have data for week 39 for the current year.

Patric

• ###### Re: Chart that shows current year and (current - 1) week

Based on your formula, this works :

=sum({<Year={\$(=year(today())-1)}, Week={\$(=week(today())-1)}>} Sales)

Please note that you have no data for 2015, week 39, that is why I also used year-1

There is data for 2014, week 39

• ###### Re: Chart that shows current year and (current - 1) week

Hi,

try this one. it is helpful for you

=sum( {<year={\$(=max(Year))}>}Sales)