Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

1 Solution

Accepted Solutions
Kushal_Chawda

try,

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

View solution in original post

5 Replies
Kushal_Chawda

try,

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

sunny_talwar

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!