3 Replies Latest reply on Sep 12, 2016 11:52 PM by Paraskev Bentchev

# How to display current week and previous week of last year together?

Good Morning,

I have a scenario when I select week number, I am able to compare between current week and previous week and display together. However, when my week selection comes to week 1, I am unable to compare with previous week which is last week of previous year. Is there any solution to overcome this kind of scenario?

Attached the sample workbook that I have created for clearer picture.

Thanks.

• ###### 1. Re: How to display current week and previous week of last year together?

Hi,

The reason is that it tries to filter on week 0 and it returns null in some formulas.

In the attachment I added Year parameter and tried to calculate previous week to be included in Week Filter.

Also I changed Prev week formula and added some zn. I presume that previous week is 52. It is not perfect solution but is something to start from:)

happy weekend:)

• ###### 2. Re: How to display current week and previous week of last year together?

Hi,

I have modified the workbook based on the solution suggested. However, I am facing another problem that is the last week of certain year is week 52 and certain year is week 53. It will shows the value for both weeks instead one of the latest week. Is it possible to filter the max of previous week?  Attached with the workbook for clearer picture.

Thanks.

• ###### 3. Re: How to display current week and previous week of last year together?

Hi, again

just make new calculated field max date:

DATE({ INCLUDE [Week]: MAX([Tarikh Harga])})

and change the definition of Week Filter:

IF [Week]=[Parameters].[Week] and [Year] = [Parameters].[Year] THEN 'show'

ELSE

IF [Parameters].[Week] = 1 then

IF ([Week] = [Max Week]) and [Year] = [Parameters].[Year] - 1 then 'show'

else 'hide'

end

elseIF [Week]=[Parameters].[Week]-1 and [Year] = [Parameters].[Year] THEN 'show'

ELSE 'hide'

END

END