Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare previous year and current year but curtain weeks

Hi, Qlikview community

I have a problem I need to solve.

In my dataset I have revenues for 2016 and 2015 and my users want to compare these number.

But I want to show only the weeks that has passed in the current year when they open the tab.

So today is Year 2016 and week 10 then I want the user to only to compare weeks 1-10 that data in tables and charts.

I use this formula to filter the data for max(year): Year ={$(=max(Year))}   (see the qlikview file)

I use this formula to filter the data for max(year): Year ={$(=max(Year)-1)} 

But how can I only get week 1-10 for Revenues for 2015 and not the whole year.

  regards Darri

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I have made some change in Script and also in Chart.

Have a look at the example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
sunny_talwar

Try this expression:

=If(SUM({$<Year ={$(=max(Year))}>}[Actual Revenue]) > 0, SUM({$<Year ={$(=max(Year)-1)}>}[Actual Revenue]))


Capture.PNG

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I have made some change in Script and also in Chart.

Have a look at the example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!