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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

sum for range values

hi,

i need to calculte value for range for exm:

how many orders i have with 1-20 items, and 21-35 items , and 35-40 items and so on...

i write - count({<numitem={'>1or<20'}>}ordersnumber

but it doesn't work good in all Cases.

how do i need to write it ?

thanks'

yarin.

2 Replies
tresesco
MVP
MVP

If you have equi length gaps, you can try class().

er_mohit
Master II
Master II

try this way

count({<numitem={'>=1<=20'}>}ordersnumber)

count({<numitem={'>=21<=35'}>}ordersnumber)

count({<numitem={'>=36<=40'}>}ordersnumber)

or try this way in script side

RangeOnly(if(numitem>=1 and numitem<=20,'1-20 Items',

RangeOnly(if(numitem>=21 and numitem<=35,'21-35 Items',

RangeOnly(if(numitem>=35 and numitem<=40,'35-40 Items')))))) as Field