# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for
Did you mean:
Highlighted Creator

## Count units between weeks

Hi all,

I'm struggling.

What I'm trying to do is count how many units were sold between two weeks ago and 24 weeks ago.

My expression is below,

sum({<UNIT.SOLD_WEEK=    {"<=\$(=\$(Week(today())-2)>=\$(=\$(Week(today())-24)"} UNIT.TOTALSOLD)

Could anyone point out where I'm going wrong?

Thanks

Gareth

1 Solution

Accepted Solutions
Highlighted MVP

try,

sum({<UNIT.SOLD_WEEK=    {"<=\$(=Week(today())-2)>=\$(=Week(today())-24)"} >}UNIT.TOTALSOLD)

5 Replies
Highlighted MVP

try,

sum({<UNIT.SOLD_WEEK=    {"<=\$(=Week(today())-2)>=\$(=Week(today())-24)"} >}UNIT.TOTALSOLD)

Highlighted MVP

Can also try this:

Sum({<UNIT.SOLD_WEEK=    {"\$(='<=' & (Week(Today())-2) & '>=' & (Week(Today())-24))"}>} UNIT.TOTALSOLD)

Highlighted Not applicable

Hi,

you missed out the set modifier and thats why the error.

Try like this:

sum({<UNIT.SOLD_WEEK= {">=\$(=Week(today())-24)<=\$(=Week(today())-2)"} >}UNIT.TOTALSOLD)

Highlighted Partner

This will not work over year end.

You will need a Absolute week number to do this.

Highlighted Creator

Thanks everyone you've all been a great help! 