Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor

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

Re: Count units between weeks

try,

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

View solution in original post

5 Replies
Highlighted

Re: Count units between weeks

try,

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

View solution in original post

Highlighted

Re: Count units between weeks

Can also try this:

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

Highlighted
Not applicable

Re: Count units between weeks

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
Partner

Re: Count units between weeks

This will not work over year end.

You will need a Absolute week number to do this.


Highlighted
Contributor

Re: Count units between weeks

Thanks everyone you've all been a great help!