Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
master_student
Contributor III

value of week -1

Hello Guys,

I need to get the value of week -1 compared with week of today()-1 / any idea ?

Here are the fileds of week of my calendar dimension:

Capture.PNG

if u like, i will give you my calendar dimension script

Thanks a lot

11 Replies
Highlighted

Re: value of week -1

In which object?

Highlighted
MVP
MVP

Re: value of week -1

For last week against a date field, try like:

Week(Date-7) as LastWeek

For static week value compared to today, try like = Week(today()-7)

Highlighted
master_student
Contributor III

Re: value of week -1

here is my expression :

=num(sum(RVN_AIRTIME ) ,'# ##0')

Highlighted

Re: value of week -1

I asked about which object are you trying to do this? Text box? Straight table? Bar chart?....

Highlighted
master_student
Contributor III

Re: value of week -1

sorry, it s a text box

Highlighted

Re: value of week -1

May be this

=Num(Sum({<[calendar date] = {"$(='>=' & Date(Today() - 8, 'D/M/YYYY') & '<=' & Date(Today() - 1, 'D/M/YYYY'))"}>}RVN_AIRTIME ) ,'# ##0')

So, if today is 10/23/2017, the above expression will show 10/15/2017 to 10/22/2017. Tomorrow when it will be 10/24/2017, the above expression will show 10/16/2017 to 10/23/2017. Is this what you want?

Highlighted
master_student
Contributor III

Re: value of week -1

Thanks Sunny, That's it, but i want to use a week of date filed in my calendar dimension, but it didn't work :

=num(sum({<[Week of date]  = {"$(=[Week of date]-1)"} >} RVN_AIRTIME),'# ##0')

is there any error in my expression ?

Thanks

Highlighted
Or
Valued Contributor II

Re: value of week -1

This is a little tricky, because it depends on your week numbering system.

Getting the week value for all but the first/last weeks is easy - just subtract one.

If it's important to get this correct for the first/last week (which can be 52, 53, or 54 depending on system and may be a partial week depending on system), you'll have to use the same function for this as you did to get the week numbers in the first place. As long as you aren't using partial weeks, the approach suggested by Tresesco above - Date-7 - should work.

Highlighted

Re: value of week -1

Why week of date? what is the issue with calendar date?