# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

## Count If function

Hi All,

This might seem as a very basic question, but I am trying to figure out a formula that will count the number of days that show an aging of 90-120 days old.

Count(if[Aging Days].......

Thanks,
Charles

1 Solution

Accepted Solutions
MVP

## Re: Count If function

Use set analysis like:

Count({<[Aging Days]={'>=90<=120'}>} [Aging Days])

8 Replies
Contributor II

## Re: Count If function

Hi,

Are you trying to do this within a script or a chart? It´s often said that for performance reason it´s better to do this within the script and then you would create a new colum:

if(AgingDays                    > '90',         ‘0',
if(AgingDays              < '90',         '1',

if(AgingDays         < '120',        '0'))) as AgingDaysCount

Then within your chart you can use Sum(AgingDaysCount)

I hope this helps.

Contributor II

## Re: Count If function

You can also use <=90 and <=120.

MVP

## Re: Count If function

Use set analysis like:

Count({<[Aging Days]={'>=90<=120'}>} [Aging Days])

MVP

## Re: Count If function

Hi

You can easily achieve this by using Set Analysis, which has better performance than IF()

=Count({<AgingDays={'>=90<=120'}>} SomeDimensionName)

Hope this helps you.

Regards,

jagan.

Not applicable

## Re: Count If function

Thanks tresesco!

This formula worked!

Not applicable

## Re: Count If function

Thanks all for the fast response and support. i got the answer I needed.

Valued Contributor

## Re: Count If function

In addition, you can explore the Class() function (used in the loader) very handy for banding your age range data.

MVP

Hi,