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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

select sales between a range of weeks

Hello

I got a chart in which I want to select the season to date sales

by season to date I mean:

I got a field called Week

the user selects a value of Week from a list box

if the user selects a value between 1 and 26 then the season to date sales has the following expression:

sum({<Week ={"<=$(=Week)"}>} amount)

however if the user selects a value greater than 26 then the expression I'm using is the following:

sum({<Week={">=$(27) <=$(=Week)"}>}amount)

however both expressions are displaying the same result

why? please advise

I can walk on water when it freezes
5 Replies
swuehl
MVP
MVP

There is probably no variable called 27, so try

sum({<Week={">=27 <=$(=Week)"}>}amount)

instead of $(=Week) I would recommend to use $(=max(Week)) to cope with multiple selections (if max(Week) is appropriate in your case.

Regards,

Stefan

ali_hijazi
Partner - Master II
Partner - Master II
Author

I also tried sum({<Week={">=27....

but still the same result

I can walk on water when it freezes
swuehl
MVP
MVP

Can you also select on other fields, like Month? Maybe you need to clear these other fields, like

sum({<Week={">=27 <=$(=Week)"}, Month= >}amount)

What results do you get? zero or a different value? Does the result change on selecting different Week value?

ali_hijazi
Partner - Master II
Partner - Master II
Author

it only worked when I put the following

sum({<Week={"<=$(Week)" >=27"}>}amount)

I can walk on water when it freezes
swuehl
MVP
MVP

There are three double quotes in your set element search expression? I believe this should result in a syntax error, so at best the set expression is just ignored completely. Hm, I don't know what's going on there, any chance to upload a small sample?