Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

try,

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

View solution in original post

5 Replies
Kushal_Chawda
MVP
MVP

try,

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

sunny_talwar
MVP
MVP

Can also try this:

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

Not applicable
Author

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)

sgrice
Partner - Creator II
Partner - Creator II

This will not work over year end.

You will need a Absolute week number to do this.


Anonymous
Not applicable
Author

Thanks everyone you've all been a great help!