Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

     

DayYearWeekYrWk Sales
1.1.2013201312013-1   150.000    
10.1.2013201322013-2   320.000    
19.1.2013201332013-3   272.246    
28.1.2013201352013-5   610.481    
6.2.2013201362013-6   248.498    
1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

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

View solution in original post

5 Replies
Kushal_Chawda

try this

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

Anonymous
Not applicable
Author

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

giakoum
Partner - Master II
Partner - Master II

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

pamaxeed
Partner - Creator III
Partner - Creator III

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

Patric

maniram23
Creator II
Creator II

Hi,

try this one. it is helpful for you

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