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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
gmoney2594
Partner - Contributor II
Partner - Contributor II

Count If

Hello,

 

I want to count and bucket information by the following parameters: 

X = a number field

Count(if (x >= 0 and =< 30) = '1-30 days',

elseif (x >= 31 and =< 60) = '31-60 days',

elseif (x >= 61 and =< 90) = '61-90 days',

else (x >= 91) = 'Over 90 days')

How would I accomplish this in a bar chart

Labels (2)
1 Solution

Accepted Solutions
nikitadeshwal
Partner - Contributor III
Partner - Contributor III

Create a field 'Bucket' in script.
if(Points>=0 and Points<=30,'1-30 Days',If(Points>=31 and Points<=60,'31-60 Days',
if(Points>=61 and Points<=90,'61-90 Days',if(Points>=91,'Over 90 Days')))) as Bucket
In Bar chart,
take Dimension as Bucket and Measure as Count(Bucket )

View solution in original post

2 Replies
girish21595
Partner - Contributor III
Partner - Contributor III

Use the Class function to create the Bucket and use it as the dimension of Chart and measure as count(x).

nikitadeshwal
Partner - Contributor III
Partner - Contributor III

Create a field 'Bucket' in script.
if(Points>=0 and Points<=30,'1-30 Days',If(Points>=31 and Points<=60,'31-60 Days',
if(Points>=61 and Points<=90,'61-90 Days',if(Points>=91,'Over 90 Days')))) as Bucket
In Bar chart,
take Dimension as Bucket and Measure as Count(Bucket )