Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Highlighted
darrihilmarsson
New Contributor III

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
Partner
Partner

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

5 Replies

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

try this

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

darrihilmarsson
New Contributor III

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

Partner
Partner

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

Partner
Partner

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

maniram23
Contributor II

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

Hi,

try this one. it is helpful for you

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