10 Replies Latest reply on May 8, 2013 1:55 AM by Rajini S

# How to find previous 4 week change % with week filter

Hi All,

I am facing issue to find previous 4 week change %.

Ex. I need Wk 10th previous 4 week % and calculation as below,

Wk 10 - 761

Last 4 week average - Wk 9 to Wk 6 = 757

% Change               - (761-757)-757 * 100 = 0.53 %

I am able to achieve the above logic in attached sample file using window calculation and I am able get % change for all week.

When I use week filter then window calculation does not work. It is simply returning null.

Anyone have idea how to get last 4 week % change with week filter?

Best Regards,

Rajini

• ###### 1. How to find previous 4 week change % with week filter

Ranjini, you'll need to post a packaged workbook (twbx). The one you posted (twb) doesn't have any data in it.

• ###### 2. Re: How to find previous 4 week change % with week filter

Sorry for that. It should be fine now.

Br,

Rajini

• ###### 3. Re: How to find previous 4 week change % with week filter

Rajini, I'm not seeing the behavior you're describing. The WINDOW_AVG you've set up is behaving as expected. Just to make sure we're seeing the same thing, here's the unchanged workbook you posted:

When I turn off W12-W15 here's what I get:

Are you getting something different?

--Shawn

• ###### 4. Re: How to find previous 4 week change % with week filter

Hi Shawn,

Have you checked with week filter. If you select any week then you will get null as below picture. I need to select only one week in the week filter and need to get previous 4 week % change.

Br,

Rajini

• ###### 5. Re: How to find previous 4 week change % with week filter

Rajini, I understand. The problem is that you're using a WINDOW_AVG and asking Tableau to sum 4 rows. If you only give Tableau 1 row it can't do the math so it gives you a NULL. There's probably a workaround but I don't have don't have the time to work it out now. Maybe one of the other folks have solved this before and can help you out.

--Shawn

• ###### 6. Re: How to find previous 4 week change % with week filter

Hi Shawn,

Thanks for your reply.I used window calculation to explain my report logic and I know, this will work only with many weeks. So that I have raised in this forum and I am asking you guys help to find other alternate way.

I already verified this Tableau forum, but there was no any request as this one.

Anyone have idea to achieve the functionality ?

Br,

Rajini

• ###### 7. Re: How to find previous 4 week change % with week filter

I don't know if this will help, but Joe Mako  answered a similar question today: http://community.tableau.com/thread/125957

This might offer some insights.

--Shawn

• ###### 8. Re: How to find previous 4 week change % with week filter

Great Thanks for your post Shawn. This is resolved my issue. I have attached the working logic report for reference and anyone can use.

Br,

Rajini

• ###### 9. Re: How to find previous 4 week change % with week filter

Hi Shawn.

One addition in the report. I am not able to use Week filter as Global filter and not able to use Parameter as well. I am using the above logic in multiple sheet and putting in a dashboard. But I am not able to use single week filter to apply in multiple sheet.

Do you have any idea how to use Week filter as Global or to use week paramter?

Br,

Rajini

• ###### 10. Re: How to find previous 4 week change % with week filter

I resolved myself to add parameter.

Created week parameter and changed the calculation as below and created new condition for week.

Week Filter        : LOOKUP(MAX([Select Week]),0)

Week Condition  : ATTR([week])=[Week Filter]

Attached file.

Br,

Rajini